76 lines
3.0 KiB
YAML
76 lines
3.0 KiB
YAML
{{/*
|
|
#
|
|
# Copyright (c) 2019 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
#
|
|
*/}}
|
|
|
|
{{- if .Values.manifests.job_ks_endpoints }}
|
|
{{- $envAll := . }}
|
|
{{- $serviceName := "keystone-api-proxy" }}
|
|
{{- $serviceRegion := $envAll.Values.endpoints.keystone_api_proxy.region_name }}
|
|
{{- $nodeSelector := dict $envAll.Values.labels.job.node_selector_key $envAll.Values.labels.job.node_selector_value -}}
|
|
{{- $configMapBin := printf "%s-%s" $serviceName "bin" }}
|
|
|
|
{{- $serviceAccountName := printf "%s-%s" $serviceName "ks-endpoints" }}
|
|
{{ tuple $envAll "ks_endpoints" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
|
|
|
---
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: {{ printf "%s-%s" $serviceName "ks-endpoints" | quote }}
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{ tuple $envAll $serviceName "ks-endpoints" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
|
spec:
|
|
serviceAccountName: {{ $serviceAccountName }}
|
|
restartPolicy: OnFailure
|
|
nodeSelector:
|
|
{{ toYaml $nodeSelector | indent 8 }}
|
|
initContainers:
|
|
{{ tuple $envAll "ks_endpoints" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
|
containers:
|
|
{{- range $key1, $osServiceType := tuple "identity" }}
|
|
{{- range $key2, $osRealServiceType := tuple "keystone_api_proxy" }}
|
|
{{- range $key3, $osServiceEndPoint := tuple "admin" "internal" "public" }}
|
|
- name: {{ printf "%s-%s-%s" "keystone-proxy" "ks-endpoints" $osServiceEndPoint | quote }}
|
|
image: {{ $envAll.Values.images.tags.ks_endpoints }}
|
|
imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
|
|
{{- $osServiceRegion := $serviceRegion }}
|
|
{{ tuple $envAll $envAll.Values.pod.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
|
command:
|
|
- /tmp/endpoint-update.sh
|
|
volumeMounts:
|
|
- name: endpoint-update-sh
|
|
mountPath: /tmp/endpoint-update.sh
|
|
subPath: endpoint-update.sh
|
|
readOnly: true
|
|
env:
|
|
{{- with $env := dict "ksUserSecret" $envAll.Values.secrets.identity.admin }}
|
|
{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }}
|
|
{{- end }}
|
|
- name: OS_SVC_ENDPOINT
|
|
value: {{ $osServiceEndPoint | quote }}
|
|
- name: OS_SERVICE_NAME
|
|
value: {{ tuple $osServiceType $envAll | include "helm-toolkit.endpoints.keystone_endpoint_name_lookup" }}
|
|
- name: OS_SERVICE_TYPE
|
|
value: {{ $osServiceType | quote }}
|
|
- name: OS_SERVICE_ENDPOINT
|
|
value: {{ tuple $osRealServiceType $osServiceEndPoint "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | quote }}
|
|
- name: OS_SERVICE_REGION
|
|
value: {{ $osServiceRegion | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: endpoint-update-sh
|
|
configMap:
|
|
name: {{ $configMapBin | quote }}
|
|
defaultMode: 0555
|
|
{{- end }}
|
|
{{- end }}
|