Skip to content

Commit

Permalink
Lab 11, bonus task
Browse files Browse the repository at this point in the history
  • Loading branch information
kolayne committed Apr 12, 2024
1 parent c9c92c1 commit 7f85cb9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.
7 changes: 7 additions & 0 deletions k8s/app-go/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "app-go.environ" -}}
- name: var1
value: val1
- name: var2
value: val2
{{- end }}
2 changes: 2 additions & 0 deletions k8s/app-go/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ spec:
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{ include "app-go.environ" . | nindent 12 }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
Expand Down
12 changes: 6 additions & 6 deletions k8s/app-go/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ ingress:
# hosts:
# - chart-example.local

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

livenessProbe:
httpGet:
Expand Down
7 changes: 7 additions & 0 deletions k8s/app-py/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "app-py.environ" -}}
- name: var1
value: val1
- name: var2
value: val2
{{- end }}
1 change: 1 addition & 0 deletions k8s/app-py/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ spec:
secretKeyRef:
name: env-secret
key: value
{{ include "app-py.environ" . | nindent 12 }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
Expand Down
12 changes: 6 additions & 6 deletions k8s/app-py/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ ingress:
# hosts:
# - chart-example.local

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

livenessProbe:
httpGet:
Expand Down

0 comments on commit 7f85cb9

Please sign in to comment.