Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update helm #7894

Merged
merged 5 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.d/20240515_144240_andrey_helm_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added <!-- pick one -->

- [Helm] Ability to specify ServiceAccount for backend pods
(<https://github.com/cvat-ai/cvat/pull/7894>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include all significant changes in the changelog entry.

The current changelog entry is missing information about the removal of the DJANGO_MODWSGI_EXTRA_ARGS environment variable and the conditional setting of database host and port environment variables. Consider updating the entry to reflect these changes for completeness.

### Added <!-- pick one -->

- [Helm] Ability to specify ServiceAccount for backend pods
  (<https://github.com/cvat-ai/cvat/pull/7894>)
- [Helm] Removed `DJANGO_MODWSGI_EXTRA_ARGS` environment variable from server pod
- [Helm] Conditional setting of database host and port environment variables

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
### Added <!-- pick one -->
- [Helm] Ability to specify ServiceAccount for backend pods
(<https://github.com/cvat-ai/cvat/pull/7894>)
### Added <!-- pick one -->
- [Helm] Ability to specify ServiceAccount for backend pods
(<https://github.com/cvat-ai/cvat/pull/7894>)
- [Helm] Removed `DJANGO_MODWSGI_EXTRA_ARGS` environment variable from server pod
- [Helm] Conditional setting of database host and port environment variables

2 changes: 1 addition & 1 deletion helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.12.1
version: 0.13.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
14 changes: 7 additions & 7 deletions helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,10 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
The name of the service account to use
azhavoro marked this conversation as resolved.
Show resolved Hide resolved
*/}}
{{- define "cvat.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "cvat.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- define "cvat.backend.serviceAccountName" -}}
{{- default "default" .Values.cvat.backend.serviceAccount.name }}
{{- end }}

{{- define "cvat.sharedBackendEnv" }}
Expand Down Expand Up @@ -98,10 +94,14 @@ Create the name of the service account to use
- name: CVAT_POSTGRES_PORT
value: "{{ .Values.postgresql.service.ports.postgresql }}"
{{- else }}
{{- if .Values.postgresql.external.host }}
- name: CVAT_POSTGRES_HOST
value: "{{ .Values.postgresql.external.host }}"
{{- end }}
{{- if .Values.postgresql.external.port }}
- name: CVAT_POSTGRES_PORT
value: "{{ .Values.postgresql.external.port }}"
{{- end}}
{{- end }}
- name: CVAT_POSTGRES_USER
valueFrom:
Expand Down
1 change: 1 addition & 0 deletions helm-chart/templates/cvat_backend/initializer/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
3 changes: 1 addition & 2 deletions helm-chart/templates/cvat_backend/server/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand All @@ -57,8 +58,6 @@ spec:
env:
- name: ALLOWED_HOSTS
value: {{ $localValues.envs.ALLOWED_HOSTS | squote}}
- name: DJANGO_MODWSGI_EXTRA_ARGS
value: {{ $localValues.envs.DJANGO_MODWSGI_EXTRA_ARGS}}
{{ include "cvat.sharedBackendEnv" . | indent 10 }}
{{- with concat .Values.cvat.backend.additionalEnv $localValues.additionalEnv }}
{{- toYaml . | nindent 10 }}
Expand Down
1 change: 1 addition & 0 deletions helm-chart/templates/cvat_backend/utils/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "cvat.backend.serviceAccountName" . }}
containers:
- name: cvat-backend
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
Expand Down
14 changes: 10 additions & 4 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ cvat:
additionalEnv: []
additionalVolumes: []
additionalVolumeMounts: []
# -- The service account the backend pods will use to interact with the Kubernetes API
serviceAccount:
# If set, the specified service account is used
# otherwise default service account is used
name: ""
azhavoro marked this conversation as resolved.
Show resolved Hide resolved

initializer:
labels: {}
Expand All @@ -36,7 +41,6 @@ cvat:
tolerations: []
envs:
ALLOWED_HOSTS: "*"
DJANGO_MODWSGI_EXTRA_ARGS: ""
additionalEnv: []
additionalVolumes: []
additionalVolumeMounts: []
Expand Down Expand Up @@ -275,9 +279,11 @@ postgresql:
#See https://github.com/bitnami/charts/blob/master/bitnami/postgresql/ for more info
enabled: true # false for external db
external:
host: 127.0.0.1
port: 5432
# If not external following config will be applied by default
# Ignored if an empty value is set
host: ""
# Ignored if an empty value is set
port: ""
# If not external following config will be applied by default
auth:
existingSecret: "{{ .Release.Name }}-postgres-secret"
username: cvat
Expand Down
Loading