[CI/CD] Jenkins + Git 으로 CI/CD 환경 구축하기 [1/2]

1. Jenkins Install

apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins
spec:
replicas: 1
selector:
matchLabels:
app: jenkins
template:
metadata:
labels:
app: jenkins
spec:
containers:
- name: jenkins
image: jenkins/jenkins:lts-centos
ports:
- containerPort: 8080
volumeMounts:
- name: jenkins-home
mountPath: /var/jenkins_home
volumes:
- name: jenkins-home
persistentVolumeClaim:
claimName: jenkins-pvc
apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
selector:
app: jenkins
#kubectl get svc
#kubectl exec -it [jenkins-pod-name] cat /var/jenkins_home/secrets/initialAdminPassword

2. GitLab Install

apiVersion: apps/v1
kind: Deployment
metadata:
name: gitlab
spec:
replicas: 1
selector:
matchLabels:
app: gitlab
template:
metadata:
labels:
app: gitlab
spec:
containers:
- name: gitlab
image: gitlab/gitlab-ce:latest
ports:
- containerPort: 80
volumeMounts:
- name: gitlab-data
mountPath: /var/opt/gitlab/
volumes:
- name: gitlab-data
persistentVolumeClaim:
claimName: gitlab-pvc
apiVersion: v1
kind: Service
metadata:
name: gitlab-service
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
selector:
app: gitlab

--

--

gooby goober yeah

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store