Add support for daemonsets to the Kubernetes-Entrypoint init-container.
It also makes two other changes: * Moves the entrypoint container manifest snippet to its own file to reduce loading on the _funcs.tpl file * Changes dep-check-init-cont to dep_check_init_cont to match the formatting of other defines used in OpenStack Helm
This commit is contained in:
parent
ca1360c9f3
commit
1a13f9ba83
cinder/templates
deployment-api.yamldeployment-scheduler.yamldeployment-volume.yamljob-db-init.yamljob-db-sync.yamljob-ks-endpoints.yaml.yamljob-ks-service.yamljob-ks-user.yaml
common/templates
glance/templates
heat/templates
deployment-api.yamldeployment-cfn.yamldeployment-cloudwatch.yamljob-db-init.yamljob-db-sync.yamljob-ks-endpoints.yaml.yamljob-ks-service.yamljob-ks-user.yamlstatefulset-engine.yaml
horizon/templates
keystone/templates
nova/templates
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -10,7 +10,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -10,7 +10,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -11,7 +11,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -21,35 +21,3 @@
|
||||
{{- $wtf := $context.Template.Name | replace $last $name -}}
|
||||
{{- include $wtf $context | sha256sum | quote -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "dep-check-init-cont" -}}
|
||||
{{- $envAll := index . 0 -}}
|
||||
{{- $deps := index . 1 -}}
|
||||
{
|
||||
"name": "init",
|
||||
"image": {{ $envAll.Values.images.dep_check | quote }},
|
||||
"imagePullPolicy": {{ $envAll.Values.images.pull_policy | quote }},
|
||||
"env": [
|
||||
{
|
||||
"name": "NAMESPACE",
|
||||
"value": "{{ $envAll.Release.Namespace }}"
|
||||
},
|
||||
{
|
||||
"name": "INTERFACE_NAME",
|
||||
"value": "eth0"
|
||||
},
|
||||
{
|
||||
"name": "DEPENDENCY_SERVICE",
|
||||
"value": "{{ include "joinListWithColon" $deps.service }}"
|
||||
},
|
||||
{
|
||||
"name": "DEPENDENCY_JOBS",
|
||||
"value": "{{ include "joinListWithColon" $deps.jobs }}"
|
||||
},
|
||||
{
|
||||
"name": "COMMAND",
|
||||
"value": "echo done"
|
||||
}
|
||||
]
|
||||
}
|
||||
{{- end -}}
|
||||
|
49
common/templates/snippets/_k8s_init_dep_check.tpl
Normal file
49
common/templates/snippets/_k8s_init_dep_check.tpl
Normal file
@ -0,0 +1,49 @@
|
||||
{{- define "dep_check_init_cont" -}}
|
||||
{{- $envAll := index . 0 -}}
|
||||
{{- $deps := index . 1 -}}
|
||||
{
|
||||
"name": "init",
|
||||
"image": {{ $envAll.Values.images.dep_check | quote }},
|
||||
"imagePullPolicy": {{ $envAll.Values.images.pull_policy | quote }},
|
||||
"env": [
|
||||
{
|
||||
"name": "POD_NAME",
|
||||
"valueFrom": {
|
||||
"fieldRef": {
|
||||
"APIVersion": "v1",
|
||||
"fieldPath": "metadata.name"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "NAMESPACE",
|
||||
"valueFrom": {
|
||||
"fieldRef": {
|
||||
"APIVersion": "v1",
|
||||
"fieldPath": "metadata.namespace"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "INTERFACE_NAME",
|
||||
"value": "eth0"
|
||||
},
|
||||
{
|
||||
"name": "DEPENDENCY_SERVICE",
|
||||
"value": "{{ include "joinListWithColon" $deps.service }}"
|
||||
},
|
||||
{
|
||||
"name": "DEPENDENCY_JOBS",
|
||||
"value": "{{ include "joinListWithColon" $deps.jobs }}"
|
||||
},
|
||||
{
|
||||
"name": "DEPENDENCY_DAEMONSET",
|
||||
"value": "{{ include "joinListWithColon" $deps.daemonset }}"
|
||||
},
|
||||
{
|
||||
"name": "COMMAND",
|
||||
"value": "echo done"
|
||||
}
|
||||
]
|
||||
}
|
||||
{{- end -}}
|
@ -26,7 +26,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -18,7 +18,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -12,7 +12,7 @@ spec:
|
||||
app: heat-api
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -12,7 +12,7 @@ spec:
|
||||
app: heat-cfn
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -12,7 +12,7 @@ spec:
|
||||
app: heat-cloudwatch
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -10,7 +10,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -10,7 +10,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -14,7 +14,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -13,7 +13,7 @@ spec:
|
||||
app: heat-engine
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependecies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependecies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependecies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -13,7 +13,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -13,7 +13,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "hash" }}
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
nodeSelector:
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
@ -9,7 +9,7 @@ spec:
|
||||
metadata:
|
||||
annotations:
|
||||
pod.beta.kubernetes.io/init-containers: '[
|
||||
{{ tuple $envAll $dependencies | include "dep-check-init-cont" | indent 10 }}
|
||||
{{ tuple $envAll $dependencies | include "dep_check_init_cont" | indent 10 }}
|
||||
]'
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
|
Loading…
Reference in New Issue
Block a user