github.com/argoproj/argo-cd@v1.8.7/util/helm/testdata/redis/README.md (about) 1 # Redis 2 3 [Redis](https://redis.io/) is an advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs. 4 5 ## TL;DR 6 7 ```bash 8 # Testing configuration 9 $ helm install stable/redis 10 ``` 11 12 ```bash 13 # Production configuration 14 $ helm install stable/redis --values values-production.yaml 15 ``` 16 17 ## Introduction 18 19 This chart bootstraps a [Redis](https://github.com/bitnami/bitnami-docker-redis) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. 20 21 ## Prerequisites 22 23 - Kubernetes 1.8+ 24 - PV provisioner support in the underlying infrastructure 25 26 ## Installing the Chart 27 28 To install the chart with the release name `my-release`: 29 30 ```bash 31 $ helm install --name my-release stable/redis 32 ``` 33 34 The command deploys Redis on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. 35 36 > **Tip**: List all releases using `helm list` 37 38 ## Uninstalling the Chart 39 40 To uninstall/delete the `my-release` deployment: 41 42 ```bash 43 $ helm delete my-release 44 ``` 45 46 The command removes all the Kubernetes components associated with the chart and deletes the release. 47 48 ## Configuration 49 50 The following table lists the configurable parameters of the Redis chart and their default values. 51 52 | Parameter | Description | Default | 53 |--------------------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------------| 54 | `image.registry` | Redis Image registry | `docker.io` | 55 | `image.repository` | Redis Image name | `bitnami/redis` | 56 | `image.tag` | Redis Image tag | `{VERSION}` | 57 | `image.pullPolicy` | Image pull policy | `Always` | 58 | `image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | 59 | `cluster.enabled` | Use master-slave topology | `true` | 60 | `cluster.slaveCount` | Number of slaves | 1 | 61 | `existingSecret` | Name of existing secret object (for password authentication) | `nil` | 62 | `usePassword` | Use password | `true` | 63 | `password` | Redis password (ignored if existingSecret set) | Randomly generated | 64 | `networkPolicy.enabled` | Enable NetworkPolicy | `false` | 65 | `networkPolicy.allowExternal` | Don't require client label for connections | `true` | 66 | `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `false` | 67 | `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the fullname template | 68 | `rbac.create` | Specifies whether RBAC resources should be created | `false` | 69 | `rbac.role.rules` | Rules to create | `[]` | 70 | `metrics.enabled` | Start a side-car prometheus exporter | `false` | 71 | `metrics.image.registry` | Redis exporter image registry | `docker.io` | 72 | `metrics.image.repository` | Redis exporter image name | `bitnami/redis` | 73 | `metrics.image.tag` | Redis exporter image tag | `v0.20.2` | 74 | `metrics.image.pullPolicy` | Image pull policy | `IfNotPresent` | 75 | `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `nil` | 76 | `metrics.podLabels` | Additional labels for Metrics exporter pod | {} | 77 | `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | {} | 78 | `master.service.type` | Kubernetes Service type (redis metrics) | `LoadBalancer` | 79 | `metrics.service.annotations` | Annotations for the services to monitor (redis master and redis slave service) | {} | 80 | `metrics.service.loadBalancerIP` | loadBalancerIP if redis metrics service type is `LoadBalancer` | `nil` | 81 | `metrics.resources` | Exporter resource requests/limit | Memory: `256Mi`, CPU: `100m` | 82 | `persistence.existingClaim` | Provide an existing PersistentVolumeClaim | `nil` | 83 | `master.persistence.enabled` | Use a PVC to persist data (master node) | `true` | 84 | `master.persistence.path` | Path to mount the volume at, to use other images | `/bitnami` | 85 | `master.persistence.subPath` | Subdirectory of the volume to mount at | `""` | 86 | `master.persistence.storageClass` | Storage class of backing PVC | `generic` | 87 | `master.persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | 88 | `master.persistence.size` | Size of data volume | `8Gi` | 89 | `master.statefulset.updateStrategy` | Update strategy for StatefulSet | onDelete | 90 | `master.statefulset.rollingUpdatePartition`| Partition update strategy | `nil` | 91 | `master.podLabels` | Additional labels for Redis master pod | {} | 92 | `master.podAnnotations` | Additional annotations for Redis master pod | {} | 93 | `master.port` | Redis master port | 6379 | 94 | `master.args` | Redis master command-line args | [] | 95 | `master.disableCommands` | Comma-separated list of Redis commands to disable (master) | `FLUSHDB,FLUSHALL` | 96 | `master.extraFlags` | Redis master additional command line flags | [] | 97 | `master.nodeSelector` | Redis master Node labels for pod assignment | {"beta.kubernetes.io/arch": "amd64"} | 98 | `master.tolerations` | Toleration labels for Redis master pod assignment | [] | 99 | `master.affinity ` | Affinity settings for Redis master pod assignment | [] | 100 | `master.schedulerName` | Name of an alternate scheduler | `nil` | 101 | `master.service.type` | Kubernetes Service type (redis master) | `ClusterIP` | 102 | `master.service.annotations` | annotations for redis master service | {} | 103 | `master.service.loadBalancerIP` | loadBalancerIP if redis master service type is `LoadBalancer` | `nil` | 104 | `master.securityContext.enabled` | Enable security context (redis master pod) | `true` | 105 | `master.securityContext.fsGroup` | Group ID for the container (redis master pod) | `1001` | 106 | `master.securityContext.runAsUser` | User ID for the container (redis master pod) | `1001` | 107 | `master.resources` | Redis master CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` | 108 | `master.livenessProbe.enabled` | Turn on and off liveness probe (redis master pod) | `true` | 109 | `master.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (redis master pod) | `30` | 110 | `master.livenessProbe.periodSeconds` | How often to perform the probe (redis master pod) | `30` | 111 | `master.livenessProbe.timeoutSeconds` | When the probe times out (redis master pod) | `5` | 112 | `master.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis master pod) | `1` | 113 | `master.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | 114 | `master.readinessProbe.enabled` | Turn on and off readiness probe (redis master pod) | `true` | 115 | `master.readinessProbe.initialDelaySeconds`| Delay before readiness probe is initiated (redis master pod) | `5` | 116 | `master.readinessProbe.periodSeconds` | How often to perform the probe (redis master pod) | `10` | 117 | `master.readinessProbe.timeoutSeconds` | When the probe times out (redis master pod) | `1` | 118 | `master.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis master pod) | `1` | 119 | `master.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | 120 | `slave.serviceType` | Kubernetes Service type (redis slave) | `LoadBalancer` | 121 | `slave.service.annotations` | annotations for redis slave service | {} | 122 | `slave.service.loadBalancerIP` | LoadBalancerIP if Redis slave service type is `LoadBalancer` | `nil` | 123 | `slave.port` | Redis slave port | `master.port` | 124 | `slave.args` | Redis slave command-line args | `master.args` | 125 | `slave.disableCommands` | Comma-separated list of Redis commands to disable (slave) | `master.disableCommands` | 126 | `slave.extraFlags` | Redis slave additional command line flags | `master.extraFlags` | 127 | `slave.livenessProbe.enabled` | Turn on and off liveness probe (redis slave pod) | `master.livenessProbe.enabled` | 128 | `slave.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated (redis slave pod) | `master.livenessProbe.initialDelaySeconds` | 129 | `slave.livenessProbe.periodSeconds` | How often to perform the probe (redis slave pod) | `master.livenessProbe.periodSeconds` | 130 | `slave.livenessProbe.timeoutSeconds` | When the probe times out (redis slave pod) | `master.livenessProbe.timeoutSeconds` | 131 | `slave.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis slave pod) | `master.livenessProbe.successThreshold` | 132 | `slave.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `master.livenessProbe.failureThreshold` | 133 | `slave.readinessProbe.enabled` | Turn on and off slave.readiness probe (redis slave pod) | `master.readinessProbe.enabled` | 134 | `slave.readinessProbe.initialDelaySeconds` | Delay before slave.readiness probe is initiated (redis slave pod) | `master.readinessProbe.initialDelaySeconds` | 135 | `slave.readinessProbe.periodSeconds` | How often to perform the probe (redis slave pod) | `master.readinessProbe.periodSeconds` | 136 | `slave.readinessProbe.timeoutSeconds` | When the probe times out (redis slave pod) | `master.readinessProbe.timeoutSeconds` | 137 | `slave.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed (redis slave pod) | `master.readinessProbe.successThreshold` | 138 | `slave.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. (redis slave pod) | `master.readinessProbe.failureThreshold` | 139 | `slave.podLabels` | Additional labels for Redis slave pod | `master.podLabels` | 140 | `slave.podAnnotations` | Additional annotations for Redis slave pod | `master.podAnnotations` | 141 | `slave.schedulerName` | Name of an alternate scheduler | `nil` | 142 | `slave.securityContext.enabled` | Enable security context (redis slave pod) | `master.securityContext.enabled` | 143 | `slave.securityContext.fsGroup` | Group ID for the container (redis slave pod) | `master.securityContext.fsGroup` | 144 | `slave.securityContext.runAsUser` | User ID for the container (redis slave pod) | `master.securityContext.runAsUser` | 145 | `slave.resources` | Redis slave CPU/Memory resource requests/limits | `master.resources` | 146 | `slave.affinity` | Enable node/pod affinity for slaves | {} | 147 148 The above parameters map to the env variables defined in [bitnami/redis](https://github.com/bitnami/bitnami-docker-redis). For more information please refer to the [bitnami/redis](https://github.com/bitnami/bitnami-docker-redis) image documentation. 149 150 Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, 151 152 ```bash 153 $ helm install --name my-release \ 154 --set password=secretpassword \ 155 stable/redis 156 ``` 157 158 The above command sets the Redis server password to `secretpassword`. 159 160 Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, 161 162 ```bash 163 $ helm install --name my-release -f values.yaml stable/redis 164 ``` 165 166 > **Tip**: You can use the default [values.yaml](values.yaml) 167 168 > **Note for minikube users**: Current versions of minikube (v0.24.1 at the time of writing) provision `hostPath` persistent volumes that are only writable by root. Using chart defaults cause pod failure for the Redis pod as it attempts to write to the `/bitnami` directory. Consider installing Redis with `--set persistence.enabled=false`. See minikube issue [1990](https://github.com/kubernetes/minikube/issues/1990) for more information. 169 170 ## NetworkPolicy 171 172 To enable network policy for Redis, install 173 [a networking plugin that implements the Kubernetes NetworkPolicy spec](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy#before-you-begin), 174 and set `networkPolicy.enabled` to `true`. 175 176 For Kubernetes v1.5 & v1.6, you must also turn on NetworkPolicy by setting 177 the DefaultDeny namespace annotation. Note: this will enforce policy for _all_ pods in the namespace: 178 179 kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}" 180 181 With NetworkPolicy enabled, only pods with the generated client label will be 182 able to connect to Redis. This label will be displayed in the output 183 after a successful install. 184 185 ## Persistence 186 187 The [Bitnami Redis](https://github.com/bitnami/bitnami-docker-redis) image stores the Redis data and configurations at the `/bitnami` path of the container. 188 189 By default, the chart mounts a [Persistent Volume](https://kubernetes.io/docs/user-guide/persistent-volumes/) at this location. The volume is created using dynamic volume provisioning. If a Persistent Volume Claim already exists, specify it during installation. 190 191 By default, the chart persists both data and configuration. If you wish to persist only the data directory set `persistence.path` to `/bitnami/redis/data` and `persistence.subPath` to `redis/data`. 192 193 ### Existing PersistentVolumeClaim 194 195 1. Create the PersistentVolume 196 1. Create the PersistentVolumeClaim 197 1. Install the chart 198 199 ```bash 200 $ helm install --set persistence.existingClaim=PVC_NAME stable/redis 201 ``` 202 203 ## Metrics 204 205 The chart optionally can start a metrics exporter for [prometheus](https://prometheus.io). The metrics endpoint (port 9121) is exposed in the service. Metrics can be scraped from within the cluster using something similar as the described in the [example Prometheus scrape configuration](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml). If metrics are to be scraped from outside the cluster, the Kubernetes API proxy can be utilized to access the endpoint.