# Copyright 2017 The Openstack-Helm Authors. # # 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. {{- if .Values.manifests.deployment_shipyard }} {{- $envAll := . }} {{- $dependencies := .Values.dependencies.shipyard }} {{- $mounts_shipyard := .Values.pod.mounts.shipyard.shipyard }} {{- $mounts_shipyard_init := .Values.pod.mounts.shipyard.init_container }} --- apiVersion: apps/v1beta1 kind: Deployment metadata: name: shipyard spec: replicas: {{ .Values.pod.replicas.shipyard }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} template: metadata: labels: {{ tuple $envAll "shipyard-api" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} annotations: configmap-bin-hash: {{ tuple "configmap-shipyard-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-shipyard-etc.yaml" . | include "helm-toolkit.utils.hash" }} spec: nodeSelector: {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.shipyard.timeout | default "30" }} restartPolicy: Always initContainers: {{ tuple $envAll $dependencies $mounts_shipyard_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: shipyard image: {{ .Values.images.shipyard }} imagePullPolicy: {{ .Values.images.pull_policy }} {{ tuple $envAll $envAll.Values.pod.resources.shipyard_api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} ports: - containerPort: {{ .Values.network.shipyard.port }} readinessProbe: tcpSocket: port: {{ .Values.network.shipyard.port }} volumeMounts: - name: etc-shipyard mountPath: /etc/shipyard - name: shipyard-etc mountPath: /etc/shipyard/shipyard.conf subPath: shipyard.conf readOnly: true - name: shipyard-etc subPath: api-paste.ini mountPath: /etc/shipyard/api-paste.ini readOnly: true - name: shipyard-etc subPath: policy.yaml mountPath: /etc/shipyard/policy.yaml readOnly: true {{ if $mounts_shipyard.volumeMounts }}{{ toYaml $mounts_shipyard.volumeMounts | indent 12 }}{{ end }} volumes: - name: etc-shipyard emptyDir: {} - name: shipyard-etc configMap: name: shipyard-etc defaultMode: 0444 {{ if $mounts_shipyard.volumes }}{{ toYaml $mounts_shipyard.volumes | indent 8 }}{{ end }} {{- end }}