redis.yaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: redis-tcp
  5. labels:
  6. run: redis
  7. annotations:
  8. metallb.universe.tf/allow-shared-ip: "redis"
  9. spec:
  10. ports:
  11. - name: redis
  12. protocol: TCP
  13. port: 6379
  14. targetPort: 6379
  15. selector:
  16. run: redis
  17. type: LoadBalancer
  18. loadBalancerIP: 10.42.42.237
  19. externalTrafficPolicy: Local
  20. ---
  21. apiVersion: v1
  22. kind: PersistentVolume
  23. metadata:
  24. name: redis
  25. spec:
  26. capacity:
  27. storage: 5Mi
  28. volumeMode: Filesystem
  29. accessModes:
  30. - ReadWriteMany
  31. persistentVolumeReclaimPolicy: Retain # Keep 4eva
  32. storageClassName: default
  33. mountOptions:
  34. - hard
  35. - nfsvers=3
  36. nfs:
  37. path: /mnt/DroboFS/Shares/Kubernetes/volumes/static/redis
  38. server: 10.42.42.10
  39. claimRef:
  40. name: redis
  41. namespace: default
  42. ---
  43. apiVersion: v1
  44. kind: PersistentVolumeClaim
  45. metadata:
  46. name: redis
  47. annotations:
  48. nfs.io/storage-path: "redis"
  49. spec:
  50. storageClassName: default
  51. accessModes:
  52. - ReadWriteMany
  53. resources:
  54. requests:
  55. storage: 5Mi
  56. status: {}
  57. ---
  58. apiVersion: apps/v1
  59. kind: Deployment
  60. metadata:
  61. name: redis
  62. spec:
  63. replicas: 1
  64. selector:
  65. matchLabels:
  66. run: redis
  67. strategy:
  68. type: Recreate
  69. template:
  70. metadata:
  71. labels:
  72. run: redis
  73. spec:
  74. terminationGracePeriodSeconds: 30
  75. containers:
  76. # - image: arm64v8/redis # official, but no json
  77. - image: redisfab/rejson:master-arm64v8-bionic
  78. imagePullPolicy: "Always"
  79. name: redis
  80. env:
  81. - name: TZ
  82. value: US/Michigan
  83. ports:
  84. - containerPort: 6379
  85. protocol: TCP
  86. resources: {}
  87. volumeMounts:
  88. - mountPath: /data/
  89. name: redis
  90. restartPolicy: Always
  91. volumes:
  92. - name: redis
  93. persistentVolumeClaim:
  94. claimName: redis
  95. status: {}
  96. #---
  97. ## Hosting
  98. #apiVersion: networking.k8s.io/v1
  99. #kind: Ingress
  100. #metadata:
  101. # name: redis-management
  102. # annotations:
  103. # #nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
  104. # #nginx.ingress.kubernetes.io/proxy-ssl-verify: "off"
  105. # cert-manager.io/cluster-issuer: "letsencrypt-stage"
  106. #spec:
  107. # tls:
  108. # - hosts:
  109. # - redis.monkeybox.org
  110. # secretName: redis-tls
  111. # rules:
  112. # - host: redis.monkeybox.org
  113. # http:
  114. # paths:
  115. # - path: /
  116. # pathType: Prefix
  117. # backend:
  118. # service:
  119. # name: redis-tcp
  120. # port:
  121. # number: 6379