Helm/Redis: Difference between revisions
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update && helm repo list | helm repo update && helm repo list | ||
kubectl config get-contexts | |||
==Config== | ==Config== | ||
Line 84: | Line 85: | ||
echo 'ping'|redis-cli -h redis-headless.redis.svc | echo 'ping'|redis-cli -h redis-headless.redis.svc | ||
echo 'ping'|redis-cli -h redis-headless.redis | echo 'ping'|redis-cli -h redis-headless.redis | ||
echo 'ping'|redis-cli -h redis-headless | echo 'ping'|redis-cli -h redis-headless | ||
Line 95: | Line 95: | ||
echo 'ping'|redis-cli -h redis-master.redis.svc | echo 'ping'|redis-cli -h redis-master.redis.svc | ||
echo 'ping'|redis-cli -h redis-master.redis | echo 'ping'|redis-cli -h redis-master.redis | ||
echo 'ping'|redis-cli -h redis-master | echo 'ping'|redis-cli -h redis-master | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 215: | Line 214: | ||
* [[K8s/CSI Hostpath Driver|K8s » CSI Hostpath Driver]] | * [[K8s/CSI Hostpath Driver|K8s » CSI Hostpath Driver]] | ||
* [[K8s/Ingress|K8s » Ingress]] | * [[K8s/Ingress|K8s » Ingress]] | ||
* [[K8s/Service|K8s » Service]] | |||
* [[CIDR]] | * [[CIDR]] | ||
* [[UFW]] | * [[UFW]] |
Latest revision as of 22:22, 6 September 2024
helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update && helm repo list kubectl config get-contexts
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
echo -n password: ;read -s REDISCLI_AUTH;export REDISCLI_AUTH;echo
apk --update add redis inetutils-telnet
echo 'ping'|redis-cli -h redis-headless.redis.svc.cluster.local
echo 'ping'|redis-cli -h redis-headless.redis.svc
echo 'ping'|redis-cli -h redis-headless.redis
echo 'ping'|redis-cli -h redis-headless
echo 'ping'|redis-cli -h redis-replicas.redis.svc.cluster.local
echo 'ping'|redis-cli -h redis-replicas.redis.svc
echo 'ping'|redis-cli -h redis-replicas.redis
echo 'ping'|redis-cli -h redis-replicas
echo 'ping'|redis-cli -h redis-master.redis.svc.cluster.local
echo 'ping'|redis-cli -h redis-master.redis.svc
echo 'ping'|redis-cli -h redis-master.redis
echo 'ping'|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
| ||
| ||