Helm/Redis

From Chorke Wiki
Revision as of 23:48, 16 August 2024 by Shahed (talk | contribs) (Created page with " helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update && helm repo list ==Config== <syntaxhighlight lang="properties"> export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/config" </syntaxhighlight> ==Install== {| |valign="top"| <syntaxhighlight lang="bash"> helm show values bitnami/redis --version=19.6.4|less helm show values bitnami/redis --version=20.0.2|les...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update && helm repo list

Config

export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"

Install

helm show values bitnami/redis --version=19.6.4|less
helm show values bitnami/redis --version=20.0.2|less
kubectl get ns|grep redis
kubectl delete ns   redis
kubectl get ns|grep redis
kubectl create ns   redis

cat <<YML | helm -n redis install    redis bitnami/redis --version=20.0.2 -f -
---
global:
  storageClass: standard
  redis:
    password: sadaqah!
master:
  count: 1
  service:
    nodePorts:
      redis: 30000
replica:
  replicaCount: 1
YML

redis-cli -h redis.k8s.local
redis-cli -h replica.redis.k8s.local

Uninstall

helm uninstall -n redis redis
kubectl delete namespace redis

Swiss Knife

kubectl -n redis run -i --tty --rm redis-cli --image=alpine --restart=Never -- sh
apk --update add redis inetutils-telnet

redis-cli -h redis-replicas.redis.svc.cluster.local
redis-cli -h redis-replicas.redis.svc
redis-cli -h redis-replicas.redis
redis-cli -h redis-replicas

redis-cli -h redis-master.redis.svc.cluster.local
redis-cli -h redis-master.redis.svc
redis-cli -h redis-master.redis
redis-cli -h redis-master
redis-cli -h redis-master

Playground

helm -n redis install    redis bitnami/redis --version=19.6.4
helm -n redis upgrade -i redis bitnami/redis --version=20.0.2
helm show values bitnami/redis --version=20.0.2|less

kubectl -n redis get secret redis -o json|jq -r '.data."redis-password"'|base64 -d;echo
kubectl -n redis exec -it svc/redis-replicas -c redis -- bash
kubectl -n redis exec -it svc/redis-master   -c redis -- bash

kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten

kubectl -n redis delete all --all
kubectl -n redis delete ing --all
kubectl -n redis delete sts --all
kubectl -n redis delete svc --all
kubectl -n redis delete pvc --all
kubectl -n redis delete pv  --all

kubectl -n redis rollout history sts redis
kubectl -n redis rollout restart sts redis
kubectl -n redis rollout status  sts redis
kubectl -n redis exec -it svc/redis-master   -- redis-cli
kubectl -n redis logs -f  svc/redis-master   -c redis
kubectl -n redis logs -f  svc/redis-replicas -c redis

References