diff --git a/charts/redis-cluster/Chart.yaml b/charts/redis-cluster/Chart.yaml index c6c920c5..c49e1704 100644 --- a/charts/redis-cluster/Chart.yaml +++ b/charts/redis-cluster/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: redis-cluster description: Provides easy redis setup definitions for Kubernetes services, and deployment. -version: 0.15.8 +version: 0.15.9 appVersion: "0.15.1" home: https://github.com/ot-container-kit/redis-operator sources: diff --git a/charts/redis-cluster/templates/redis-cluster.yaml b/charts/redis-cluster/templates/redis-cluster.yaml index ccbfb12e..c2ef8531 100644 --- a/charts/redis-cluster/templates/redis-cluster.yaml +++ b/charts/redis-cluster/templates/redis-cluster.yaml @@ -30,6 +30,9 @@ spec: {{- if .Values.redisExporter.resources}} resources: {{ toYaml .Values.redisExporter.resources | nindent 6 }} {{- end }} + {{- if .Values.redisExporter.env }} + env: {{ toYaml .Values.redisExporter.env | nindent 6 }} + {{- end }} kubernetesConfig: image: "{{ .Values.redisCluster.image }}:{{ .Values.redisCluster.tag }}" @@ -37,7 +40,7 @@ spec: {{- if .Values.redisCluster.imagePullSecrets}} imagePullSecrets: {{ toYaml .Values.redisCluster.imagePullSecrets | nindent 4 }} {{- end }} - {{- if .Values.redisExporter.resources}} + {{- if .Values.redisCluster.resources}} resources: {{ toYaml .Values.redisCluster.resources | nindent 6 }} {{- end }} {{- if and .Values.redisCluster.redisSecret.secretName .Values.redisCluster.redisSecret.secretKey }} diff --git a/charts/redis-cluster/values.yaml b/charts/redis-cluster/values.yaml index b268ceb3..b5ed2c56 100644 --- a/charts/redis-cluster/values.yaml +++ b/charts/redis-cluster/values.yaml @@ -105,6 +105,9 @@ redisExporter: # limits: # cpu: 100m # memory: 128Mi + env: [] + # - name: VAR_NAME + # value: "value1" sidecars: name: "" diff --git a/charts/redis/Chart.yaml b/charts/redis/Chart.yaml index cc51975f..83dc07a5 100644 --- a/charts/redis/Chart.yaml +++ b/charts/redis/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: redis description: Provides easy redis setup definitions for Kubernetes services, and deployment. -version: 0.15.7 -appVersion: "0.15.0" +version: 0.15.8 +appVersion: "0.15.1" home: https://github.com/ot-container-kit/redis-operator sources: - https://github.com/ot-container-kit/redis-operator diff --git a/charts/redis/templates/_helpers.tpl b/charts/redis/templates/_helpers.tpl new file mode 100644 index 00000000..cfc58681 --- /dev/null +++ b/charts/redis/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* Define common labels */}} +{{- define "common.labels" -}} +app.kubernetes.io/name: {{ .Release.Name }} +helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/version: {{ .Chart.AppVersion }} +app.kubernetes.io/component: middleware +{{- if .Values.labels }} +{{- range $labelkey, $labelvalue := .Values.labels }} +{{ $labelkey}}: {{ $labelvalue }} +{{- end }} +{{- end }} +{{- end -}} + +{{/* Generate init container properties */}} +{{- define "initContainer.properties" -}} +{{- with .Values.initContainer }} +{{- if .enabled }} +image: {{ .image }} +{{- if .imagePullPolicy }} +imagePullPolicy: {{ .imagePullPolicy }} +{{- end }} +{{- if .resources }} +resources: + {{ toYaml .resources | nindent 2 }} +{{- end }} +{{- if .env }} +env: +{{ toYaml .env | nindent 2 }} +{{- end }} +{{- if .command }} +command: +{{ toYaml .command | nindent 2 }} +{{- end }} +{{- if .args }} +args: +{{ toYaml .args | nindent 2 }} +{{- end }} +{{- end }} +{{- end }} +{{- end -}} + +{{/* Generate sidecar properties */}} +{{- define "sidecar.properties" -}} +{{- with .Values.sidecars }} +name: {{ .name }} +image: {{ .image }} +{{- if .imagePullPolicy }} +imagePullPolicy: {{ .imagePullPolicy }} +{{- end }} +{{- if .resources }} +resources: + {{ toYaml .resources | nindent 2 }} +{{- end }} +{{- if .env }} +env: +{{ toYaml .env | nindent 2 }} +{{- end }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/charts/redis/templates/redis-standalone.yaml b/charts/redis/templates/redis-standalone.yaml index dbd7520f..18e31da4 100644 --- a/charts/redis/templates/redis-standalone.yaml +++ b/charts/redis/templates/redis-standalone.yaml @@ -1,83 +1,86 @@ --- -apiVersion: redis.redis.opstreelabs.in/v1beta1 +apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: Redis metadata: name: {{ .Release.Name }} - labels: - app.kubernetes.io/name: {{ .Release.Name }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.AppVersion }} - app.kubernetes.io/component: middleware -{{- if .Values.labels }} -{{- range $labelkey, $labelvalue := .Values.labels }} - {{ $labelkey}}: {{ $labelvalue }} -{{- end }} -{{- end }} + labels: {{- include "common.labels" . | nindent 4 }} spec: -{{- if eq .Values.externalConfig.enabled true }} - redisConfig: - additionalRedisConfig: {{ .Release.Name }}-ext-config -{{- end }} - redisExporter: - enabled: {{ .Values.redisExporter.enabled }} - image: "{{ .Values.redisExporter.image }}:{{ .Values.redisExporter.tag }}" - imagePullPolicy: "{{ .Values.redisExporter.imagePullPolicy }}" - resources: -{{ toYaml .Values.redisExporter.resources | indent 6 }} -{{- if .Values.redisExporter.env }} - env: -{{ toYaml .Values.redisExporter.env | indent 4 }} -{{- end }} kubernetesConfig: image: "{{ .Values.redisStandalone.image }}:{{ .Values.redisStandalone.tag }}" imagePullPolicy: "{{ .Values.redisStandalone.imagePullPolicy }}" - resources: -{{ toYaml .Values.redisStandalone.resources | indent 6 }} -{{- if .Values.redisStandalone.redisSecret }} + {{- if .Values.redisStandalone.imagePullSecrets }} + imagePullSecrets: {{ toYaml .Values.redisStandalone.imagePullSecrets | nindent 4 }} + {{- end }} + {{- if .Values.redisStandalone.resources}} + resources: {{ toYaml .Values.redisStandalone.resources | nindent 6 }} + {{- end }} + {{- if and .Values.redisStandalone.redisSecret.secretName .Values.redisStandalone.redisSecret.secretKey }} redisSecret: - name: "{{ .Values.redisStandalone.redisSecret.secretName }}" - key: "{{ .Values.redisStandalone.redisSecret.secretKey }}" -{{- end }} -{{- if .Values.imagePullSecrets }} - imagePullSecrets: -{{- range $imageSecrets := .Values.imagePullSecrets }} - - name: {{ $imageSecrets.name }} -{{- end }} -{{- end }} -{{- if .Values.storageSpec }} - storage: -{{ toYaml .Values.storageSpec | indent 4 }} -{{- end }} -{{- if .Values.priorityClassName }} - priorityClassName: "{{ .Values.priorityClassName }}" -{{- end }} -{{- if .Values.nodeSelector }} - nodeSelector: -{{ toYaml .Values.nodeSelector | indent 4 }} -{{- end }} -{{- if .Values.affinity }} - affinity: -{{ toYaml .Values.affinity | indent 4 }} -{{- end }} -{{- if .Values.podSecurityContext }} - podSecurityContext: -{{ toYaml .Values.podSecurityContext | indent 4 }} + name: "{{ .Values.redisStandalone.redisSecret.secretName | quote }}" + key: "{{ .Values.redisStandalone.redisSecret.secretKey | quote }}" + {{- end }} + {{- if .Values.redisStandalone.ignoreAnnotations}} + ignoreAnnotations: {{ toYaml .Values.redisStandalone.ignoreAnnotations | nindent 6 }} + {{- end }} -{{- end }} -{{- if .Values.tolerations }} - tolerations: -{{ toYaml .Values.tolerations | indent 4 }} -{{- end }} -{{- if .Values.TLS }} + redisExporter: + enabled: {{ .Values.redisExporter.enabled }} + image: "{{ .Values.redisExporter.image }}:{{ .Values.redisExporter.tag }}" + imagePullPolicy: "{{ .Values.redisExporter.imagePullPolicy }}" + {{- if .Values.redisExporter.resources}} + resources: {{ toYaml .Values.redisExporter.resources | nindent 6 }} + {{- end }} + {{- if .Values.redisExporter.env }} + env: {{ toYaml .Values.redisExporter.env | nindent 6 }} + {{- end }} + + {{- if .Values.externalConfig.enabled }} + redisConfig: + additionalRedisConfig: "{{ .Release.Name }}-ext-config" + {{- end }} + {{- if .Values.storageSpec }} + storage: {{ toYaml .Values.storageSpec | nindent 4 }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: {{ toYaml .Values.nodeSelector | nindent 4 }} + {{- end }} + {{- if .Values.podSecurityContext }} + podSecurityContext: {{ toYaml .Values.podSecurityContext | nindent 4 }} + {{- end }} + {{- if .Values.securityContext }} + securityContext: {{ toYaml .Values.securityContext | nindent 4 }} + {{- end }} + {{- if and .Values.priorityClassName (ne .Values.priorityClassName "") }} + priorityClassName: "{{ .Values.priorityClassName }}" + {{- end }} + {{- if .Values.affinity }} + affinity: {{ toYaml .Values.affinity | nindent 4 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: {{ toYaml .Values.tolerations | nindent 4 }} + {{- end }} + {{- if and .Values.TLS.ca .Values.TLS.cert .Values.TLS.key .Values.TLS.secret.secretName }} TLS: -{{ toYaml .Values.TLS | indent 4 }} -{{- end}} -{{- if .Values.sidecars }} - sidecars: -{{ toYaml .Values.sidecars | indent 4 }} -{{- end }} -{{- if .Values.serviceAccountName }} + ca: {{ .Values.TLS.ca | quote }} + cert: {{ .Values.TLS.cert | quote }} + key: {{ .Values.TLS.key | quote }} + secret: + secretName: {{ .Values.TLS.secret.secretName | quote }} + {{- end }} + {{- if and .Values.acl.secret (ne .Values.acl.secret.secretName "") }} + acl: + secret: + secretName: {{ .Values.acl.secret.secretName | quote }} + {{- end }} + {{- if and .Values.initContainers .Values.initContainer.enabled (ne .Values.initContainers.name "") (ne .Values.initContainers.image) }} + initContainers: {{ include "initContainer.properties" | nindent 4 }} + {{- end }} + {{- if and .Values.sidecars (ne .Values.sidecars.name "") (ne .Values.sidecars.image) }} + sidecars: {{ include "sidecar.properties" | nindent 4 }} + {{- end }} + {{- if and .Values.serviceAccountName (ne .Values.serviceAccountName "") }} serviceAccountName: "{{ .Values.serviceAccountName }}" -{{- end }} + {{- end }} + {{- if .Values.env }} + env: {{ toYaml .Values.env | nindent 4 }} + {{- end }} diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index 23174f09..17ce72e9 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -1,11 +1,13 @@ --- redisStandalone: image: quay.io/opstree/redis - tag: v7.0.5 + tag: v7.0.12 imagePullPolicy: IfNotPresent - # redisSecret: - # secretName: redis-secret - # secretKey: password + imagePullSecrets: [] + # - name: Secret with Registry credentials + redisSecret: + secretName: "" + secretKey: "" serviceType: ClusterIP resources: {} # requests: @@ -14,8 +16,10 @@ redisStandalone: # limits: # cpu: 100m # memory: 128Mi + ignoreAnnotations: [] + # - "redis.opstreelabs.in/ignore" -# labels: +labels: {} # foo: bar # test: echo @@ -51,39 +55,41 @@ redisExporter: # limits: # cpu: 100m # memory: 128Mi - # env: - # - name: REDIS_EXPORTER_INCL_SYSTEM_METRICS - # value: "true" - # - name: UI_PROPERTIES_FILE_NAME - # valueFrom: - # configMapKeyRef: - # name: game-demo - # key: ui_properties_file_name - # - name: SECRET_USERNAME - # valueFrom: - # secretKeyRef: - # name: mysecret - # key: username - -sidecars: [] - # - name: "sidecar1" - # image: "image:1.0" - # imagePullPolicy: Always - # resources: - # limits: - # cpu: 50m - # memory: 64Mi - # requests: - # cpu: 10m - # memory: 32M - # env: - # - name: VAR_NAME - # value: "value1" - -# priorityClassName: "-" - -# imagePullSecrets: -# - name: regcred + env: [] + # - name: VAR_NAME + # value: "value1" + +initContainer: + enabled: false + image: "" + imagePullPolicy: "IfNotPresent" + resources: {} + # requests: + # memory: "64Mi" + # cpu: "250m" + # limits: + # memory: "128Mi" + # cpu: "500m" + env: [] + command: [] + args: [] + +sidecars: + name: "" + image: "" + imagePullPolicy: "IfNotPresent" + resources: + limits: + cpu: "100m" + memory: "128Mi" + requests: + cpu: "50m" + memory: "64Mi" + env: [] + # - name: MY_ENV_VAR + # value: "my-env-var-value" + +priorityClassName: "" nodeSelector: {} # memory: medium @@ -102,6 +108,8 @@ podSecurityContext: runAsUser: 1000 fsGroup: 1000 +securityContext : {} + affinity: {} # nodeAffinity: # requiredDuringSchedulingIgnoredDuringExecution: @@ -112,11 +120,25 @@ affinity: {} # values: # - ssd -# serviceAccountName: redis-sa +tolerations: [] + # - key: "key" + # operator: "Equal" + # value: "value" + # effect: "NoSchedule" + +serviceAccountName : "" + +TLS: + ca: ca.key + cert: tls.crt + key: tls.key + secret: + secretName: "" + +acl : + secret : + secretName: "" -# TLS: -# ca: ca.key -# cert: tls.crt -# key: tls.key -# secret: -# secretName: redis-tls-cert +env : [] + # - name: VAR_NAME + # value: "value1" \ No newline at end of file