github.com/argoproj/argo-cd@v1.8.7/util/helm/testdata/redis/templates/NOTES.txt (about)

     1  ** Please be patient while the chart is being deployed **
     2  
     3  {{- if contains .Values.master.service.type "LoadBalancer" }}
     4  {{- if not .Values.usePassword }}
     5  {{ if and (not .Values.networkPolicy.enabled) (.Values.networkPolicy.allowExternal) }}
     6  
     7  -------------------------------------------------------------------------------
     8   WARNING
     9  
    10      By specifying "master.service.type=LoadBalancer" and "usePassword=false" you have
    11      most likely exposed the Redis service externally without any authentication
    12      mechanism.
    13  
    14      For security reasons, we strongly suggest that you switch to "ClusterIP" or
    15      "NodePort". As alternative, you can also switch to "usePassword=true"
    16      providing a valid password on "password" parameter.
    17  
    18  -------------------------------------------------------------------------------
    19  {{- end }}
    20  {{- end }}
    21  {{- end }}
    22  
    23  {{- if .Values.cluster.enabled }}
    24  Redis can be accessed via port {{ .Values.master.port }} on the following DNS names from within your cluster:
    25  
    26  {{ template "redis.fullname" . }}-master.{{ .Release.Namespace }}.svc.cluster.local for read/write operations
    27  {{ template "redis.fullname" . }}-slave.{{ .Release.Namespace }}.svc.cluster.local for read-only operations
    28  
    29  {{- else }}
    30  Redis can be accessed via port {{ .Values.master.port }} on the following DNS name from within your cluster:
    31  
    32  {{ template "redis.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
    33  
    34  {{- end }}
    35  
    36  {{ if .Values.usePassword }}
    37  To get your password run:
    38  
    39      export REDIS_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "redis.fullname" . }} -o jsonpath="{.data.redis-password}" | base64 --decode)
    40  {{- end }}
    41  
    42  To connect to your Redis server:
    43  
    44  1. Run a Redis pod that you can use as a client:
    45  
    46     kubectl run --namespace {{ .Release.Namespace }} {{ template "redis.fullname" . }}-client --rm --tty -i \
    47     {{ if .Values.usePassword }} --env REDIS_PASSWORD=$REDIS_PASSWORD \{{ end }}
    48     {{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}--labels="{{ template "redis.name" . }}-client=true" \{{- end }}
    49     --image {{ template "redis.image" . }} -- bash
    50  
    51  2. Connect using the Redis CLI:
    52  
    53  {{- if .Values.cluster.enabled }}
    54     redis-cli -h {{ template "redis.fullname" . }}-master{{ if .Values.usePassword }} -a $REDIS_PASSWORD{{ end }}
    55     redis-cli -h {{ template "redis.fullname" . }}-slave{{ if .Values.usePassword }} -a $REDIS_PASSWORD{{ end }}
    56  {{- else }}
    57     redis-cli -h {{ template "redis.fullname" . }}{{ if .Values.usePassword }} -a $REDIS_PASSWORD{{ end }}
    58  {{- end }}
    59  
    60  {{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
    61  Note: Since NetworkPolicy is enabled, only pods with label
    62  {{ template "redis.fullname" . }}-client=true"
    63  will be able to connect to redis.
    64  {{- else -}}
    65  
    66  To connect to your database from outside the cluster execute the following commands:
    67  
    68  {{- if contains "NodePort" .Values.master.service.type }}
    69  
    70      export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
    71      export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "redis.fullname" . }}-master)
    72      redis-cli -h $NODE_IP -p $NODE_PORT {{- if .Values.usePassword }} -a $REDIS_PASSWORD{{ end }}
    73  
    74  {{- else if contains "LoadBalancer" .Values.master.service.type }}
    75  
    76    NOTE: It may take a few minutes for the LoadBalancer IP to be available.
    77          Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "redis.fullname" . }}'
    78  
    79      export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "redis.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
    80      redis-cli -h $SERVICE_IP -p {{ .Values.master.service.nodePort }} {{- if .Values.usePassword }} -a $REDIS_PASSWORD{{ end }}
    81  
    82  {{- else if contains "ClusterIP" .Values.master.service.type }}
    83  
    84      export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "redis.name" . }}" -o jsonpath="{.items[0].metadata.name}")
    85      kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME {{ .Values.master.port }}:{{ .Values.master.port }}
    86      redis-cli -h 127.0.0.1 -p {{ .Values.master.port }} {{- if .Values.usePassword }} -a $REDIS_PASSWORD{{ end }}
    87  
    88  {{- end }}
    89  {{- end }}