[stable/redis] Add possibility to inject a custom configuration file (#7460)

Signed-off-by: Juan Ariza <juan@bitnami.com>
This commit is contained in:
Juan Ariza Toledano
2018-08-31 03:37:26 -07:00
committed by k8s-ci-robot
parent 019e394567
commit 85e6fb22d0
7 changed files with 239 additions and 113 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: redis
version: 3.7.7
version: 3.8.0
appVersion: 4.0.11
description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
keywords:
+1
View File
@@ -61,6 +61,7 @@ The following table lists the configurable parameters of the Redis chart and the
| `existingSecret` | Name of existing secret object (for password authentication) | `nil` |
| `usePassword` | Use password | `true` |
| `password` | Redis password (ignored if existingSecret set) | Randomly generated |
| `configmap` | Redis configuration file to be used | `nil` |
| `networkPolicy.enabled` | Enable NetworkPolicy | `false` |
| `networkPolicy.allowExternal` | Don't require client label for connections | `true` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `false` |
+14
View File
@@ -0,0 +1,14 @@
{{- if .Values.configmap }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "redis.name" . }}
chart: {{ template "redis.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "redis.fullname" . }}
data:
redis.conf: |-
{{ toYaml .Values.configmap | indent 4 }}
{{- end }}
@@ -123,17 +123,28 @@ spec:
- name: redis-data
mountPath: {{ .Values.master.persistence.path }}
subPath: {{ .Values.master.persistence.subPath }}
{{- if not .Values.master.persistence.enabled }}
{{- if .Values.configmap }}
- name: config
mountPath: /opt/bitnami/redis/etc/redis.conf
subPath: redis.conf
{{- end }}
volumes:
{{- if .Values.configmap }}
- name: config
configMap:
name: {{ template "redis.fullname" . }}
{{- end }}
{{- if not .Values.master.persistence.enabled }}
- name: "redis-data"
emptyDir: {}
{{- else }}
{{- if .Values.persistence.existingClaim }}
volumes:
{{- else }}
{{- if .Values.persistence.existingClaim }}
- name: "redis-data"
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim }}
{{- else }}
{{- end }}
{{- end }}
{{- if and .Values.master.persistence.enabled (not .Values.persistence.existingClaim) }}
volumeClaimTemplates:
- metadata:
name: redis-data
@@ -158,7 +169,6 @@ spec:
storageClassName: {{ .Values.master.persistence.storageClass | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
updateStrategy:
type: {{ .Values.master.statefulset.updateStrategy }}
@@ -106,4 +106,14 @@ spec:
{{ include "redis.slave.readinessProbe" . | indent 8 }}
resources:
{{ toYaml (.Values.slave.resources | default .Values.master.resources) | indent 10 }}
{{- if .Values.configmap }}
volumeMounts:
- name: config
mountPath: /opt/bitnami/redis/etc/redis.conf
subPath: redis.conf
volumes:
- name: config
configMap:
name: {{ template "redis.fullname" . }}
{{- end }}
{{- end }}
+111 -46
View File
@@ -4,7 +4,14 @@
image:
registry: docker.io
repository: bitnami/redis
## Bitnami Redis image tag
## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links
##
tag: 4.0.11-debian-9
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
@@ -13,41 +20,13 @@ image:
# pullSecrets:
# - myRegistrKeySecretName
## Cluster settings
cluster:
enabled: true
slaveCount: 3
metrics:
enabled: true
# resources: {}
# podAnnotations: {}
service:
type: ClusterIP
annotations: {}
# prometheus.io/scrape: "true"
# prometheus.io/port: "9121"
loadBalancerIP:
image:
registry: docker.io
repository: oliver006/redis_exporter
tag: v0.20.2
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
## Metrics exporter labels and tolerations for pod assignment
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
## Metrics exporter pod Annotation and Labels
# podLabels: {}
networkPolicy:
## Enable creation of NetworkPolicy resources.
## Specifies whether a NetworkPolicy should be created
##
enabled: true
@@ -58,11 +37,38 @@ networkPolicy:
##
# allowExternal: true
serviceAccount:
## Specifies whether a ServiceAccount should be created
##
create: false
## The name of the ServiceAccount to use.
## If not set and create is true, a name is generated using the fullname template
name:
rbac:
## Specifies whether RBAC resources should be created
##
create: false
role:
## Rules to create. It follows the role specification
# rules:
# - apiGroups:
# - extensions
# resources:
# - podsecuritypolicies
# verbs:
# - use
# resourceNames:
# - gce.unprivileged
rules: []
## Use password authentication
usePassword: true
## Redis password (both master and slave)
## Defaults to a random 10-character alphanumeric string if not set and usePassword is true
## ref: https://github.com/bitnami/bitnami-docker-redis#setting-the-server-password-on-first-run
##
usePassword: true
password:
## Use existing secret (ignores previous password)
# existingSecret:
@@ -71,7 +77,7 @@ password:
## Redis Master parameters
##
master:
## Use password authentication
## Redis port
port: 6379
## Redis command arguments
##
@@ -95,12 +101,12 @@ master:
## ref: https://github.com/bitnami/bitnami-docker-redis#disabling-redis-commands
##
disableCommands: "FLUSHDB,FLUSHALL"
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
## Redis Master additional pod labels
## Redis Master additional pod labels and annotations
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podLabels: {}
podAnnotations: {}
## Redis Master resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
# resources:
@@ -108,7 +114,9 @@ master:
# memory: 256Mi
# cpu: 100m
## Redis Master Liveness Probe
## Configure extra options for Redis Master liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
livenessProbe:
enabled: true
initialDelaySeconds: 30
@@ -116,8 +124,6 @@ master:
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
## Redis Master Readiness Probe
readinessProbe:
enabled: true
initialDelaySeconds: 5
@@ -125,13 +131,17 @@ master:
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 5
## Redis Master Node labels and tolerations for pod assignment
## Redis Master Node selectors and tolerations for pod assignment
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature
##
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
## Redis Master pod annotations
podAnnotations: {}
## Redis Master pod/node affinity/anti-affinity
##
affinity: {}
## Redis Master Service properties
service:
## Redis Master Service type
@@ -148,11 +158,16 @@ master:
##
annotations: {}
loadBalancerIP:
## Redis Master Pod Security Context
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
enabled: true
@@ -216,9 +231,13 @@ slave:
## Comma-separated list of Redis commands to disable
# disableCommands: ""
## Redis Slave pod/node affinity/anti-affinity
##
affinity: {}
## Redis slave Liveness Probe
## Configure extra options for Redis Slave liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
# livenessProbe:
# enabled: true
# initialDelaySeconds: 30
@@ -226,8 +245,6 @@ slave:
# timeoutSeconds: 5
# successThreshold: 1
# failureThreshold: 5
## Redis slave Readiness Probe
# readinessProbe:
# enabled: true
# initialDelaySeconds: 5
@@ -242,13 +259,12 @@ slave:
# memory: 256Mi
# cpu: 100m
## Redis slave labels and tolerations for pod assignment
## Redis slave selectors and tolerations for pod assignment
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
## Redis slave pod Annotation and Labels
# podLabels: {}
## annotations for redis pods
# podAnnotations: {}
## Redis slave pod Security Context
@@ -256,3 +272,52 @@ slave:
# enabled: true
# fsGroup: 1001
# runAsUser: 1001
## Prometheus Exporter / Metrics
##
metrics:
enabled: true
image:
registry: docker.io
repository: oliver006/redis_exporter
tag: v0.20.2
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
service:
type: ClusterIP
## Use serviceLoadBalancerIP to request a specific static IP,
## otherwise leave blank
# loadBalancerIP:
annotations: {}
# prometheus.io/scrape: "true"
# prometheus.io/port: "9121"
## Metrics exporter resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
# resources: {}
## Extra arguments for Metrics exporter, for example:
## extraArgs:
## check-keys: myKey,myOtherKey
# extraArgs: {}
## Metrics exporter labels and tolerations for pod assignment
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
## Metrics exporter pod Annotation and Labels
# podAnnotations: {}
# podLabels: {}
## Redis config file
##
configmap: |-
# Redis configuration file
+86 -60
View File
@@ -4,6 +4,9 @@
image:
registry: docker.io
repository: bitnami/redis
## Bitnami Redis image tag
## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links
##
tag: 4.0.11-debian-9
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
@@ -17,48 +20,13 @@ image:
# pullSecrets:
# - myRegistrKeySecretName
## Cluster settings
cluster:
enabled: true
slaveCount: 1
metrics:
enabled: false
# resources: {}
# podAnnotations: {}
service:
type: ClusterIP
annotations: {}
# prometheus.io/scrape: "true"
# prometheus.io/port: "9121"
loadBalancerIP:
image:
registry: docker.io
repository: oliver006/redis_exporter
tag: v0.20.2
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
## Extra arguments for Redis exporter, for example:
## extraArgs:
## check-keys: myKey,myOtherKey
# extraArgs: {}
## Metrics exporter labels and tolerations for pod assignment
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
## Metrics exporter pod Annotation and Labels
# podLabels: {}
networkPolicy:
## Enable creation of NetworkPolicy resources.
## Specifies whether a NetworkPolicy should be created
##
enabled: false
@@ -70,14 +38,16 @@ networkPolicy:
# allowExternal: true
serviceAccount:
# Specifies whether a ServiceAccount should be created
## Specifies whether a ServiceAccount should be created
##
create: false
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:
rbac:
# Specifies whether RBAC resources should be created
## Specifies whether RBAC resources should be created
##
create: false
role:
@@ -93,11 +63,12 @@ rbac:
# - gce.unprivileged
rules: []
## Use password authentication
usePassword: true
## Redis password (both master and slave)
## Defaults to a random 10-character alphanumeric string if not set and usePassword is true
## ref: https://github.com/bitnami/bitnami-docker-redis#setting-the-server-password-on-first-run
##
usePassword: true
password:
## Use existing secret (ignores previous password)
# existingSecret:
@@ -113,7 +84,7 @@ persistence: {}
## Redis Master parameters
##
master:
## Use password authentication
## Redis port
port: 6379
## Redis command arguments
##
@@ -137,12 +108,12 @@ master:
## ref: https://github.com/bitnami/bitnami-docker-redis#disabling-redis-commands
##
disableCommands: "FLUSHDB,FLUSHALL"
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
## Redis Master additional pod labels
## Redis Master additional pod labels and annotations
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podLabels: {}
podAnnotations: {}
## Redis Master resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
# resources:
@@ -154,8 +125,9 @@ master:
##
# schedulerName:
## Redis Master Liveness Probe
## Configure extra options for Redis Master liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
livenessProbe:
enabled: true
initialDelaySeconds: 30
@@ -163,8 +135,6 @@ master:
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
## Redis Master Readiness Probe
readinessProbe:
enabled: true
initialDelaySeconds: 5
@@ -172,15 +142,17 @@ master:
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 5
## Redis Master Node labels and tolerations for pod assignment
## Redis Master Node selectors and tolerations for pod assignment
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature
##
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
## Redis Master pod/node affinity/anti-affinity
##
affinity: {}
## Redis Master pod annotations
podAnnotations: {}
## Redis Master Service properties
service:
## Redis Master Service type
@@ -197,21 +169,25 @@ master:
##
annotations: {}
loadBalancerIP:
## Redis Master Pod Security Context
##
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
enabled: true
## The path the volume will be mounted at, useful when using different
## Redis images.
path: /bitnami/redis/data
## The subdirectory of the volume to mount to, useful in dev environments and one PV for multiple services.
## The subdirectory of the volume to mount to, useful in dev environments
## and one PV for multiple services.
subPath: ""
## redis data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
@@ -264,9 +240,13 @@ slave:
## Comma-separated list of Redis commands to disable
# disableCommands: ""
## Redis Slave pod/node affinity/anti-affinity
##
affinity: {}
## Redis slave Liveness Probe
## Configure extra options for Redis Slave liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
# livenessProbe:
# enabled: true
# initialDelaySeconds: 30
@@ -274,8 +254,6 @@ slave:
# timeoutSeconds: 5
# successThreshold: 1
# failureThreshold: 5
## Redis slave Readiness Probe
# readinessProbe:
# enabled: true
# initialDelaySeconds: 5
@@ -290,7 +268,7 @@ slave:
# memory: 256Mi
# cpu: 100m
## Redis slave labels and tolerations for pod assignment
## Redis slave selectors and tolerations for pod assignment
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
@@ -301,7 +279,6 @@ slave:
## Redis slave pod Annotation and Labels
# podLabels: {}
## annotations for redis pods
# podAnnotations: {}
## Redis slave pod Security Context
@@ -309,3 +286,52 @@ slave:
# enabled: true
# fsGroup: 1001
# runAsUser: 1001
## Prometheus Exporter / Metrics
##
metrics:
enabled: false
image:
registry: docker.io
repository: oliver006/redis_exporter
tag: v0.20.2
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
service:
type: ClusterIP
## Use serviceLoadBalancerIP to request a specific static IP,
## otherwise leave blank
# loadBalancerIP:
annotations: {}
# prometheus.io/scrape: "true"
# prometheus.io/port: "9121"
## Metrics exporter resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
# resources: {}
## Extra arguments for Metrics exporter, for example:
## extraArgs:
## check-keys: myKey,myOtherKey
# extraArgs: {}
## Metrics exporter labels and tolerations for pod assignment
# nodeSelector: {"beta.kubernetes.io/arch": "amd64"}
# tolerations: []
## Metrics exporter pod Annotation and Labels
# podAnnotations: {}
# podLabels: {}
## Redis config file
##
configmap: |-
# Redis configuration file