jenkins-03-deployment.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: jenkins
  5. namespace: devops-tools
  6. spec:
  7. replicas: 1
  8. selector:
  9. matchLabels:
  10. app: jenkins-server
  11. strategy:
  12. type: Recreate
  13. template:
  14. metadata:
  15. labels:
  16. app: jenkins-server
  17. spec:
  18. securityContext:
  19. # Note: fsGroup may be customized for a bit of better
  20. # filesystem security on the shared host
  21. fsGroup: 1000
  22. runAsUser: 1000
  23. ### runAsGroup: 1000
  24. serviceAccountName: jenkins-admin
  25. containers:
  26. - name: jenkins
  27. image: jenkins/jenkins:lts
  28. # OPTIONAL: check for new floating-tag LTS releases whenever the pod is restarted:
  29. imagePullPolicy: Always
  30. resources:
  31. limits:
  32. memory: "2Gi"
  33. cpu: "1000m"
  34. requests:
  35. memory: "500Mi"
  36. cpu: "500m"
  37. ports:
  38. - name: httpport
  39. containerPort: 8080
  40. - name: jnlpport
  41. containerPort: 50000
  42. livenessProbe:
  43. httpGet:
  44. path: "/login"
  45. port: 8080
  46. initialDelaySeconds: 90
  47. periodSeconds: 10
  48. timeoutSeconds: 5
  49. failureThreshold: 5
  50. readinessProbe:
  51. httpGet:
  52. path: "/login"
  53. port: 8080
  54. initialDelaySeconds: 60
  55. periodSeconds: 10
  56. timeoutSeconds: 5
  57. failureThreshold: 3
  58. volumeMounts:
  59. - name: jenkins-data
  60. mountPath: /var/jenkins_home
  61. volumes:
  62. - name: jenkins-data
  63. persistentVolumeClaim:
  64. claimName: jenkins-pv-claim