-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdeployment-jenkins.yaml
53 lines (53 loc) · 2.02 KB
/
deployment-jenkins.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
kind: Deployment
apiVersion: apps/v1
metadata:
name: jenkins
spec:
replicas: 1
selector:
matchLabels:
app: jenkins
template:
metadata:
labels:
app: jenkins
spec:
containers:
- name: jenkins
image: localhost:32000/jenkins-with-docker #jenkins/jenkins:lts-alpine #10.152.183.58:5000/jenkins-with-docker #registry.container-registry.svc.cluster.local:5000/jenkins-with-docker #jenkins/jenkins:lts
#securityContext:
# privileged: true # would also need to add "--allow-privileged=true" to i) `sudo vim /var/snap/microk8s/current/args/kubelet` and ii) `sudo vim /var/snap/microk8s/current/args/kube-apiserver`
# then do: `sudo systemctl restart snap.microk8s.daemon-kubelet.service` and `sudo systemctl restart snap.microk8s.daemon-apiserver.service`
ports:
- containerPort: 8080
volumeMounts:
- name: storage
mountPath: "/var/jenkins_home"
# - name: ssh-volume
# mountPath: "/var/jenkins_home/.ssh"
# `docker` inside Docker won't work! Pass up to the host's docker :)
# Note: it is very important to adjust the container docker's gid to be the same as the host docker gid
- name: docker-sock-volume
mountPath: /var/run/docker.sock
- name: kube-config
mountPath: ~/.kube/config
- name: artifactory-storage
mountPath: "/mnt/artifactory"
volumes:
- name: storage
persistentVolumeClaim:
claimName: pvc-jenkins
# - name: ssh-volume
# secret:
# secretName: ssh-jenkins
- name: docker-sock-volume
hostPath:
path: /var/run/docker.sock
type: File #local file! :)
- name: kube-config
hostPath:
path: /home/ehynes/.kube/config.jenkins
type: File ##local file! :)
- name: artifactory-storage
persistentVolumeClaim:
claimName: pvc-artifactory-storage