-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins-staefullset.yml
55 lines (55 loc) · 1.26 KB
/
jenkins-staefullset.yml
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
54
55
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: jenkins-standalone-statefulset
spec:
serviceName: "jenkins-service"
selector:
matchLabels:
app: jenkins-master
replicas: 2
template:
metadata:
labels:
app: jenkins-master
spec:
securityContext:
fsGroup: 1000
runAsUser: 1000
serviceAccountName: jenkins-service-account
containers:
- name: jenkins-master
image: jenkins/jenkins:lts
volumeMounts:
- mountPath: "/var/jenkins_home"
name: jenkins-home
subPath: jenkins_home
livenessProbe:
httpGet:
path: /login
port: 8080
initialDelaySeconds: 60
periodSeconds: 30
readinessProbe:
httpGet:
path: /login
port: 8080
initialDelaySeconds: 30
periodSeconds: 15
volumes:
- name: jenkins-home
persistentVolumeClaim:
claimName: jenkins-home
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: jenkins-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: jenkins-standalone-statefulset
minReplicas: 2
maxReplicas: 3
targetCPUUtilizationPercentage: 80