Skip to content

Commit

Permalink
F2calv/2024 04 improve helm chart (#88)
Browse files Browse the repository at this point in the history
* handle empty envVars

* add more hasKey

* added maintainers

* remove maintainers

* tweak ci
  • Loading branch information
f2calv authored May 25, 2024
1 parent 1aebb91 commit e789f11
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
chart-repository-prefix: charts/
tag: ${{ needs.versioning.outputs.semVer }}
push-chart: ${{ github.ref_name == github.event.repository.default_branch }}
chart-testing-cli-command: install

release:
needs: [versioning, app, image, chart]
Expand Down
14 changes: 14 additions & 0 deletions charts/multi-arch-container-rust/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,53 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "multi-arch-container-rust.serviceAccountName" . }}
{{- if hasKey .Values "podSecurityContext" }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- if hasKey .Values "securityContext" }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
env:
{{- if hasKey .Values "git" }}
- name: "GIT_REPOSITORY"
value: {{ .Values.git.repository | default "" | quote }}
- name: "GIT_BRANCH"
value: {{ .Values.git.branch | default "" | quote }}
- name: "GIT_COMMIT"
value: {{ .Values.git.commit | default "" | quote }}
{{- end }}
- name: "GIT_TAG"
value: {{ .Values.image.tag | default .Chart.AppVersion }}
{{- if hasKey .Values "github" }}
- name: "GITHUB_WORKFLOW"
value: {{ .Values.github.workflow | default "" | quote }}
- name: "GITHUB_RUN_ID"
value: {{ .Values.github.run_id | int64 | default 0 | quote }}
- name: "GITHUB_RUN_NUMBER"
value: {{ .Values.github.run_number | int64 | default 0 | quote }}
{{- end }}
{{- if hasKey .Values "livenessProbe" }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
{{- end }}
{{- if hasKey .Values "readinessProbe" }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
{{- end }}
{{- if hasKey .Values "resources" }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
Expand Down

0 comments on commit e789f11

Please sign in to comment.