|
| 1 | +CHART NAME: {{ .Chart.Name }} |
| 2 | +CHART VERSION: {{ .Chart.Version }} |
| 3 | +APP VERSION: {{ .Chart.AppVersion }} |
| 4 | + |
| 5 | +** Please be patient while the chart is being deployed ** |
| 6 | + |
| 7 | +{{- if .Values.diagnosticMode.enabled }} |
| 8 | +The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with: |
| 9 | + |
| 10 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }} |
| 11 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }} |
| 12 | + |
| 13 | +Get the list of pods by executing: |
| 14 | + |
| 15 | + kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }} |
| 16 | + |
| 17 | +Access the pod you want to debug by executing |
| 18 | + |
| 19 | + kubectl exec --namespace {{ .Release.Namespace }} -ti <NAME OF THE POD> -- bash |
| 20 | + |
| 21 | +In order to replicate the container startup scripts execute this command: |
| 22 | + |
| 23 | +For Kvrocks: |
| 24 | + |
| 25 | + /opt/drycc/scripts/kvrocks/entrypoint.sh /opt/drycc/scripts/kvrocks/run.sh |
| 26 | + |
| 27 | +{{- if .Values.sentinel.enabled }} |
| 28 | + |
| 29 | +For Sentinel: |
| 30 | + |
| 31 | + /opt/drycc/scripts/sentinel/entrypoint.sh /opt/drycc/scripts/sentinel/run.sh |
| 32 | + |
| 33 | +{{- end }} |
| 34 | +{{- else }} |
| 35 | + |
| 36 | +{{- if contains .Values.master.service.type "LoadBalancer" }} |
| 37 | +{{- if not .Values.auth.enabled }} |
| 38 | +{{ if and (not .Values.networkPolicy.enabled) (.Values.networkPolicy.allowExternal) }} |
| 39 | + |
| 40 | +------------------------------------------------------------------------------- |
| 41 | + WARNING |
| 42 | + |
| 43 | + By specifying "master.service.type=LoadBalancer" and "auth.enabled=false" you have |
| 44 | + most likely exposed the Kvrocks; service externally without any authentication |
| 45 | + mechanism. |
| 46 | + |
| 47 | + For security reasons, we strongly suggest that you switch to "ClusterIP" or |
| 48 | + "NodePort". As alternative, you can also switch to "auth.enabled=true" |
| 49 | + providing a valid password on "password" parameter. |
| 50 | + |
| 51 | +------------------------------------------------------------------------------- |
| 52 | +{{- end }} |
| 53 | +{{- end }} |
| 54 | +{{- end }} |
| 55 | + |
| 56 | +{{- if eq .Values.architecture "replication" }} |
| 57 | +{{- if .Values.sentinel.enabled }} |
| 58 | + |
| 59 | +Kvrocks; can be accessed via port {{ .Values.sentinel.service.ports.kvrocks }} on the following DNS name from within your cluster: |
| 60 | + |
| 61 | + {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} for read only operations |
| 62 | + |
| 63 | +For read/write operations, first access the Kvrocks; Sentinel cluster, which is available in port {{ .Values.sentinel.service.ports.sentinel }} using the same domain name above. |
| 64 | + |
| 65 | +{{- else }} |
| 66 | + |
| 67 | +Kvrocks; can be accessed on the following DNS names from within your cluster: |
| 68 | + |
| 69 | + {{ printf "%s-master.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain }} for read/write operations (port {{ .Values.master.service.ports.kvrocks }}) |
| 70 | + {{ printf "%s-replicas.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain }} for read-only operations (port {{ .Values.replica.service.ports.kvrocks }}) |
| 71 | + |
| 72 | +{{- end }} |
| 73 | +{{- else }} |
| 74 | + |
| 75 | +Kvrocks; can be accessed via port {{ .Values.master.service.ports.kvrocks }} on the following DNS name from within your cluster: |
| 76 | + |
| 77 | + {{ template "common.names.fullname" . }}-master.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} |
| 78 | + |
| 79 | +{{- end }} |
| 80 | + |
| 81 | +{{ if .Values.auth.enabled }} |
| 82 | + |
| 83 | +To get your password run: |
| 84 | + |
| 85 | + export KVROCKS_REQUIREPASS=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "kvrocks.secretName" . }} -o jsonpath="{.data.kvrocks-password}" | base64 --decode) |
| 86 | + |
| 87 | +{{- end }} |
| 88 | + |
| 89 | +To connect to your Kvrocks; server: |
| 90 | + |
| 91 | +1. Run a Kvrocks; pod that you can use as a client: |
| 92 | + |
| 93 | + kubectl run --namespace {{ .Release.Namespace }} redis-client --restart='Never' {{ if .Values.auth.enabled }} --env KVROCKS_REQUIREPASS=$KVROCKS_REQUIREPASS {{ end }} --image {{ template "kvrocks.image" . }} --command -- sleep infinity |
| 94 | + |
| 95 | + Use the following command to attach to the pod: |
| 96 | + |
| 97 | + kubectl exec --tty -i redis-client \ |
| 98 | + {{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}--labels="{{ template "common.names.fullname" . }}-client=true" \{{- end }} |
| 99 | + --namespace {{ .Release.Namespace }} -- bash |
| 100 | + |
| 101 | +2. Connect using the Kvrocks; CLI: |
| 102 | + |
| 103 | +{{- if eq .Values.architecture "replication" }} |
| 104 | + {{- if .Values.sentinel.enabled }} |
| 105 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.kvrocks }} # Read only operations |
| 106 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.sentinel }} # Sentinel access |
| 107 | + {{- else }} |
| 108 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ printf "%s-master" (include "common.names.fullname" .) }} |
| 109 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ printf "%s-replicas" (include "common.names.fullname" .) }} |
| 110 | + {{- end }} |
| 111 | +{{- else }} |
| 112 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h {{ template "common.names.fullname" . }}-master |
| 113 | +{{- end }} |
| 114 | + |
| 115 | +{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} |
| 116 | + |
| 117 | +Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to kvrocks. |
| 118 | + |
| 119 | +{{- else }} |
| 120 | + |
| 121 | +To connect to your database from outside the cluster execute the following commands: |
| 122 | + |
| 123 | +{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }} |
| 124 | +{{- if contains "NodePort" .Values.sentinel.service.type }} |
| 125 | + |
| 126 | + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") |
| 127 | + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "common.names.fullname" . }}) |
| 128 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT |
| 129 | + |
| 130 | +{{- else if contains "LoadBalancer" .Values.sentinel.service.type }} |
| 131 | + |
| 132 | + NOTE: It may take a few minutes for the LoadBalancer IP to be available. |
| 133 | + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}' |
| 134 | + |
| 135 | + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "common.names.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") |
| 136 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.sentinel.service.ports.kvrocks }} |
| 137 | + |
| 138 | +{{- else if contains "ClusterIP" .Values.sentinel.service.type }} |
| 139 | + |
| 140 | + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "common.names.fullname" . }} {{ .Values.sentinel.service.ports.kvrocks }}:{{ .Values.sentinel.service.ports.kvrocks }} & |
| 141 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.sentinel.service.ports.kvrocks }} |
| 142 | + |
| 143 | +{{- end }} |
| 144 | +{{- else }} |
| 145 | +{{- if contains "NodePort" .Values.master.service.type }} |
| 146 | + |
| 147 | + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") |
| 148 | + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ printf "%s-master" (include "common.names.fullname" .) }}) |
| 149 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT |
| 150 | + |
| 151 | +{{- else if contains "LoadBalancer" .Values.master.service.type }} |
| 152 | + |
| 153 | + NOTE: It may take a few minutes for the LoadBalancer IP to be available. |
| 154 | + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}' |
| 155 | + |
| 156 | + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ printf "%s-master" (include "common.names.fullname" .) }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") |
| 157 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.master.service.port }} |
| 158 | + |
| 159 | +{{- else if contains "ClusterIP" .Values.master.service.type }} |
| 160 | + |
| 161 | + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ printf "%s-master" (include "common.names.fullname" .) }} {{ .Values.master.service.port }}:{{ .Values.master.service.port }} & |
| 162 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$KVROCKS_REQUIREPASS" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.master.service.port }} |
| 163 | + |
| 164 | +{{- end }} |
| 165 | +{{- end }} |
| 166 | + |
| 167 | +{{- end }} |
| 168 | +{{- end }} |
| 169 | +{{- include "kvrocks.checkRollingTags" . }} |
| 170 | +{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }} |
| 171 | +{{- include "common.warnings.rollingTag" .Values.sysctl.image }} |
| 172 | + |
| 173 | +{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled (eq .Values.sentinel.service.type "NodePort") (not .Release.IsUpgrade ) }} |
| 174 | +{{- if $.Values.sentinel.service.nodePorts.sentinel }} |
| 175 | +No need to upgrade, ports and nodeports have been set from values |
| 176 | +{{- else }} |
| 177 | +#!#!#!#!#!#!#!# IMPORTANT #!#!#!#!#!#!#!# |
| 178 | +YOU NEED TO PERFORM AN UPGRADE FOR THE SERVICES AND WORKLOAD TO BE CREATED |
| 179 | +{{- end }} |
| 180 | +{{- end }} |
0 commit comments