Skip to content

Commit

Permalink
update querybook helm charts (pinterest#1147)
Browse files Browse the repository at this point in the history
* update querybook helm charts

* container target port was templated

---------

Co-authored-by: ok9897 <ok9897@krafton.com>
  • Loading branch information
2 people authored and rohan-sh1 committed Apr 11, 2023
1 parent 7551e09 commit cd88cfa
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 27 deletions.
2 changes: 2 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ maintainers:
email: yongchana@gmail.com
- name: Jaehyeok Lee
email: q32145@gmail.com
- name: Changhoon Oh
email: ok9897@gmail.com
4 changes: 4 additions & 0 deletions helm/templates/scheduler/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ spec:
secretKeyRef:
name: {{ include "querybook.fullname" . }}-secret
key: ELASTICSEARCH_HOST
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
resources:
{{- toYaml .Values.scheduler.resources | nindent 12 }}
restartPolicy: Always
Expand Down
8 changes: 6 additions & 2 deletions helm/templates/web/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
imagePullPolicy: {{ .Values.web.image.pullPolicy }}
env:
- name: PORT
value: '10001'
value: "{{ .Values.web.service.containerPort }}"
- name: FLASK_SECRET_KEY
valueFrom:
secretKeyRef:
Expand All @@ -56,8 +56,12 @@ spec:
secretKeyRef:
name: {{ include "querybook.fullname" . }}-secret
key: ELASTICSEARCH_HOST
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
ports:
- containerPort: 10001
- containerPort: {{ .Values.web.service.containerPort }}
resources:
{{- toYaml .Values.web.resources | nindent 12 }}
restartPolicy: Always
Expand Down
44 changes: 44 additions & 0 deletions helm/templates/web/web-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{ if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.web.name }}
labels:
app: {{ include "querybook.name" . }}
chart: {{ include "querybook.chart" . }}
component: {{ .Values.web.name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $.Values.ingress.path }}
pathType: {{ $.Values.ingress.pathType }}
backend:
service:
name: {{ $.Values.web.name }}
port:
name: http
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion helm/templates/web/web-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
type: {{ .Values.web.service.serviceType }}
ports:
- port: {{ .Values.web.service.servicePort }}
targetPort: 10001
targetPort: {{ .Values.web.service.containerPort }}
protocol: TCP
name: http
selector:
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/worker/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ spec:
secretKeyRef:
name: {{ include "querybook.fullname" . }}-secret
key: ELASTICSEARCH_HOST
{{- range $key, $value := .Values.extraEnv }}
- name: {{ $key | quote}}
value: {{ $value | quote }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
48 changes: 24 additions & 24 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ worker:
limits:
memory: 900Mi
cpu: 1
nodeSelector: {}
affinity: {}
tolerations: []
podAnnotations: {}

scheduler:
replicaCount: 1
Expand All @@ -31,10 +27,6 @@ scheduler:
limits:
memory: '200Mi'
cpu: '100m'
nodeSelector: {}
affinity: {}
tolerations: []
podAnnotations: {}

web:
replicaCount: 1
Expand All @@ -46,17 +38,14 @@ web:
service:
serviceType: ClusterIP
servicePort: 80
containerPort: 10001
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 3Gi
cpu: 1
nodeSelector: {}
affinity: {}
tolerations: []
podAnnotations: {}

mysql:
enabled: true
Expand All @@ -82,10 +71,6 @@ mysql:
limits:
memory: '500Mi'
cpu: '300m'
nodeSelector: {}
affinity: {}
tolerations: []
podAnnotations: {}

redis:
enabled: true
Expand All @@ -105,10 +90,6 @@ redis:
limits:
memory: '1Gi'
cpu: '300m'
nodeSelector: {}
affinity: {}
tolerations: []
podAnnotations: {}

elasticsearch:
enabled: true
Expand Down Expand Up @@ -137,10 +118,29 @@ elasticsearch:
limits:
memory: '1Gi'
cpu: '200m'
nodeSelector: {}
affinity: {}
tolerations: []
podAnnotations: {}

# assigning pods to node configs. will be applied to all the querybook pods
nodeSelector: {}
affinity: {}
tolerations: []
podAnnotations: {}

ingress:
enabled: true
ingressClassName: ~
annotations: {}
path: /*
pathType: ImplementationSpecific
hosts:
- <your-querybook-app-domain>
tls: []
# - secretName: <your-querybook-tls-secret>
# hosts:
# - <your-querybook-app-domain>

extraEnv:
PUBLIC_URL: https://<your-querybook-app-domain>
# any other Querybook configuration env. variables can be injected from here

secret:
flask_secret_key: SOME_RANDOM_SECRET_KEY
Expand Down

0 comments on commit cd88cfa

Please sign in to comment.