Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
helm_overview [2020/05/16 19:25] – andonovj | helm_overview [2020/05/22 13:30] (current) – andonovj | ||
---|---|---|---|
Line 10: | Line 10: | ||
This scenario covers version 3.x of Helm. If you are using version 2.x, it's highly advisable to move to the recent version. | This scenario covers version 3.x of Helm. If you are using version 2.x, it's highly advisable to move to the recent version. | ||
- | =====Installation===== | + | =====Install Simple Redis Chart===== |
Helm can be installed very easily as follows: | Helm can be installed very easily as follows: | ||
Line 40: | Line 40: | ||
" | " | ||
master $ | master $ | ||
+ | </ | ||
+ | |||
+ | In case that is little bit deprecated you can use: | ||
+ | |||
+ | < | ||
+ | master $ helm repo add bitnami https:// | ||
+ | " | ||
+ | master $ | ||
</ | </ | ||
Line 113: | Line 121: | ||
version: 10.5.7 | version: 10.5.7 | ||
master $ | master $ | ||
+ | </ | ||
+ | |||
+ | ====Configure a namespace==== | ||
+ | Create a namespace for the installation target. | ||
+ | |||
+ | < | ||
+ | master $ kubectl create namespace redis | ||
+ | namespace/ | ||
+ | master $ | ||
+ | </ | ||
+ | |||
+ | With a known chart name, use the install command to deploy the chart to your cluster. | ||
+ | |||
+ | < | ||
+ | master $ helm install my-redis stable/ | ||
+ | WARNING: This chart is deprecated | ||
+ | NAME: my-redis | ||
+ | LAST DEPLOYED: Sat May 16 19:29:23 2020 | ||
+ | NAMESPACE: redis | ||
+ | STATUS: deployed | ||
+ | REVISION: 1 | ||
+ | TEST SUITE: None | ||
+ | NOTES: | ||
+ | This Helm chart is deprecated | ||
+ | |||
+ | Given the `stable` deprecation timeline (https:// | ||
+ | |||
+ | The Bitnami repository is already included in the Hubs and we will continue providing the same cadence of updates, support, etc that we've been keeping herethese years. Installation instructions are very similar, just adding the _bitnami_ repo and using it during the installation (`bitnami/< | ||
+ | |||
+ | ```bash | ||
+ | $ helm repo add bitnami https:// | ||
+ | $ helm install my-release bitnami/< | ||
+ | $ helm install --name my-release bitnami/< | ||
+ | ``` | ||
+ | |||
+ | To update an exisiting _stable_ deployment with a chart hosted in the bitnami repository you can execute | ||
+ | | ||
+ | repo add bitnami https:// | ||
+ | $ helm upgrade my-release bitnami/< | ||
+ | ``` | ||
+ | |||
+ | Issues and PRs related to the chart itself will be redirected to `bitnami/ | ||
+ | |||
+ | ** Please be patient while the chart is being deployed ** | ||
+ | Redis can be accessed via port 6379 on the following DNS names from within your cluster: | ||
+ | |||
+ | my-redis-master.redis.svc.cluster.local for read/write operations | ||
+ | my-redis-slave.redis.svc.cluster.local for read-only operations | ||
+ | |||
+ | |||
+ | To get your password run: | ||
+ | |||
+ | export REDIS_PASSWORD=$(kubectl get secret --namespace redis my-redis -o jsonpath=" | ||
+ | |||
+ | To connect to your Redis server: | ||
+ | |||
+ | 1. Run a Redis pod that you can use as a client: | ||
+ | |||
+ | | ||
+ | --env REDIS_PASSWORD=$REDIS_PASSWORD \ | ||
+ | | ||
+ | |||
+ | 2. Connect using the Redis CLI: | ||
+ | | ||
+ | | ||
+ | |||
+ | To connect to your database from outside the cluster execute the following commands: | ||
+ | |||
+ | kubectl port-forward --namespace redis svc/ | ||
+ | redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD | ||
+ | master $ | ||
+ | </ | ||
+ | |||
+ | It appears that is deprecated, be sure to use the Bitnami version, for which we have to add the repo first again and install it: | ||
+ | |||
+ | < | ||
+ | master $ helm repo add bitnami https:// | ||
+ | " | ||
+ | master $ helm install redis bitnami/ | ||
+ | NAME: redis | ||
+ | LAST DEPLOYED: Fri May 22 13:23:40 2020 | ||
+ | NAMESPACE: default | ||
+ | STATUS: deployed | ||
+ | REVISION: 1 | ||
+ | TEST SUITE: None | ||
+ | NOTES: | ||
+ | ** Please be patient while the chart is being deployed ** | ||
+ | Redis can be accessed via port 6379 on the following DNS names from within your cluster: | ||
+ | |||
+ | redis-master.default.svc.cluster.local for read/write operations | ||
+ | redis-slave.default.svc.cluster.local for read-only operations | ||
+ | |||
+ | |||
+ | To get your password run: | ||
+ | |||
+ | export REDIS_PASSWORD=$(kubectl get secret --namespace default redis -o jsonpath=" | ||
+ | |||
+ | To connect to your Redis server: | ||
+ | |||
+ | 1. Run a Redis pod that you can use as a client: | ||
+ | |||
+ | | ||
+ | --env REDIS_PASSWORD=$REDIS_PASSWORD \ | ||
+ | | ||
+ | |||
+ | 2. Connect using the Redis CLI: | ||
+ | | ||
+ | | ||
+ | |||
+ | To connect to your database from outside the cluster execute the following commands: | ||
+ | |||
+ | kubectl port-forward --namespace default svc/ | ||
+ | redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD | ||
+ | master $ helm ls | ||
+ | NAME NAMESPACE | ||
+ | redis | ||
+ | master $ | ||
+ | </ | ||
+ | |||
+ | ====Create Persistent Storage==== | ||
+ | Let's create couple persistant Volumes for storage: | ||
+ | |||
+ | < | ||
+ | master $ kubectl apply -f pv.yaml | ||
+ | persistentvolume/ | ||
+ | persistentvolume/ | ||
+ | persistentvolume/ | ||
+ | master $ mkdir /mnt/data1 /mnt/data2 /mnt/data3 --mode=777 | ||
+ | master $ cat pv.yaml | ||
+ | kind: PersistentVolume | ||
+ | apiVersion: v1 | ||
+ | metadata: | ||
+ | name: pv-volume1 | ||
+ | labels: | ||
+ | type: local | ||
+ | spec: | ||
+ | capacity: | ||
+ | storage: 10Gi | ||
+ | accessModes: | ||
+ | - ReadWriteOnce | ||
+ | hostPath: | ||
+ | path: "/ | ||
+ | --- | ||
+ | kind: PersistentVolume | ||
+ | apiVersion: v1 | ||
+ | metadata: | ||
+ | name: pv-volume2 | ||
+ | labels: | ||
+ | type: local | ||
+ | spec: | ||
+ | capacity: | ||
+ | storage: 10Gi | ||
+ | accessModes: | ||
+ | - ReadWriteOnce | ||
+ | hostPath: | ||
+ | path: "/ | ||
+ | --- | ||
+ | kind: PersistentVolume | ||
+ | apiVersion: v1 | ||
+ | metadata: | ||
+ | name: pv-volume3 | ||
+ | labels: | ||
+ | type: local | ||
+ | spec: | ||
+ | capacity: | ||
+ | storage: 10Gi | ||
+ | accessModes: | ||
+ | - ReadWriteOnce | ||
+ | hostPath: | ||
+ | path: "/ | ||
</ | </ |