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.

deployment.yaml 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {{/*
  2. # Copyright 2017 The Openstack-Helm Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. */}}
  16. {{- if .Values.manifests.deployment }}
  17. {{- $envAll := . }}
  18. {{- $mounts_deckhand := .Values.pod.mounts.deckhand.deckhand }}
  19. {{- $mounts_deckhand_init := .Values.pod.mounts.deckhand.init_container }}
  20. {{- $serviceAccountName := "deckhand" }}
  21. {{ tuple $envAll "deckhand" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
  22. ---
  23. apiVersion: apps/v1beta1
  24. kind: Deployment
  25. metadata:
  26. name: deckhand-api
  27. spec:
  28. replicas: {{ .Values.pod.replicas.deckhand }}
  29. {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
  30. template:
  31. metadata:
  32. labels:
  33. {{ tuple $envAll "deckhand" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
  34. annotations:
  35. configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
  36. configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
  37. spec:
  38. serviceAccountName: {{ $serviceAccountName }}
  39. nodeSelector:
  40. {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }}
  41. terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.deckhand.timeout | default "30" }}
  42. restartPolicy: Always
  43. initContainers:
  44. {{ tuple $envAll "deckhand" $mounts_deckhand_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
  45. containers:
  46. - name: deckhand-api
  47. env:
  48. - name: 'DECKHAND_API_TIMEOUT'
  49. value: {{ .Values.conf.uwsgi.timeout | default 600 | quote }}
  50. # NOTE(fmontei): Deckhand's database is not configured to work with
  51. # multiprocessing. Currently there is a data race on acquiring shared
  52. # SQLAlchemy engine pooled connection strings when workers > 1. As a
  53. # workaround, we use multiple threads but only 1 worker. For more
  54. # information, see: https://github.com/att-comdev/deckhand/issues/20
  55. - name: 'DECKHAND_API_WORKERS'
  56. value: {{ .Values.conf.uwsgi.workers | default 1 | quote }}
  57. - name: 'DECKHAND_API_THREADS'
  58. value: {{ .Values.conf.uwsgi.threads | default 4 | quote }}
  59. image: {{ .Values.images.tags.deckhand }}
  60. imagePullPolicy: {{ .Values.images.pull_policy }}
  61. {{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
  62. ports:
  63. - containerPort: {{ tuple "deckhand" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
  64. readinessProbe:
  65. httpGet:
  66. scheme: HTTP
  67. path: /api/v1.0/health
  68. port: {{ tuple "deckhand" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
  69. initialDelaySeconds: 15
  70. periodSeconds: 20
  71. timeoutSeconds: 10
  72. volumeMounts:
  73. - name: etc-deckhand
  74. mountPath: /etc/deckhand
  75. - name: deckhand-etc
  76. mountPath: /etc/deckhand/deckhand.conf
  77. subPath: deckhand.conf
  78. readOnly: true
  79. - name: deckhand-etc
  80. mountPath: /etc/deckhand/logging.conf
  81. subPath: logging.conf
  82. readOnly: true
  83. - name: deckhand-etc
  84. mountPath: /etc/deckhand/deckhand-paste.ini
  85. subPath: deckhand-paste.ini
  86. readOnly: true
  87. - name: deckhand-etc
  88. mountPath: /etc/deckhand/policy.yaml
  89. subPath: policy.yaml
  90. readOnly: true
  91. {{ if .Values.conf.deckhand.DEFAULT.profiler }}
  92. - name: tmp-profiles
  93. mountPath: /tmp/profiles
  94. {{ end }}
  95. {{ if $mounts_deckhand.volumeMounts }}{{ toYaml $mounts_deckhand.volumeMounts | indent 12 }}{{ end }}
  96. volumes:
  97. {{ if .Values.conf.deckhand.DEFAULT.profiler }}
  98. - name: tmp-profiles
  99. emptyDir: {}
  100. {{ end }}
  101. - name: etc-deckhand
  102. emptyDir: {}
  103. - name: deckhand-etc
  104. configMap:
  105. name: deckhand-etc
  106. defaultMode: 0444
  107. {{ if $mounts_deckhand.volumes }}{{ toYaml $mounts_deckhand.volumes | indent 8 }}{{ end }}
  108. {{- end }}