heat-engine as Deployment or StatefulSet

heat-engine service can be now configured to be either Deployment or
StatefulSet.

Additionally this commit removes /var/cache/heat volume, as it's not
used by heat-engine or other heat services at all.

Change-Id: I541a1efc7817beb5f05d4cce216d9ea1cf378d7a
Co-Authored-By: Mateusz Blaszkowski <mateusz.blaszkowski@intel.com>
This commit is contained in:
Michał Dulko 2017-06-08 14:46:26 +02:00 committed by Mateusz Blaszkowski
parent 8273259416
commit f4f17b01b8
6 changed files with 38 additions and 22 deletions

View File

@ -17,5 +17,15 @@ limitations under the License.
*/}}
set -x
exec heat-engine \
--config-file /etc/heat/heat.conf
COMMAND="${@:-start}"
function start () {
exec heat-engine \
--config-file /etc/heat/heat.conf
}
function stop () {
kill -TERM 1
}
$COMMAND

View File

@ -66,8 +66,6 @@ spec:
volumeMounts:
- name: pod-etc-heat
mountPath: /etc/heat
- name: pod-var-cache-heat
mountPath: /var/cache/heat
- name: heat-bin
mountPath: /tmp/heat-api.sh
subPath: heat-api.sh
@ -88,8 +86,6 @@ spec:
volumes:
- name: pod-etc-heat
emptyDir: {}
- name: pod-var-cache-heat
emptyDir: {}
- name: heat-bin
configMap:
name: heat-bin

View File

@ -66,8 +66,6 @@ spec:
volumeMounts:
- name: pod-etc-heat
mountPath: /etc/heat
- name: pod-var-cache-heat
mountPath: /var/cache/heat
- name: heat-bin
mountPath: /tmp/heat-cfn.sh
subPath: heat-cfn.sh
@ -88,8 +86,6 @@ spec:
volumes:
- name: pod-etc-heat
emptyDir: {}
- name: pod-var-cache-heat
emptyDir: {}
- name: heat-bin
configMap:
name: heat-bin

View File

@ -66,8 +66,6 @@ spec:
volumeMounts:
- name: pod-etc-heat
mountPath: /etc/heat
- name: pod-var-cache-heat
mountPath: /var/cache/heat
- name: heat-bin
mountPath: /tmp/heat-cloudwatch.sh
subPath: heat-cloudwatch.sh
@ -88,8 +86,6 @@ spec:
volumes:
- name: pod-etc-heat
emptyDir: {}
- name: pod-var-cache-heat
emptyDir: {}
- name: heat-bin
configMap:
name: heat-bin

View File

@ -14,28 +14,40 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.statefulset_engine }}
{{- if or ( .Values.manifests.deployment_engine ) ( .Values.manifests.statefulset_engine ) }}
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.engine }}
{{- $mounts_heat_engine := .Values.pod.mounts.heat_engine.heat_engine }}
{{- $mounts_heat_engine_init := .Values.pod.mounts.heat_engine.init_container }}
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: heat-engine
{{- if .Values.manifests.deployment_engine }}
kind: Deployment
spec:
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
{{- else if .Values.manifests.statefulset_engine }}
kind: StatefulSet
spec:
serviceName: heat-engine
{{- end }}
replicas: {{ .Values.pod.replicas.engine }}
template:
metadata:
labels:
{{ tuple $envAll "heat" "engine" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
{{- if .Values.manifests.deployment_engine }}
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" }}
{{- end }}
spec:
affinity:
{{ tuple $envAll "heat" "engine" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
{{- tuple $envAll "heat" "engine" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.engine.timeout | default "30" }}
initContainers:
{{ tuple $envAll $dependencies $mounts_heat_engine_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:
@ -47,11 +59,16 @@ spec:
runAsUser: {{ .Values.pod.user.heat.uid }}
command:
- /tmp/heat-engine.sh
- start
lifecycle:
preStop:
exec:
command:
- /tmp/heat-engine.sh
- stop
volumeMounts:
- name: pod-etc-heat
mountPath: /etc/heat
- name: pod-var-cache-heat
mountPath: /var/cache/heat
- name: heat-bin
mountPath: /tmp/heat-engine.sh
subPath: heat-engine.sh
@ -68,8 +85,6 @@ spec:
volumes:
- name: pod-etc-heat
emptyDir: {}
- name: pod-var-cache-heat
emptyDir: {}
- name: heat-bin
configMap:
name: heat-bin

View File

@ -525,6 +525,8 @@ pod:
timeout: 30
cloudwatch:
timeout: 30
engine:
timeout: 30
resources:
enabled: false
api:
@ -626,6 +628,7 @@ manifests:
deployment_api: true
deployment_cfn: true
deployment_cloudwatch: true
deployment_engine: true
ingress_api: true
ingress_cfn: true
ingress_cloudwatch: true
@ -647,4 +650,4 @@ manifests:
service_ingress_api: true
service_ingress_cfn: true
service_ingress_cloudwatch: true
statefulset_engine: true
statefulset_engine: false