openstack-helm/cinder/templates/job-ks-service.yaml
maris-accenture 1e7203a523 #106 CPU and memory resources (#106)
* resource requests and limits for cinder, heat, nova
2017-01-30 16:22:51 -08:00

54 lines
2.0 KiB
YAML

{{- $envAll := . }}
{{- $ksAdminSecret := .Values.keystone.admin_secret | default "cinder-env-keystone-admin" }}
{{- $dependencies := .Values.dependencies.ks_service }}
apiVersion: batch/v1
kind: Job
metadata:
name: cinder-ks-service
spec:
template:
metadata:
annotations:
pod.beta.kubernetes.io/init-containers: '[
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
]'
spec:
restartPolicy: OnFailure
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
containers:
{{- range $key1, $osServiceType := tuple "volume" "volumev2" "volumev3" }}
- name: {{ $osServiceType }}-ks-service-registration
image: {{ $envAll.Values.images.ks_service }}
imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
{{- if $envAll.Values.resources.enabled }}
resources:
requests:
memory: {{ $envAll.Values.resources.cinder_ks_service.requests.memory | quote }}
cpu: {{ $envAll.Values.resources.cinder_ks_service.requests.cpu | quote }}
limits:
memory: {{ $envAll.Values.resources.cinder_ks_service.limits.memory | quote }}
cpu: {{ $envAll.Values.resources.cinder_ks_service.limits.cpu | quote }}
{{- end }}
command:
- bash
- /tmp/ks-service.sh
volumeMounts:
- name: ks-service-sh
mountPath: /tmp/ks-service.sh
subPath: ks-service.sh
readOnly: true
env:
{{- with $env := dict "ksUserSecret" $ksAdminSecret }}
{{- include "env_ks_openrc_tpl" $env | indent 12 }}
{{- end }}
- name: OS_SERVICE_NAME
value: {{ tuple $osServiceType $envAll | include "endpoint_name_lookup" }}
- name: OS_SERVICE_TYPE
value: {{ $osServiceType }}
{{- end }}
volumes:
- name: ks-service-sh
configMap:
name: cinder-bin