69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
{{/*
|
|
#
|
|
# Copyright (c) 2019 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
*/}}
|
|
|
|
{{- if eq .Values.global.deployAs "StatefulSet" }}
|
|
{{- $mount := "/etc/openstack" }}
|
|
{{- $envAll := . }}
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ .Values.global.name }}
|
|
spec:
|
|
replicas: {{ .Values.global.replicas }}
|
|
serviceName: {{ .Values.global.name }}
|
|
podManagementPolicy: "Parallel"
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Values.global.name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ .Values.global.name }}
|
|
spec:
|
|
{{- if .Values.global.rbac }}
|
|
serviceAccountName: {{ .Values.rbac.serviceAccount }}
|
|
{{- end }}
|
|
affinity:
|
|
{{ tuple $envAll "openstack" "clients" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
|
volumes:
|
|
- name: config-volume-{{- .Values.global.name }}
|
|
configMap:
|
|
name: config-{{- .Values.global.name }}
|
|
containers:
|
|
- name: {{ .Values.global.name }}
|
|
image: {{ .Values.images.tags.openstackclients | quote }}
|
|
env:
|
|
- name: OS_CLOUD
|
|
value: {{ .Values.global.cloud_name }}
|
|
{{- if .Values.global.keep_running }}
|
|
command: ["/bin/bash"]
|
|
args: ["-c", "trap : TERM INT; sleep infinity & wait"]
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: config-volume-{{- .Values.global.name }}
|
|
mountPath: {{ $mount }}
|
|
{{- if .Values.volume.enabled }}
|
|
- name: staging-{{ .Values.global.name }}
|
|
mountPath: {{ .Values.volume.mount_path }}
|
|
{{- end }}
|
|
nodeSelector:
|
|
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
|
{{- if .Values.volume.enabled }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: staging-{{ .Values.global.name }}
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
resources:
|
|
requests:
|
|
storage: {{ .Values.volume.size }}
|
|
storageClassName: {{ .Values.volume.class_name }}
|
|
{{- end }}
|
|
{{- end }}
|