index.yaml 2.3 KB

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