|
@@ -0,0 +1,64 @@
|
|
|
|
|
+apiVersion: apps/v1
|
|
|
|
|
+kind: Deployment
|
|
|
|
|
+metadata:
|
|
|
|
|
+ name: jenkins
|
|
|
|
|
+ namespace: devops-tools
|
|
|
|
|
+spec:
|
|
|
|
|
+ replicas: 1
|
|
|
|
|
+ selector:
|
|
|
|
|
+ matchLabels:
|
|
|
|
|
+ app: jenkins-server
|
|
|
|
|
+ strategy:
|
|
|
|
|
+ type: Recreate
|
|
|
|
|
+ template:
|
|
|
|
|
+ metadata:
|
|
|
|
|
+ labels:
|
|
|
|
|
+ app: jenkins-server
|
|
|
|
|
+ spec:
|
|
|
|
|
+ securityContext:
|
|
|
|
|
+ # Note: fsGroup may be customized for a bit of better
|
|
|
|
|
+ # filesystem security on the shared host
|
|
|
|
|
+ fsGroup: 1000
|
|
|
|
|
+ runAsUser: 1000
|
|
|
|
|
+ ### runAsGroup: 1000
|
|
|
|
|
+ serviceAccountName: jenkins-admin
|
|
|
|
|
+ containers:
|
|
|
|
|
+ - name: jenkins
|
|
|
|
|
+ image: jenkins/jenkins:lts
|
|
|
|
|
+ # OPTIONAL: check for new floating-tag LTS releases whenever the pod is restarted:
|
|
|
|
|
+ imagePullPolicy: Always
|
|
|
|
|
+ resources:
|
|
|
|
|
+ limits:
|
|
|
|
|
+ memory: "2Gi"
|
|
|
|
|
+ cpu: "1000m"
|
|
|
|
|
+ requests:
|
|
|
|
|
+ memory: "500Mi"
|
|
|
|
|
+ cpu: "500m"
|
|
|
|
|
+ ports:
|
|
|
|
|
+ - name: httpport
|
|
|
|
|
+ containerPort: 8080
|
|
|
|
|
+ - name: jnlpport
|
|
|
|
|
+ containerPort: 50000
|
|
|
|
|
+ livenessProbe:
|
|
|
|
|
+ httpGet:
|
|
|
|
|
+ path: "/login"
|
|
|
|
|
+ port: 8080
|
|
|
|
|
+ initialDelaySeconds: 90
|
|
|
|
|
+ periodSeconds: 10
|
|
|
|
|
+ timeoutSeconds: 5
|
|
|
|
|
+ failureThreshold: 5
|
|
|
|
|
+ readinessProbe:
|
|
|
|
|
+ httpGet:
|
|
|
|
|
+ path: "/login"
|
|
|
|
|
+ port: 8080
|
|
|
|
|
+ initialDelaySeconds: 60
|
|
|
|
|
+ periodSeconds: 10
|
|
|
|
|
+ timeoutSeconds: 5
|
|
|
|
|
+ failureThreshold: 3
|
|
|
|
|
+ volumeMounts:
|
|
|
|
|
+ - name: jenkins-data
|
|
|
|
|
+ mountPath: /var/jenkins_home
|
|
|
|
|
+ volumes:
|
|
|
|
|
+ - name: jenkins-data
|
|
|
|
|
+ persistentVolumeClaim:
|
|
|
|
|
+ claimName: jenkins-pv-claim
|