Skip to content

Commit 7f85cb9

Browse files
committed
Lab 11, bonus task
1 parent c9c92c1 commit 7f85cb9

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

k8s/app-go/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ Create the name of the service account to use
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
63+
64+
{{- define "app-go.environ" -}}
65+
- name: var1
66+
value: val1
67+
- name: var2
68+
value: val2
69+
{{- end }}

k8s/app-go/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ spec:
5050
volumeMounts:
5151
{{- toYaml . | nindent 12 }}
5252
{{- end }}
53+
env:
54+
{{ include "app-go.environ" . | nindent 12 }}
5355
{{- with .Values.volumes }}
5456
volumes:
5557
{{- toYaml . | nindent 8 }}

k8s/app-go/values.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ ingress:
5151
# hosts:
5252
# - chart-example.local
5353

54-
resources: {}
54+
resources:
5555
# We usually recommend not to specify default resources and to leave this as a conscious
5656
# choice for the user. This also increases chances charts run on environments with little
5757
# resources, such as Minikube. If you do want to specify resources, uncomment the following
5858
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
59-
# limits:
59+
limits:
6060
# cpu: 100m
61-
# memory: 128Mi
62-
# requests:
63-
# cpu: 100m
64-
# memory: 128Mi
61+
memory: 50Mi
62+
requests:
63+
cpu: 2000m
64+
memory: 20Mi
6565

6666
livenessProbe:
6767
httpGet:

k8s/app-py/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ Create the name of the service account to use
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
63+
64+
{{- define "app-py.environ" -}}
65+
- name: var1
66+
value: val1
67+
- name: var2
68+
value: val2
69+
{{- end }}

k8s/app-py/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ spec:
5656
secretKeyRef:
5757
name: env-secret
5858
key: value
59+
{{ include "app-py.environ" . | nindent 12 }}
5960
{{- with .Values.volumes }}
6061
volumes:
6162
{{- toYaml . | nindent 8 }}

k8s/app-py/values.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ ingress:
5555
# hosts:
5656
# - chart-example.local
5757

58-
resources: {}
58+
resources:
5959
# We usually recommend not to specify default resources and to leave this as a conscious
6060
# choice for the user. This also increases chances charts run on environments with little
6161
# resources, such as Minikube. If you do want to specify resources, uncomment the following
6262
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
63-
# limits:
63+
limits:
6464
# cpu: 100m
65-
# memory: 128Mi
66-
# requests:
67-
# cpu: 100m
68-
# memory: 128Mi
65+
memory: 60Mi
66+
requests:
67+
cpu: 2000m
68+
memory: 30Mi
6969

7070
livenessProbe:
7171
httpGet:

0 commit comments

Comments
 (0)