jenkins.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. # prep:
  2. # Also run:
  3. # ansible microk8s --become -a 'chmod g+rw,o+rw /dev/vchiq'
  4. # ansible microk8s --become -a 'chmod g+rw,o+rw /dev/video*'
  5. # ansible microk8s --become -a 'chmod -R g+rw,o+rw /dev/dri'
  6. apiVersion: v1
  7. kind: Service
  8. metadata:
  9. name: jenkins
  10. labels:
  11. run: jenkins
  12. spec:
  13. ports:
  14. - name: http
  15. port: 8080
  16. targetPort: 8080
  17. # ports:
  18. # - name: slaveport # hopefully not needed with a single server?
  19. # port: 50000
  20. # targetPort: 50000
  21. selector:
  22. run: jenkins
  23. # type: LoadBalancer
  24. #status:
  25. # loadBalancer: {}
  26. ---
  27. apiVersion: v1
  28. kind: PersistentVolume
  29. metadata:
  30. name: jenkins-home
  31. spec:
  32. capacity:
  33. storage: 5Mi
  34. volumeMode: Filesystem
  35. accessModes:
  36. - ReadWriteMany
  37. persistentVolumeReclaimPolicy: Retain # Keep 4eva
  38. storageClassName: default
  39. mountOptions:
  40. - hard
  41. - nfsvers=3
  42. nfs:
  43. path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/jenkins-home
  44. server: 10.42.42.10
  45. claimRef:
  46. name: jenkins-home
  47. namespace: default
  48. ---
  49. apiVersion: v1
  50. kind: PersistentVolumeClaim
  51. metadata:
  52. name: jenkins-home
  53. annotations:
  54. nfs.io/storage-path: "jenkins-home"
  55. spec:
  56. storageClassName: default
  57. accessModes:
  58. - ReadWriteMany
  59. resources:
  60. requests:
  61. storage: 5Mi
  62. status: {}
  63. ---
  64. apiVersion: apps/v1
  65. kind: Deployment
  66. metadata:
  67. name: jenkins
  68. spec:
  69. replicas: 1
  70. selector:
  71. matchLabels:
  72. run: jenkins
  73. strategy:
  74. type: Recreate
  75. template:
  76. metadata:
  77. labels:
  78. run: jenkins
  79. spec:
  80. terminationGracePeriodSeconds: 30
  81. containers:
  82. - image: jenkins/jenkins:lts-jdk11
  83. imagePullPolicy: "Always"
  84. name: jenkins
  85. env:
  86. - name: TZ
  87. value: US/Michigan
  88. ports:
  89. - containerPort: 8080
  90. # - containerPort: 50000
  91. resources: {}
  92. volumeMounts:
  93. - mountPath: /var/jenkins_home
  94. name: jenkins-home
  95. restartPolicy: Always
  96. volumes:
  97. - name: jenkins-home
  98. persistentVolumeClaim:
  99. claimName: jenkins-home
  100. dnsPolicy: "None"
  101. dnsConfig:
  102. nameservers:
  103. - 10.42.42.239
  104. - 10.42.42.1
  105. searches:
  106. - default.svc.cluster.local
  107. - svc.cluster.local
  108. - cluster.local
  109. options:
  110. - name: ndots
  111. value: "2"
  112. - name: edns0
  113. - name: trust-ad
  114. status: {}
  115. ---
  116. # Hosting
  117. apiVersion: networking.k8s.io/v1
  118. kind: Ingress
  119. metadata:
  120. name: jenkins-ingress
  121. annotations:
  122. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  123. ## No basic auth for jenkins
  124. ## type of authentication
  125. #nginx.ingress.kubernetes.io/auth-type: basic
  126. ## name of the secret that contains the user/password definitions
  127. #nginx.ingress.kubernetes.io/auth-secret: basic-auth
  128. ## message to display with an appropriate context why the authentication is required
  129. #nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Octoprint'
  130. spec:
  131. tls:
  132. - hosts:
  133. - jenkins.monkeybox.org
  134. secretName: jenkins-tls
  135. rules:
  136. - host: jenkins.monkeybox.org
  137. http:
  138. paths:
  139. - path: /
  140. pathType: Prefix
  141. backend:
  142. service:
  143. name: jenkins
  144. port:
  145. number: 8080