A configuration management service with support for secrets.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

job-ks-endpoints.yaml 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Licensed under the Apache License, Version 2.0 (the "License");
  2. # you may not use this file except in compliance with the License.
  3. # You may obtain a copy of the License at
  4. #
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. #
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. {{- if .Values.manifests.job_ks_endpoints }}
  13. {{- $envAll := . }}
  14. {{- $dependencies := .Values.dependencies.ks_endpoints }}
  15. {{- $serviceAccountName := "deckhand-ks-endpoints" }}
  16. {{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
  17. ---
  18. apiVersion: batch/v1
  19. kind: Job
  20. metadata:
  21. name: deckhand-ks-endpoints
  22. spec:
  23. template:
  24. metadata:
  25. labels:
  26. {{ tuple $envAll "deckhand" "ks-endpoints" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
  27. spec:
  28. serviceAccountName: {{ $serviceAccountName }}
  29. restartPolicy: OnFailure
  30. nodeSelector:
  31. {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
  32. initContainers:
  33. {{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
  34. containers:
  35. {{- range $key1, $osServiceType := tuple "deckhand" }}
  36. {{- range $key2, $osServiceEndPoint := tuple "admin" "internal" "public" }}
  37. - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }}
  38. image: {{ $envAll.Values.images.tags.ks_endpoints }}
  39. imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
  40. {{ tuple $envAll $envAll.Values.pod.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
  41. command:
  42. - /tmp/ks-endpoints.sh
  43. volumeMounts:
  44. - name: ks-endpoints-sh
  45. mountPath: /tmp/ks-endpoints.sh
  46. subPath: ks-endpoints.sh
  47. readOnly: true
  48. env:
  49. {{- with $env := dict "ksUserSecret" $envAll.Values.secrets.identity.admin }}
  50. {{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }}
  51. {{- end }}
  52. - name: OS_SVC_ENDPOINT
  53. value: {{ $osServiceEndPoint }}
  54. - name: OS_SERVICE_NAME
  55. value: {{ tuple $osServiceType $envAll | include "helm-toolkit.endpoints.keystone_endpoint_name_lookup" }}
  56. - name: OS_SERVICE_TYPE
  57. value: {{ $osServiceType }}
  58. - name: OS_SERVICE_ENDPOINT
  59. value: {{ tuple $osServiceType $osServiceEndPoint "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}
  60. {{- end }}
  61. {{- end }}
  62. volumes:
  63. - name: ks-endpoints-sh
  64. configMap:
  65. name: deckhand-bin
  66. defaultMode: 0555
  67. {{- end -}}