66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
kind: Pod
|
|
apiVersion: v1
|
|
metadata:
|
|
name: {{ template "cockroachdb.fullname" . }}-test
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
{{- if .Values.networkPolicy.enabled }}
|
|
labels:
|
|
{{ template "cockroachdb.fullname" . }}-client: "true"
|
|
{{- end }}
|
|
annotations:
|
|
helm.sh/hook: test-success
|
|
spec:
|
|
restartPolicy: Never
|
|
{{- if .Values.image.credentials }}
|
|
imagePullSecrets:
|
|
- name: {{ template "cockroachdb.fullname" . }}.db.registry
|
|
{{- end }}
|
|
{{- if or .Values.tls.certs.provided .Values.tls.certs.certManager }}
|
|
volumes:
|
|
- name: client-certs
|
|
{{- if or .Values.tls.certs.tlsSecret .Values.tls.certs.certManager }}
|
|
projected:
|
|
sources:
|
|
- secret:
|
|
name: {{ .Values.tls.certs.clientRootSecret }}
|
|
items:
|
|
- key: ca.crt
|
|
path: ca.crt
|
|
mode: 0400
|
|
- key: tls.crt
|
|
path: client.root.crt
|
|
mode: 0400
|
|
- key: tls.key
|
|
path: client.root.key
|
|
mode: 0400
|
|
{{- else }}
|
|
secret:
|
|
secretName: {{ .Values.tls.certs.clientRootSecret }}
|
|
defaultMode: 0400
|
|
{{- end }}
|
|
{{- end }}
|
|
containers:
|
|
- name: client-test
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
|
{{- if or .Values.tls.certs.provided .Values.tls.certs.certManager }}
|
|
volumeMounts:
|
|
- name: client-certs
|
|
mountPath: /cockroach-certs
|
|
{{- end }}
|
|
command:
|
|
- /cockroach/cockroach
|
|
- sql
|
|
{{- if or .Values.tls.certs.provided .Values.tls.certs.certManager }}
|
|
- --certs-dir
|
|
- /cockroach-certs
|
|
{{- else }}
|
|
- --insecure
|
|
{{- end}}
|
|
- --host
|
|
- {{ template "cockroachdb.fullname" . }}-public.{{ .Release.Namespace }}
|
|
- --port
|
|
- {{ .Values.service.ports.grpc.external.port | quote }}
|
|
- -e
|
|
- SHOW DATABASES;
|