diff --git a/helm/prenet-values.yaml b/helm/prenet-values.yaml index 541a92e5..f4dc93b9 100644 --- a/helm/prenet-values.yaml +++ b/helm/prenet-values.yaml @@ -46,3 +46,61 @@ extraEnvVars: value: "/dns/polybase-rust-0.polybase-rust-headless.polybase.svc.cluster.local/tcp/5001,/dns/polybase-rust-1.polybase-rust-headless.polybase.svc.cluster.local/tcp/5001,/dns/polybase-rust-2.polybase-rust-headless.polybase.svc.cluster.local/tcp/5001" - name: MIGRATION_BATCH_SIZE value: "2000" + +deployments: +- name: gateway + labels: + app: polybase + replicaCount: 4 + command: run + imagePullPolicy: Always + podSecurityContext: false + livenessProbe: + enabled: false + readinessProbe: + enabled: false + startupProbe: + enabled: false + containerPorts: + public_api: 80 + p2p: 8080 + cloudsql: + usePrivateIP: true + project: prenet + region: us-central1 + db_instance: polybase + image: sql_proxy + tag: 1.0.0 +- name: indexer + labels: + app: polybase + replicaCount: 16 + command: run + imagePullPolicy: Always + podSecurityContext: false + livenessProbe: + enabled: false + readinessProbe: + enabled: false + startupProbe: + enabled: false + containerPorts: + public_api: 80 + p2p: 8080 +- name: prover + labels: + app: polybase + replicaCount: 5 + command: run + imagePullPolicy: Always + podSecurityContext: false + livenessProbe: + enabled: false + readinessProbe: + enabled: false + startupProbe: + enabled: false + containerPorts: + public_api: 80 + p2p: 8080 + diff --git a/helm/templates/deployments.yaml b/helm/templates/deployments.yaml new file mode 100644 index 00000000..b43161b9 --- /dev/null +++ b/helm/templates/deployments.yaml @@ -0,0 +1,127 @@ +{{- range .Values.deployments }} + +--- + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .name }} + namespace: {{ $.Release.Namespace | quote }} + labels: + {{- if .labels }} + {{- toYaml .labels | nindent 4}} + {{- end }} + {{- if .commonAnnotations }} + annotations: {{- include "polybase.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "polybase.labels" $ | nindent 8 }} + replicas: {{ .replicaCount }} + template: + metadata: + labels: + {{- include "polybase.labels" $ | nindent 8 }} + {{- if .podLabels }} + {{- toYaml .podLabels | nindent 8 }} + {{- end }} + {{- if or .podAnnotations }} + annotations: + {{- if .podAnnotations }} + {{- toYaml .podAnnotations | nindent 8 }} + {{- end }} + {{- end }} + spec: + {{- if .nodeSelector }} + nodeSelector: {{- include "polybase.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} + {{- end }} + {{- if .tolerations }} + tolerations: {{- include "polybase.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }} + {{- end }} + containers: + - name: {{ .name }} + command: {{ .command }} + {{- if .args }} + args: {{ .args }} + {{- end }} + image: {{ include "polybase.main_image" $ }} + imagePullPolicy: {{ .imagePullPolicy | quote }} + env: + {{- if .extraEnvVars }} + {{- include "polybase.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 10 }} + {{- end }} + {{- if .customLivenessProbe }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} + {{- else if .livenessProbe.enabled }} + livenessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: {{ .livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .livenessProbe.periodSeconds }} + timeoutSeconds: {{ .livenessProbe.timeoutSeconds }} + successThreshold: {{ .livenessProbe.successThreshold }} + failureThreshold: {{ .livenessProbe.failureThreshold }} + {{- end }} + {{- if .customReadinessProbe }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} + {{- else if .readinessProbe.enabled }} + readinessProbe: + httpGet: + path: /v0/health + port: 8080 + initialDelaySeconds: {{ .readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .readinessProbe.periodSeconds }} + timeoutSeconds: {{ .readinessProbe.timeoutSeconds }} + successThreshold: {{ .readinessProbe.successThreshold }} + failureThreshold: {{ .readinessProbe.failureThreshold }} + {{- end }} + {{- if .customStartupProbe }} + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} + {{- else if .startupProbe.enabled }} + startupProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: {{ .startupProbe.initialDelaySeconds }} + periodSeconds: {{ .startupProbe.periodSeconds }} + timeoutSeconds: {{ .startupProbe.timeoutSeconds }} + successThreshold: {{ .startupProbe.successThreshold }} + failureThreshold: {{ .startupProbe.failureThreshold }} + {{- end }} + ports: + - name: public-api + containerPort: {{ .containerPorts.public_api | default "8080" }} + {{- if .hostNetwork }} + hostPort: {{ .containerPorts.public_api }} + {{- end }} + - name: p2p + containerPort: {{ .containerPorts.p2p | default "5001" }} + {{- if .hostNetwork }} + hostPort: {{ .containerPorts.p2p }} + {{- end }} + {{- if .resources }} + resources: {{ toYaml .resources | nindent 12 }} + {{- end }} + + #cloudsql + {{- if .cloudsql }} + - name: {{ .name }}-sql-proxy + args: + {{- if .cloudsql.credentialFile }} + - --credentials-file={{ .cloudsql.credentialFile }} + {{- end }} + {{- if .cloudsql.usePrivateIP }} + - --private-ip + {{- end }} + - --max-sigterm-delay={{ .cloudsql.timeout | default "30s" }} + - "{{ .project }}:{{ .cloudsql.region }}:{{ .cloudsql.db_instance }}" + image: {{ .cloudsql.image }}:{{ .cloudsql.tag }} + imagePullPolicy: IfNotPresent + securityContext: + {{- toYaml .cloudsql.securityContext | nindent 12 }} + resources: + {{- toYaml .cloudsql.resources | nindent 12 }} + {{- end }} +{{- end }}