proxmox-haproxy.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: proxmox-haproxy
  5. labels:
  6. run: proxmox-haproxy
  7. spec:
  8. ports:
  9. - name: http
  10. port: 8000
  11. targetPort: 8000
  12. selector:
  13. run: proxmox-haproxy
  14. # type: LoadBalancer
  15. #status:
  16. # loadBalancer: {}
  17. ---
  18. apiVersion: v1
  19. kind: PersistentVolume
  20. metadata:
  21. name: proxmox-haproxy-config
  22. spec:
  23. capacity:
  24. storage: 5Mi
  25. volumeMode: Filesystem
  26. accessModes:
  27. - ReadWriteMany
  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/proxmox-haproxy-config
  35. server: 10.42.42.10
  36. claimRef:
  37. name: proxmox-haproxy-config
  38. namespace: default
  39. ---
  40. apiVersion: v1
  41. kind: PersistentVolumeClaim
  42. metadata:
  43. name: proxmox-haproxy-config
  44. annotations:
  45. nfs.io/storage-path: "proxmox-haproxy-config"
  46. spec:
  47. storageClassName: default
  48. accessModes:
  49. - ReadWriteMany
  50. resources:
  51. requests:
  52. storage: 5Mi
  53. status: {}
  54. ---
  55. apiVersion: apps/v1
  56. kind: Deployment
  57. metadata:
  58. name: proxmox-haproxy
  59. spec:
  60. replicas: 2
  61. selector:
  62. matchLabels:
  63. run: proxmox-haproxy
  64. strategy:
  65. type: Recreate
  66. template:
  67. metadata:
  68. labels:
  69. run: proxmox-haproxy
  70. spec:
  71. terminationGracePeriodSeconds: 30
  72. containers:
  73. - image: haproxy:latest
  74. imagePullPolicy: "Always"
  75. name: proxmox-haproxy
  76. env:
  77. - name: TZ
  78. value: US/Michigan
  79. ports:
  80. - containerPort: 8000
  81. resources:
  82. limits:
  83. memory: "500Mi"
  84. cpu: "1000m"
  85. requests:
  86. memory: "64Mi"
  87. cpu: "125m"
  88. volumeMounts:
  89. - mountPath: /usr/local/etc/haproxy
  90. name: proxmox-haproxy-config
  91. restartPolicy: Always
  92. volumes:
  93. - name: proxmox-haproxy-config
  94. persistentVolumeClaim:
  95. claimName: proxmox-haproxy-config
  96. # dnsPolicy: "None"
  97. # dnsConfig:
  98. # nameservers:
  99. # - 10.42.42.239
  100. # - 10.42.42.1
  101. # searches:
  102. # - default.svc.cluster.local
  103. # - svc.cluster.local
  104. # - cluster.local
  105. # options:
  106. # - name: ndots
  107. # value: "2"
  108. # - name: edns0
  109. # - name: trust-ad
  110. status: {}
  111. ---
  112. # Hosting
  113. apiVersion: networking.k8s.io/v1
  114. kind: Ingress
  115. metadata:
  116. name: proxmox-haproxy-ingress
  117. annotations:
  118. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  119. ## No basic auth for proxmox-haproxy
  120. ## type of authentication
  121. #nginx.ingress.kubernetes.io/auth-type: basic
  122. ## name of the secret that contains the user/password definitions
  123. #nginx.ingress.kubernetes.io/auth-secret: basic-auth
  124. ## message to display with an appropriate context why the authentication is required
  125. #nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Proxmox'
  126. spec:
  127. tls:
  128. - hosts:
  129. - proxmox.monkeybox.org
  130. secretName: proxmox-haproxy-tls
  131. rules:
  132. - host: proxmox.monkeybox.org
  133. http:
  134. paths:
  135. - path: /
  136. pathType: Prefix
  137. backend:
  138. service:
  139. name: proxmox-haproxy
  140. port:
  141. number: 8000