-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(query): support workload type deployment
- Loading branch information
Showing
8 changed files
with
141 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{{- if eq (lower .Values.workload) "deployment" }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "databend-query.fullname" . }} | ||
labels: | ||
{{- include "databend-query.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "databend-query.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
{{- with .Values.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "databend-query.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "databend-query.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
initContainers: | ||
{{- if .Values.initContainers }} | ||
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | trim | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
command: | ||
- /databend-query | ||
- -c | ||
- /etc/databend-query/config.toml | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
{{- range $key, $val := .Values.service.ports }} | ||
- name: {{ $key }} | ||
containerPort: {{ $val}} | ||
{{- end }} | ||
livenessProbe: | ||
httpGet: | ||
path: /v1/health | ||
port: admin | ||
readinessProbe: | ||
httpGet: | ||
path: /v1/health | ||
port: admin | ||
initialDelaySeconds: 5 | ||
periodSeconds: 15 | ||
failureThreshold: 3 | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: QUERY_METRIC_API_ADDRESS | ||
value: "$(POD_IP):{{ .Values.service.ports.metric | default 7070 }}" | ||
- name: QUERY_ADMIN_API_ADDRESS | ||
value: "$(POD_IP):{{ .Values.service.ports.admin | default 8080 }}" | ||
- name: QUERY_FLIGHT_API_ADDRESS | ||
value: "$(POD_IP):{{ .Values.service.ports.flight | default 9090 }}" | ||
- name: QUERY_HTTP_HANDLER_HOST | ||
value: 0.0.0.0 | ||
- name: QUERY_HTTP_HANDLER_PORT | ||
value: {{ .Values.service.ports.http | default 8000 | quote }} | ||
- name: QUERY_FLIGHT_SQL_HANDLER_HOST | ||
value: 0.0.0.0 | ||
- name: QUERY_FLIGHT_SQL_HANDLER_PORT | ||
value: {{ .Values.service.ports.flightsql | default 8900 | quote }} | ||
- name: QUERY_MYSQL_HANDLER_HOST | ||
value: 0.0.0.0 | ||
- name: QUERY_MYSQL_HANDLER_PORT | ||
value: {{ .Values.service.ports.mysql | default 3307 | quote }} | ||
- name: QUERY_CLICKHOUSE_HTTP_HANDLER_HOST | ||
value: 0.0.0.0 | ||
- name: QUERY_CLICKHOUSE_HTTP_HANDLER_PORT | ||
value: {{ .Values.service.ports.ckhttp |default 8124 | quote }} | ||
{{- with .Values.envs }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: config | ||
# Note: subPath volume mount will not receive ConfigMap update. | ||
mountPath: /etc/databend-query | ||
{{- if .Values.sidecars }} | ||
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: {{ include "databend-query.fullname" .}} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
replicaCount: 3 | ||
workload: Deployment |