mirror of https://github.com/easzlab/kubeasz.git
26 lines
1.1 KiB
Plaintext
26 lines
1.1 KiB
Plaintext
Redis can be accessed via port {{ .Values.redis.port }} and Sentinel can be accessed via port {{ .Values.sentinel.port }} on the following DNS name from within your cluster:
|
|
{{ template "redis-ha.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
|
|
|
To connect to your Redis server:
|
|
|
|
{{- if .Values.auth }}
|
|
1. To retrieve the redis password:
|
|
echo $(kubectl get secret {{ template "redis-ha.fullname" . }} -o "jsonpath={.data['auth']}" | base64 --decode)
|
|
|
|
2. Connect to the Redis master pod that you can use as a client. By default the {{ template "redis-ha.fullname" . }}-server-0 pod is configured as the master:
|
|
|
|
kubectl exec -it {{ template "redis-ha.fullname" . }}-server-0 sh -n {{ .Release.Namespace }}
|
|
|
|
3. Connect using the Redis CLI (inside container):
|
|
|
|
redis-cli -a <REDIS-PASS-FROM-SECRET>
|
|
{{- else }}
|
|
1. Run a Redis pod that you can use as a client:
|
|
|
|
kubectl exec -it {{ template "redis-ha.fullname" . }}-server-0 sh -n {{ .Release.Namespace }}
|
|
|
|
2. Connect using the Redis CLI:
|
|
|
|
redis-cli -h {{ template "redis-ha.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
|
{{- end }}
|