octoprint.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: octoprint
  5. labels:
  6. run: octoprint
  7. spec:
  8. ports:
  9. - name: http
  10. port: 80
  11. targetPort: 80
  12. selector:
  13. run: octoprint
  14. type: LoadBalancer
  15. status:
  16. loadBalancer: {}
  17. ---
  18. apiVersion: v1
  19. kind: PersistentVolume
  20. metadata:
  21. name: octoprint
  22. spec:
  23. capacity:
  24. storage: 100Mi
  25. volumeMode: Filesystem
  26. accessModes:
  27. - ReadWriteOnce
  28. persistentVolumeReclaimPolicy: Retain # Keep 4eva
  29. storageClassName: default
  30. mountOptions:
  31. - hard
  32. - nfsvers=3
  33. nfs:
  34. path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/octoprint
  35. server: 10.42.42.10
  36. claimRef:
  37. name: octoprint
  38. namespace: default
  39. ---
  40. apiVersion: v1
  41. kind: PersistentVolumeClaim
  42. metadata:
  43. # labels:
  44. # run: octoprint
  45. name: octoprint
  46. spec:
  47. storageClassName: default
  48. # volumeName: octoprint
  49. accessModes:
  50. - ReadWriteOnce
  51. resources:
  52. requests:
  53. storage: 100Mi
  54. status: {}
  55. ---
  56. apiVersion: apps/v1
  57. kind: Deployment
  58. metadata:
  59. name: octoprint
  60. spec:
  61. replicas: 1
  62. selector:
  63. matchLabels:
  64. run: octoprint
  65. strategy:
  66. type: Recreate
  67. template:
  68. metadata:
  69. labels:
  70. run: octoprint
  71. spec:
  72. nodeSelector:
  73. octoprint: "true"
  74. containers:
  75. - image: octoprint/octoprint
  76. name: octoprint
  77. securityContext:
  78. privileged: true
  79. env:
  80. - name: OCTOPRINT_PORT
  81. value: "5000"
  82. ports:
  83. - containerPort: 80
  84. resources: {}
  85. volumeMounts:
  86. - mountPath: /octoprint
  87. name: octoprint
  88. - mountPath: /dev/ttyUSB0
  89. name: ttyusb
  90. restartPolicy: Always
  91. volumes:
  92. - name: octoprint
  93. persistentVolumeClaim:
  94. claimName: octoprint
  95. - name: ttyusb
  96. hostPath:
  97. path: /dev/ttyUSB0
  98. status: {}
  99. ---
  100. # Hosting
  101. apiVersion: networking.k8s.io/v1
  102. kind: Ingress
  103. metadata:
  104. name: octoprint-ingress
  105. annotations:
  106. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  107. ## No basic auth for octoprint
  108. ## type of authentication
  109. #nginx.ingress.kubernetes.io/auth-type: basic
  110. ## name of the secret that contains the user/password definitions
  111. #nginx.ingress.kubernetes.io/auth-secret: basic-auth
  112. ## message to display with an appropriate context why the authentication is required
  113. #nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Octoprint'
  114. spec:
  115. tls:
  116. - hosts:
  117. - octoprint.monkeybox.org
  118. secretName: octoprint-tls
  119. rules:
  120. - host: octoprint.monkeybox.org
  121. http:
  122. paths:
  123. - path: /
  124. pathType: Prefix
  125. backend:
  126. service:
  127. name: octoprint
  128. port:
  129. number: 80