Skip to content

Commit

Permalink
Helm fixes with support images override (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
goshander authored Nov 26, 2024
1 parent f6d7daa commit 0393de8
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 67 deletions.
16 changes: 10 additions & 6 deletions deploy/helm/templates/app-control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: app-control
spec:
replicas: {{ .Values.application.replicas.control }}
replicas: {{ .Values.application.control.replicas }}
selector:
matchLabels:
app: app-control
Expand All @@ -17,7 +17,11 @@ spec:
spec:
containers:
- name: app-control
image: {{ print "ghcr.io/datalens-tech/datalens-control-api:" .Values.application.versions.control }}
{{- if .Values.application.control.image }}
image: {{ .Values.application.control.image }}
{{- else }}
image: {{ print .Values.registry "/" "datalens-control-api:" .Values.versions.control }}
{{- end }}
ports:
- containerPort: 8080
env:
Expand Down Expand Up @@ -47,8 +51,8 @@ spec:
key: US_MASTER_TOKEN
resources:
requests:
cpu: {{ .Values.application.resources.control.requests.cpu }}
memory: {{ .Values.application.resources.control.requests.memory }}
cpu: {{ .Values.application.control.resources.requests.cpu }}
memory: {{ .Values.application.control.resources.requests.memory }}
limits:
cpu: {{ .Values.application.resources.control.limits.cpu }}
memory: {{ .Values.application.resources.control.limits.memory }}
cpu: {{ .Values.application.control.resources.limits.cpu }}
memory: {{ .Values.application.control.resources.limits.memory }}
16 changes: 10 additions & 6 deletions deploy/helm/templates/app-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: app-data
spec:
replicas: {{ .Values.application.replicas.data }}
replicas: {{ .Values.application.data.replicas }}
selector:
matchLabels:
app: app-data
Expand All @@ -17,7 +17,11 @@ spec:
spec:
containers:
- name: app-data
image: {{ print "ghcr.io/datalens-tech/datalens-data-api:" .Values.application.versions.data }}
{{- if .Values.application.data.image }}
image: {{ .Values.application.data.image }}
{{- else }}
image: {{ print .Values.registry "/" "datalens-data-api:" .Values.versions.data }}
{{- end }}
ports:
- containerPort: 8080
env:
Expand Down Expand Up @@ -56,8 +60,8 @@ spec:
key: US_MASTER_TOKEN
resources:
requests:
cpu: {{ .Values.application.resources.data.requests.cpu }}
memory: {{ .Values.application.resources.data.requests.memory }}
cpu: {{ .Values.application.data.resources.requests.cpu }}
memory: {{ .Values.application.data.resources.requests.memory }}
limits:
cpu: {{ .Values.application.resources.data.limits.cpu }}
memory: {{ .Values.application.resources.data.limits.memory }}
cpu: {{ .Values.application.data.resources.limits.cpu }}
memory: {{ .Values.application.data.resources.limits.memory }}
16 changes: 10 additions & 6 deletions deploy/helm/templates/app-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: app-ui
spec:
replicas: {{ .Values.application.replicas.ui }}
replicas: {{ .Values.application.ui.replicas }}
selector:
matchLabels:
app: app-ui
Expand All @@ -17,7 +17,11 @@ spec:
spec:
containers:
- name: app-ui
image: {{ print "ghcr.io/datalens-tech/datalens-ui:" .Values.application.versions.ui }}
{{- if .Values.application.ui.image }}
image: {{ .Values.application.ui.image }}
{{- else }}
image: {{ print .Values.registry "/" "datalens-ui:" .Values.versions.ui }}
{{- end }}
ports:
- containerPort: 8080
env:
Expand All @@ -42,8 +46,8 @@ spec:
key: US_MASTER_TOKEN
resources:
requests:
cpu: {{ .Values.application.resources.ui.requests.cpu }}
memory: {{ .Values.application.resources.ui.requests.memory }}
cpu: {{ .Values.application.ui.resources.requests.cpu }}
memory: {{ .Values.application.ui.resources.requests.memory }}
limits:
cpu: {{ .Values.application.resources.ui.limits.cpu }}
memory: {{ .Values.application.resources.ui.limits.memory }}
cpu: {{ .Values.application.ui.resources.limits.cpu }}
memory: {{ .Values.application.ui.resources.limits.memory }}
16 changes: 10 additions & 6 deletions deploy/helm/templates/app-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: app-us
spec:
replicas: {{ .Values.application.replicas.us }}
replicas: {{ .Values.application.us.replicas }}
selector:
matchLabels:
app: app-us
Expand All @@ -17,7 +17,11 @@ spec:
spec:
containers:
- name: app-us
image: {{ print "ghcr.io/datalens-tech/datalens-us:" .Values.application.versions.us }}
{{- if .Values.application.us.image }}
image: {{ .Values.application.us.image }}
{{- else }}
image: {{ print .Values.registry "/" "datalens-us:" .Values.versions.us }}
{{- end }}
ports:
- containerPort: 8083
env:
Expand All @@ -41,8 +45,8 @@ spec:
key: POSTGRES_DSN_LIST_US
resources:
requests:
cpu: {{ .Values.application.resources.us.requests.cpu }}
memory: {{ .Values.application.resources.us.requests.memory }}
cpu: {{ .Values.application.us.resources.requests.cpu }}
memory: {{ .Values.application.us.resources.requests.memory }}
limits:
cpu: {{ .Values.application.resources.us.limits.cpu }}
memory: {{ .Values.application.resources.us.limits.memory }}
cpu: {{ .Values.application.us.resources.limits.cpu }}
memory: {{ .Values.application.us.resources.limits.memory }}
15 changes: 14 additions & 1 deletion deploy/helm/templates/postgresql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ spec:
spec:
containers:
- name: app-pg
image: postgres:16
{{- if .Values.database.image }}
image: {{ .Values.database.image }}
{{- else if not (eq .Values.registry "ghcr.io/datalens-tech") }}
image: {{ print .Values.registry "/" "postgres:" .Values.database.version }}
{{- else }}
image: {{ print "postgres:" .Values.database.version }}
{{- end }}
ports:
- containerPort: 5432
env:
Expand All @@ -33,6 +39,13 @@ spec:
secretKeyRef:
name: datalens-secret
key: POSTGRES_PASSWORD
resources:
requests:
cpu: {{ .Values.database.resources.requests.cpu }}
memory: {{ .Values.database.resources.requests.memory }}
limits:
cpu: {{ .Values.database.resources.limits.cpu }}
memory: {{ .Values.database.resources.limits.memory }}
volumeMounts:
- name: pg-storage
mountPath: /var/lib/pgsql/data
Expand Down
60 changes: 39 additions & 21 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,67 @@
versions:
ui: 0.2312.0
control: 0.2176.0
data: 0.2176.0
us: 0.260.0

database:
enabled: true
demo: true
version: 16
image: null
resources:
requests:
cpu: 250m
memory: 128Mi
limits:
cpu: 1000m
memory: 512Mi

ingress:
enabled: true
domain: datalens.local
yc: false

registry: ghcr.io/datalens-tech

application:
versions:
ui: 0.2312.0
control: 0.2176.0
data: 0.2176.0
us: 0.260.0
replicas:
ui: 1
us: 1
data: 1
control: 1
resources:
ui:
ui:
replicas: 1
image: null
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 1000m
memory: 512Mi
control:
us:
replicas: 1
image: null
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi
control:
replicas: 1
image: null
resources:
requests:
cpu: 500m
memory: 1024Mi
limits:
cpu: 1000m
memory: 2048Mi
data:
data:
replicas: 1
image: null
resources:
requests:
cpu: 1000m
memory: 1024Mi
limits:
cpu: 2000m
memory: 2048Mi
us:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi
60 changes: 39 additions & 21 deletions templates/helm-values.j2
Original file line number Diff line number Diff line change
@@ -1,49 +1,67 @@
versions:
ui: {{ uiVersion }}
control: {{ controlApiVersion }}
data: {{ dataApiVersion }}
us: {{ usVersion }}

database:
enabled: true
demo: true
version: 16
image: null
resources:
requests:
cpu: 250m
memory: 128Mi
limits:
cpu: 1000m
memory: 512Mi

ingress:
enabled: true
domain: datalens.local
yc: false

registry: ghcr.io/datalens-tech

application:
versions:
ui: {{ uiVersion }}
control: {{ controlApiVersion }}
data: {{ dataApiVersion }}
us: {{ usVersion }}
replicas:
ui: 1
us: 1
data: 1
control: 1
resources:
ui:
ui:
replicas: 1
image: null
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 1000m
memory: 512Mi
control:
us:
replicas: 1
image: null
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi
control:
replicas: 1
image: null
resources:
requests:
cpu: 500m
memory: 1024Mi
limits:
cpu: 1000m
memory: 2048Mi
data:
data:
replicas: 1
image: null
resources:
requests:
cpu: 1000m
memory: 1024Mi
limits:
cpu: 2000m
memory: 2048Mi
us:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi

0 comments on commit 0393de8

Please sign in to comment.