deployment.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {{- if .Values.redis.enabled -}}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ template "podinfo.fullname" . }}-redis
  6. labels:
  7. app: {{ template "podinfo.fullname" . }}-redis
  8. spec:
  9. strategy:
  10. type: Recreate
  11. selector:
  12. matchLabels:
  13. app: {{ template "podinfo.fullname" . }}-redis
  14. template:
  15. metadata:
  16. labels:
  17. app: {{ template "podinfo.fullname" . }}-redis
  18. annotations:
  19. checksum/config: {{ include (print $.Template.BasePath "/redis/config.yaml") . | sha256sum | quote }}
  20. spec:
  21. {{- if .Values.serviceAccount.enabled }}
  22. serviceAccountName: {{ template "podinfo.serviceAccountName" . }}
  23. {{- end }}
  24. {{- if .Values.redis.imagePullSecrets }}
  25. imagePullSecrets: {{ toYaml .Values.redis.imagePullSecrets | nindent 8 }}
  26. {{- end }}
  27. containers:
  28. - name: redis
  29. image: "{{ .Values.redis.repository }}:{{ .Values.redis.tag }}"
  30. imagePullPolicy: IfNotPresent
  31. command:
  32. - redis-server
  33. - "/redis-master/redis.conf"
  34. ports:
  35. - name: redis
  36. containerPort: 6379
  37. protocol: TCP
  38. livenessProbe:
  39. tcpSocket:
  40. port: redis
  41. initialDelaySeconds: 5
  42. timeoutSeconds: 5
  43. readinessProbe:
  44. exec:
  45. command:
  46. - redis-cli
  47. - ping
  48. initialDelaySeconds: 5
  49. timeoutSeconds: 5
  50. resources:
  51. limits:
  52. cpu: 1000m
  53. memory: 128Mi
  54. requests:
  55. cpu: 100m
  56. memory: 32Mi
  57. volumeMounts:
  58. - mountPath: /var/lib/redis
  59. name: data
  60. - mountPath: /redis-master
  61. name: config
  62. volumes:
  63. - name: data
  64. emptyDir: {}
  65. - name: config
  66. configMap:
  67. name: {{ template "podinfo.fullname" . }}-redis
  68. items:
  69. - key: redis.conf
  70. path: redis.conf
  71. {{- end }}