default-site.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: default-site
  5. labels:
  6. run: default-site
  7. spec:
  8. ports:
  9. - name: http
  10. port: 80
  11. targetPort: 80
  12. selector:
  13. run: default-site
  14. type: LoadBalancer
  15. # Uncomment the following if you wnat to expose an IP
  16. #status:
  17. # loadBalancer: {}
  18. ---
  19. apiVersion: v1
  20. kind: PersistentVolumeClaim
  21. metadata:
  22. name: default-site
  23. annotations:
  24. nfs.io/storage-path: "default-site"
  25. spec:
  26. storageClassName: managed-nfs-storage
  27. accessModes:
  28. - ReadOnlyMany
  29. resources:
  30. requests:
  31. storage: 5Mi
  32. status: {}
  33. ---
  34. apiVersion: apps/v1
  35. kind: Deployment
  36. metadata:
  37. name: default-site
  38. spec:
  39. replicas: 2
  40. selector:
  41. matchLabels:
  42. run: default-site
  43. strategy:
  44. type: Recreate
  45. template:
  46. metadata:
  47. labels:
  48. run: default-site
  49. spec:
  50. containers:
  51. - image: nginx
  52. name: default-site
  53. ports:
  54. - containerPort: 80
  55. resources: {}
  56. volumeMounts:
  57. - mountPath: /usr/share/nginx/html
  58. name: default-site
  59. restartPolicy: Always
  60. volumes:
  61. - name: default-site
  62. persistentVolumeClaim:
  63. claimName: default-site
  64. status: {}
  65. ---
  66. # Hosting
  67. apiVersion: networking.k8s.io/v1
  68. kind: Ingress
  69. metadata:
  70. name: default-site-ingress
  71. annotations:
  72. cert-manager.io/cluster-issuer: "letsencrypt-wildcard-prod"
  73. ### basic auth for default
  74. ## type of authentication
  75. #nginx.ingress.kubernetes.io/auth-type: basic
  76. ## name of the secret that contains the user/password definitions
  77. #nginx.ingress.kubernetes.io/auth-secret: basic-auth
  78. ## message to display with an appropriate context why the authentication is required
  79. #nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Octoprint'
  80. spec:
  81. tls:
  82. - hosts:
  83. - "*.monkeybox.org"
  84. secretName: default-site-tls
  85. rules:
  86. - host: "*.monkeybox.org"
  87. http:
  88. paths:
  89. - path: /
  90. pathType: Prefix
  91. backend:
  92. service:
  93. name: default
  94. port:
  95. number: 80