90 lines
3.9 KiB
YAML
90 lines
3.9 KiB
YAML
{{- $searchPath := ":global.kolla.nova.compute-ironic.statefulset:global.kolla.nova.compute-ironic.all:global.kolla.nova.all:global.kolla.all" }}
|
|
{{- $resourceName := "nova-compute-ironic" }}
|
|
{{- $netHostTrue := false }}
|
|
{{- $podTypeBootstrap := false }}
|
|
{{- $serviceName := "nova" }}
|
|
{{- $serviceType := "compute-ironic" }}
|
|
{{- $privileged := false }}
|
|
{{- $c := dict "searchPath" $searchPath "Values" .Values }}
|
|
{{- $_ := set $c "contName" "nova-compute-ironic" }}
|
|
{{- $_ := set $c "imageName" "image_full" }}
|
|
{{- $_ := set $c "tagName" "image_tag" }}
|
|
{{- $imageFull := include "kolla_build_image_full" $c }}
|
|
{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $tunnelInterface := "eth0" }}
|
|
{{- $replicas := include "kolla_val_get_str" (dict "key" "replicas" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $elementName := .Values.element_name | default $resourceName }}
|
|
{{- with $env := dict "netHostTrue" $netHostTrue "podTypeBootstrap" $podTypeBootstrap "imageFull" $imageFull "resourceName" $resourceName "serviceName" $serviceName "serviceType" $serviceType "privileged" $privileged "Values" .Values "Release" .Release "searchPath" $searchPath }}
|
|
apiVersion: apps/v1beta1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ $elementName }}
|
|
spec:
|
|
serviceName: {{ $elementName }}
|
|
replicas: {{ $replicas }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
component: {{ $serviceName }}
|
|
system: {{ $elementName }}
|
|
annotations:
|
|
pod.beta.kubernetes.io/init-containers: '[
|
|
{{- include "common_dependency_container_multi" $env | indent 10 }}
|
|
{
|
|
"name": "initialize-nova-compute",
|
|
"image": {{ include "kolla_toolbox_image_full" . | quote }},
|
|
"imagePullPolicy": {{ $imagePullPolicy | quote }},
|
|
"command": [
|
|
"sh",
|
|
"-xec",
|
|
"cp -a /config/..data/* /ironic/;
|
|
IP=$(ip addr show dev {{ $tunnelInterface }} | grep -G ''inet '' | awk ''{print $2}'' | sed ''s@/.*@@'');
|
|
crudini --set /ironic/nova.conf DEFAULT my_ip $IP;
|
|
"],
|
|
"volumeMounts": [
|
|
{
|
|
"name": "kolla-logs",
|
|
"mountPath": "/var/log/kolla/"
|
|
},
|
|
{
|
|
"name": "nova-compute-ironic-config",
|
|
"mountPath": "/config/"
|
|
},
|
|
{
|
|
"name": "ironic-config",
|
|
"mountPath": "/ironic/"
|
|
}
|
|
]
|
|
}
|
|
]'
|
|
spec:
|
|
nodeSelector:
|
|
{{ $selectorKey }}: {{ $selectorValue | quote }}
|
|
containers:
|
|
- name: main
|
|
imagePullPolicy: {{ $imagePullPolicy | quote }}
|
|
image: "{{ $imageFull }}"
|
|
volumeMounts:
|
|
{{- include "common_volume_mounts" $env | indent 12 }}
|
|
- mountPath: {{ $containerConfigDirectory }}
|
|
name: ironic-config
|
|
- mountPath: /var/lib/ironic
|
|
name: nova-compute-ironic-persistent-storage
|
|
env:
|
|
{{- include "common_env_vars" $env | indent 12 }}
|
|
{{- include "common_containers" $env | indent 8 }}
|
|
volumes:
|
|
{{- include "common_volumes" $env | indent 8 }}
|
|
- name: nova-compute-ironic-config
|
|
configMap:
|
|
name: {{ $elementName }}
|
|
- name: nova-compute-ironic-persistent-storage
|
|
hostPath:
|
|
path: /var/lib/ironic
|
|
- name: ironic-config
|
|
emptyDir: {}
|
|
{{- end }}
|