Files
openstack-helm/neutron/templates/job-ks-user.yaml
Vladimir Kozhukalov bfbf0c3b6d Charts to use their own service accounts
Currently charts create one user that
is used to get access to Keystone API to check auth
tokens and other services use this user
to get access to the service managed by this particular
chart.

So chart values must be aligned with each other. For
example when we deploy Neutron we use nova service
account managed by the Nova chart.

The spec [1] suggests charts by default to create
their own service accounts to get access to other APIs
instead of using service accounts managed by other charts.

[1] I12eb9341d5ff633ad4435f4938bf8c946ea388ee

This commit updates the following charts
- Neutron
- Nova
- Cinder

Depends-On: I12eb9341d5ff633ad4435f4938bf8c946ea388ee
Change-Id: Ic059b9bcd89084b0ccd1102ba57db7d3d1130af7
2025-06-12 16:04:52 -05:00

40 lines
1.6 KiB
YAML

{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.ks_user" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-1"
{{- end }}
{{- if .Values.manifests.job_ks_user }}
{{- $serviceUsers := (tuple "neutron" "nova" "placement") -}}
{{- if eq (.Values.conf.neutron.DEFAULT.external_dns_driver | default "") "designate" -}}
{{- $serviceUsers = append $serviceUsers "designate" -}}
{{- end -}}
{{- if (has "baremetal" .Values.network.backend) -}}
{{- $serviceUsers = append $serviceUsers "ironic" -}}
{{- end -}}
{{- $ksUserJob := dict "envAll" . "serviceName" "neutron" "serviceUsers" $serviceUsers -}}
{{- if or .Values.manifests.certificates .Values.tls.identity -}}
{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.network.server.internal -}}
{{- end -}}
{{- if .Values.helm3_hook }}
{{- $_ := set $ksUserJob "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) }}
{{- end }}
{{- if .Values.pod.tolerations.neutron.enabled -}}
{{- $_ := set $ksUserJob "tolerationsEnabled" true -}}
{{- end -}}
{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
{{- end }}