diff --git a/charts/redis/Chart.yaml b/charts/redis/Chart.yaml index 5b2fba98b642fd8fb6b48c9436dcb36a2bd00cbf..d9e091a353366980a4f179d2d8d54c21ba5b8de4 100644 --- a/charts/redis/Chart.yaml +++ b/charts/redis/Chart.yaml @@ -8,7 +8,7 @@ maintainers: - name: groundhog2k # This is the chart version -version: 0.2.0 +version: 0.2.1 # This is the version number of the application being deployed. appVersion: "6.0.9" diff --git a/charts/redis/README.md b/charts/redis/README.md index b0b2fbb4944c304caf947399a866df9bbb9a250e..ddc160c49383cd01776cb4e1f057f776fafbb414 100644 --- a/charts/redis/README.md +++ b/charts/redis/README.md @@ -1,6 +1,6 @@ # Redis -   +   A Helm chart for Redis on Kubernetes @@ -15,7 +15,7 @@ $ helm install my-release groundhog2k/redis This chart uses the original [Redis image from Docker Hub](https://hub.docker.com/_/redis/) to deploy a stateful Redis instance in a Kubernetes cluster. -It fully supports deployment of arm64v8 and amd64 multi-architecture docker image. Just set the `nodeSelector` value to `kubernetes.io/arch: "arm64"` (default is `"amd64"`) +It fully supports deployment of the multi-architecture docker image. ## Prerequisites @@ -57,11 +57,12 @@ $ helm uninstall my-release | livenessProbe | object | `see values.yaml` | Liveness probe configurationm | | readinessProbe | object | `see values.yaml` | Readiness probe configuration | | resources | object | `{}` | Resource limits and requests | -| nodeSelector."kubernetes.io/arch" | string | `"amd64"` | Deployment node selector | +| nodeSelector | object | `{}` | Deployment node selector | | podAnnotations | object | `{}` | Additional pod annotations | | podSecurityContext | object | `{}` | Pod security context | | securityContext | object | `see values.yaml` | Container security context | | env | object | `[]` | Additional container environmment variables | +| args | object | `[]` | Additional container command arguments | | serviceAccount.annotations | object | `{}` | Additional service account annotations | | serviceAccount.create | bool | `false` | Enable service account creation | | serviceAccount.name | string | `""` | Name of the service account | @@ -79,13 +80,13 @@ $ helm uninstall my-release | Key | Type | Default | Description | |-----|------|---------|-------------| | storage.accessModes[0] | string | `"ReadWriteOnce"` | Storage access mode | -| storage.persistentVolumeClaimName | string | `""` | PVC name when existing storage volume should be used | -| storage.requestedSize | string | `""` | Size for new PVC, when no existing PVC is used | -| storage.className | string | `""` | Storage class name | +| storage.persistentVolumeClaimName | string | `nil` | PVC name when existing storage volume should be used | +| storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used | +| storage.className | string | `nil` | Storage class name | ## Redis parameters | Key | Type | Default | Description | |-----|------|---------|-------------| | arguments | string | `nil` | Arguments for the container entrypoint process | -| redisConfig | string | `""` | Custom redis.conf | +| redisConfig | string | `nil` | Custom redis.conf | diff --git a/charts/redis/templates/customconfig.yaml b/charts/redis/templates/customconfig.yaml index e91f996910afcfc574445edb132e770b3f854b4b..6f053aeb8d6d7a64fca9c70c5d4d90eedc8cde8a 100644 --- a/charts/redis/templates/customconfig.yaml +++ b/charts/redis/templates/customconfig.yaml @@ -7,5 +7,5 @@ metadata: {{- include "redis.labels" . | nindent 4 }} data: redis.conf: | - {{ .Values.redisConfig | nindent 4 }} + {{- .Values.redisConfig | nindent 4 }} {{- end }} diff --git a/charts/redis/templates/service.yaml b/charts/redis/templates/service.yaml index 7659aca333c1725bd692acae36ab4d22abee252b..f22994cfc2bd4303e91983882ed9dd18575b8d37 100644 --- a/charts/redis/templates/service.yaml +++ b/charts/redis/templates/service.yaml @@ -5,11 +5,17 @@ metadata: labels: {{- include "redis.labels" . | nindent 4 }} spec: - clusterIP: None + type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: redis protocol: TCP name: redis + {{- if and (eq .Values.service.type "NodePort") (.Values.service.nodePort) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} + {{- if and (eq .Values.service.type "LoadBalancer") (.Values.service.clusterIP) }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} selector: {{- include "redis.selectorLabels" . | nindent 4 }} diff --git a/charts/redis/templates/statefulset.yaml b/charts/redis/templates/statefulset.yaml index 394b45ba9f655e31d46ee307ad07e72a48625371..a50d84df69b2e8141f2f671e99dec69ae8955b1c 100644 --- a/charts/redis/templates/statefulset.yaml +++ b/charts/redis/templates/statefulset.yaml @@ -24,12 +24,16 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "redis.serviceAccountName" . }} + {{- with .Values.podSecurityContext }} securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} + {{- with .Values.securityContext }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: @@ -66,11 +70,13 @@ spec: periodSeconds: {{ .periodSeconds }} {{- end }} {{- end }} + {{- with .Values.resources }} resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.arguments }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.args }} args: - {{- range .Values.arguments }} + {{- range .Values.args }} - {{ . }} {{- end }} {{- end }} diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index cb886d083dd6f5e5efb889a50f4d65472beb5fb5..dc796e57dd7f218e82505e9f596e474bd0988b7d 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -22,10 +22,8 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "" -## Default node type for the image -## use arm64 for the arm64v8/redis image -nodeSelector: - kubernetes.io/arch: amd64 +## Additional node selector +nodeSelector: {} ## Additional pod annotations podAnnotations: {} @@ -44,7 +42,12 @@ securityContext: ## Default redis service port (default Redis port 6379) service: + type: ClusterIP port: 6379 + ## The node port (only relevant for type NodePort) + nodePort: {} + ## The cluster ip address (only relevant for type LoadBalancer) + clusterIP: {} ## Resource limits and requests resources: {} @@ -81,7 +84,7 @@ readinessProbe: env: [] ## Arguments for the container entrypoint process -arguments: +args: [] # Custom redis.conf redisConfig: | @@ -89,13 +92,13 @@ redisConfig: | ## Storage parameters storage: ## Set persistentVolumenClaimName to reference an existing PVC - # persistentVolumeClaimName: <own-pvc-name> + persistentVolumeClaimName: {} ## Alternative set requestedSize to define a size for a dynmaically created PVC - # requestedSize: <volume-size> + requestedSize: {} ## the storage class name - # className: + className: {} ## Default access mode (ReadWriteOnce) accessModes: