config/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/deployment.yaml

89 lines
3.8 KiB
YAML

{{/*
#
# Copyright (c) 2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
*/}}
{{- if .Values.manifests.deployment_api_proxy }}
{{- $envAll := . }}
{{- $mounts_nova_api_proxy := .Values.pod.mounts.nova_api_proxy.nova_api_proxy }}
{{- $mounts_nova_api_proxy_init := .Values.pod.mounts.nova_api_proxy.init_container }}
{{- $serviceAccountName := "nova-api-proxy" }}
{{ tuple $envAll "proxy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nova-api-proxy
labels:
{{ tuple $envAll "nova" "api-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
replicas: {{ .Values.pod.replicas.proxy }}
selector:
matchLabels:
{{ tuple $envAll "nova" "api-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "nova" "api-proxy" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
serviceAccountName: {{ $serviceAccountName }}
affinity:
{{ tuple $envAll "nova" "api-proxy" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
nodeSelector:
{{ .Values.labels.api_proxy.node_selector_key }}: {{ .Values.labels.api_proxy.node_selector_value }}
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api_proxy.timeout | default "30" }}
initContainers:
{{ tuple $envAll "api" $mounts_nova_api_proxy_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:
- name: nova-api-proxy
{{ tuple $envAll "nova_api_proxy" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.api_proxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
securityContext:
runAsUser: {{ .Values.pod.user.nova_api_proxy.uid }}
command:
- /tmp/nova-api-proxy.sh
ports:
- name: n-api
containerPort: {{ tuple "compute" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ tuple "compute" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: nova-api-proxy-bin
mountPath: /tmp/nova-api-proxy.sh
subPath: nova-api-proxy.sh
readOnly: true
- name: nova-api-proxy-etc
mountPath: /etc/proxy/nova-api-proxy.conf
subPath: nova-api-proxy.conf
readOnly: true
- name: nova-api-proxy-etc
mountPath: /etc/proxy/logging.conf
subPath: logging.conf
readOnly: true
- name: nova-api-proxy-etc
mountPath: /etc/proxy/api-proxy-paste.ini
subPath: api-proxy-paste.ini
readOnly: true
{{ if $mounts_nova_api_proxy.volumeMounts }}{{ toYaml $mounts_nova_api_proxy.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: nova-api-proxy-bin
configMap:
name: nova-api-proxy-bin
defaultMode: 0777
- name: nova-api-proxy-etc
configMap:
name: nova-api-proxy-etc
defaultMode: 0777
{{ if $mounts_nova_api_proxy.volumes}}{{ toYaml $mounts_nova_api_proxy.volumes | indent 8 }}{{ end }}
{{- end }}