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 20:23] – 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 194: | Line 194: | ||
</ | </ | ||
- | It appears that is deprecated, be sure to use the Bitnami version: | + | 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 search | + | master $ helm repo add bitnami https:// |
- | NAME CHART VERSION | + | " |
- | bitnami/ | + | master $ helm install redis bitnami/ |
- | bitnami/redis-cluster | + | NAME: redis |
- | stable/ | + | LAST DEPLOYED: Fri May 22 13:23:40 2020 |
- | stable/ | + | NAMESPACE: default |
- | stable/redis-ha 4.4.4 5.0.6 Highly available Kubernetes implementation of R... | + | STATUS: deployed |
- | stable/ | + | REVISION: |
+ | 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: | ||
+ | redis-cli -h redis-master -a $REDIS_PASSWORD | ||
+ | | ||
+ | |||
+ | To connect to your database from outside the cluster execute the following commands: | ||
+ | |||
+ | kubectl port-forward --namespace default svc/redis-master 6379:6379 & | ||
+ | redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD | ||
+ | master $ helm ls | ||
+ | NAME NAMESPACE | ||
+ | redis default | ||
master $ | 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: "/ | ||
+ | </ |