go-ipfs.yaml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: go-ipfs-tcp
  5. labels:
  6. run: go-ipfs
  7. annotations:
  8. metallb.universe.tf/allow-shared-ip: "pihole"
  9. spec:
  10. ports:
  11. - name: swarm
  12. protocol: TCP
  13. port: 4001
  14. targetPort: 4001
  15. - name: api
  16. protocol: TCP
  17. port: 5001
  18. targetPort: 5001
  19. - name: http
  20. protocol: TCP
  21. port: 8080
  22. targetPort: 8080
  23. selector:
  24. run: go-ipfs
  25. type: LoadBalancer
  26. loadBalancerIP: 10.42.42.236
  27. externalTrafficPolicy: Local
  28. ---
  29. apiVersion: v1
  30. kind: Service
  31. metadata:
  32. name: go-ipfs-udp
  33. labels:
  34. run: go-ipfs
  35. annotations:
  36. metallb.universe.tf/allow-shared-ip: "pihole"
  37. spec:
  38. ports:
  39. - name: swarm
  40. protocol: UDP
  41. port: 4001
  42. targetPort: 4001
  43. selector:
  44. run: go-ipfs
  45. type: LoadBalancer
  46. loadBalancerIP: 10.42.42.236
  47. externalTrafficPolicy: Local
  48. ---
  49. apiVersion: v1
  50. kind: PersistentVolume
  51. metadata:
  52. name: go-ipfs-data
  53. spec:
  54. capacity:
  55. storage: 5Mi
  56. volumeMode: Filesystem
  57. accessModes:
  58. - ReadWriteOnce
  59. persistentVolumeReclaimPolicy: Retain # Keep 4eva
  60. storageClassName: default
  61. mountOptions:
  62. - hard
  63. - nfsvers=3
  64. nfs:
  65. path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/go-ipfs-data
  66. server: 10.42.42.10
  67. claimRef:
  68. name: go-ipfs-data
  69. namespace: default
  70. ---
  71. apiVersion: v1
  72. kind: PersistentVolumeClaim
  73. metadata:
  74. name: go-ipfs-data
  75. annotations:
  76. nfs.io/storage-path: "go-ipfs"
  77. spec:
  78. storageClassName: default
  79. accessModes:
  80. - ReadWriteOnce
  81. resources:
  82. requests:
  83. storage: 5Mi
  84. status: {}
  85. ---
  86. apiVersion: v1
  87. kind: PersistentVolume
  88. metadata:
  89. name: go-ipfs-staging
  90. spec:
  91. capacity:
  92. storage: 5Mi
  93. volumeMode: Filesystem
  94. accessModes:
  95. - ReadWriteOnce
  96. persistentVolumeReclaimPolicy: Retain # Keep 4eva
  97. storageClassName: default
  98. mountOptions:
  99. - hard
  100. - nfsvers=3
  101. nfs:
  102. path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/go-ipfs-staging
  103. server: 10.42.42.10
  104. claimRef:
  105. name: go-ipfs-staging
  106. namespace: default
  107. ---
  108. apiVersion: v1
  109. kind: PersistentVolumeClaim
  110. metadata:
  111. name: go-ipfs-staging
  112. annotations:
  113. nfs.io/storage-path: "go-ipfs"
  114. spec:
  115. storageClassName: default
  116. accessModes:
  117. - ReadWriteOnce
  118. resources:
  119. requests:
  120. storage: 5Mi
  121. status: {}
  122. ---
  123. apiVersion: apps/v1
  124. kind: Deployment
  125. metadata:
  126. name: go-ipfs
  127. spec:
  128. replicas: 1
  129. selector:
  130. matchLabels:
  131. run: go-ipfs
  132. strategy:
  133. type: Recreate
  134. template:
  135. metadata:
  136. labels:
  137. run: go-ipfs
  138. spec:
  139. containers:
  140. # - image: ipfs/go-ipfs:latest
  141. - image: yrzr/go-ipfs-arm64v8:latest
  142. name: go-ipfs
  143. ports:
  144. - containerPort: 4001
  145. protocol: TCP
  146. - containerPort: 4001
  147. protocol: UDP
  148. - containerPort: 5001
  149. protocol: TCP
  150. - containerPort: 8080
  151. protocol: TCP
  152. resources: {}
  153. volumeMounts:
  154. - mountPath: /data/ipfs
  155. name: go-ipfs-data
  156. - mountPath: /export
  157. name: go-ipfs-staging
  158. restartPolicy: Always
  159. # This didn't seem to do what I want/need
  160. # affinity:
  161. # podAntiAffinity:
  162. # requiredDuringSchedulingIgnoredDuringExecution: #<---- hard requirement not to schedule "nginx" pod if already one scheduled.
  163. # - topologyKey: kubernetes.io/hostname # <---- Anti affinity scope is host
  164. # labelSelector:
  165. # matchLabels:
  166. # app: go-ipfs
  167. # topologySpreadConstraints:
  168. # - maxSkew: 1
  169. # topologyKey: kubernetes.io/hostname
  170. # whenUnsatisfiable: DoNotSchedule
  171. # labelSelector:
  172. # matchLabels:
  173. # app: go-ipfs
  174. volumes:
  175. - name: go-ipfs-data
  176. persistentVolumeClaim:
  177. claimName: go-ipfs-data
  178. - name: go-ipfs-staging
  179. persistentVolumeClaim:
  180. claimName: go-ipfs-staging
  181. status: {}
  182. ---
  183. # Hosting
  184. apiVersion: networking.k8s.io/v1
  185. kind: Ingress
  186. metadata:
  187. name: go-ipfs-ingress
  188. annotations:
  189. cert-manager.io/cluster-issuer: "letsencrypt-prod"
  190. ## basic auth for go-ipfs
  191. # type of authentication
  192. #nginx.ingress.kubernetes.io/auth-type: basic
  193. # name of the secret that contains the user/password definitions
  194. #nginx.ingress.kubernetes.io/auth-secret: basic-auth
  195. # message to display with an appropriate context why the authentication is required
  196. #nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Go-IPFS'
  197. spec:
  198. tls:
  199. - hosts:
  200. - ipfs.monkeybox.org
  201. secretName: go-ipfs-tls
  202. rules:
  203. - host: ipfs.monkeybox.org
  204. http:
  205. paths:
  206. - path: /
  207. pathType: Prefix
  208. backend:
  209. service:
  210. name: go-ipfs
  211. port:
  212. number: 8080