Senlin: fix chart

This ps updates the senlin chart to operate.

Change-Id: I7f15bcf1c4c36688d1979026f992938335467baa
This commit is contained in:
Pete Birley 2018-05-03 16:42:20 -05:00
parent de72d74ae6
commit 73f89ba970
8 changed files with 169 additions and 10 deletions

View File

@ -0,0 +1,21 @@
#!/bin/bash
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -ex
senlin-manage service clean

View File

@ -16,6 +16,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
set -x set -ex
exec senlin-engine \ exec senlin-engine \
--config-file /etc/senlin/senlin.conf --config-file /etc/senlin/senlin.conf

View File

@ -42,6 +42,8 @@ data:
{{ tuple "bin/_senlin-api.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/_senlin-api.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
senlin-engine.sh: | senlin-engine.sh: |
{{ tuple "bin/_senlin-engine.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/_senlin-engine.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
senlin-engine-cleaner.sh: |
{{ tuple "bin/_senlin-engine-cleaner.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
rabbit-init.sh: | rabbit-init.sh: |
{{- include "helm-toolkit.scripts.rabbit_init" . | indent 4 }} {{- include "helm-toolkit.scripts.rabbit_init" . | indent 4 }}
{{- end }} {{- end }}

View File

@ -64,6 +64,25 @@ limitations under the License.
{{- tuple "clustering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.senlin.senlin_api "bind_port" | quote | trunc 0 -}} {{- tuple "clustering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.senlin.senlin_api "bind_port" | quote | trunc 0 -}}
{{- end -}} {{- end -}}
{{- if empty .Values.conf.senlin.authentication.auth_url -}}
{{- tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.senlin.authentication "auth_url" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.senlin.authentication.service_password -}}
{{- set .Values.conf.senlin.authentication "service_password" .Values.endpoints.identity.auth.senlin.password | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.senlin.authentication.service_project_domain -}}
{{- set .Values.conf.senlin.authentication "service_project_domain" .Values.endpoints.identity.auth.senlin.project_domain_name | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.senlin.authentication.service_project_name -}}
{{- set .Values.conf.senlin.authentication "service_project_name" .Values.endpoints.identity.auth.senlin.project_name | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.senlin.authentication.service_user_domain -}}
{{- set .Values.conf.senlin.authentication "service_user_domain" .Values.endpoints.identity.auth.senlin.user_domain_name | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.senlin.authentication.service_username -}}
{{- set .Values.conf.senlin.authentication "service_username" .Values.endpoints.identity.auth.senlin.username | quote | trunc 0 -}}
{{- end -}}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap

View File

@ -0,0 +1,83 @@
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.cron_job_engine_cleaner }}
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.static.engine_cleaner }}
{{- $mounts_senlin_engine_cleaner := .Values.pod.mounts.senlin_engine_cleaner.senlin_engine_cleaner }}
{{- $mounts_senlin_engine_cleaner_init := .Values.pod.mounts.senlin_engine_cleaner.init_container }}
{{- $serviceAccountName := "senlin-engine-cleaner" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: senlin-engine-cleaner
spec:
schedule: {{ .Values.jobs.engine_cleaner.cron | quote }}
successfulJobsHistoryLimit: {{ .Values.jobs.engine_cleaner.history.success }}
failedJobsHistoryLimit: {{ .Values.jobs.engine_cleaner.history.failed }}
concurrencyPolicy: Forbid
jobTemplate:
metadata:
labels:
{{ tuple $envAll "senlin" "engine-cleaner" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec:
template:
metadata:
labels:
{{ tuple $envAll "senlin" "engine-cleaner" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 12 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
restartPolicy: OnFailure
nodeSelector:
{{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
initContainers:
{{ tuple $envAll $dependencies $mounts_senlin_engine_cleaner_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 12 }}
containers:
- name: senlin-engine-cleaner
image: {{ .Values.images.tags.senlin_engine_cleaner }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.engine_cleaner | include "helm-toolkit.snippets.kubernetes_resources" | indent 14 }}
command:
- /tmp/senlin-engine-cleaner.sh
volumeMounts:
- name: senlin-bin
mountPath: /tmp/senlin-engine-cleaner.sh
subPath: senlin-engine-cleaner.sh
readOnly: true
- name: etcsenlin
mountPath: /etc/senlin
- name: senlin-etc
mountPath: /etc/senlin/senlin.conf
subPath: senlin.conf
readOnly: true
{{ if $mounts_senlin_engine_cleaner.volumeMounts }}{{ toYaml $mounts_senlin_engine_cleaner.volumeMounts | indent 14 }}{{ end }}
volumes:
- name: etcsenlin
emptyDir: {}
- name: senlin-etc
configMap:
name: senlin-etc
defaultMode: 0444
- name: senlin-bin
configMap:
name: senlin-bin
defaultMode: 0555
{{ if $mounts_senlin_engine_cleaner.volumes }}{{ toYaml $mounts_senlin_engine_cleaner.volumes | indent 10 }}{{ end }}
{{- end }}

View File

@ -67,8 +67,12 @@ spec:
- name: s-api - name: s-api
containerPort: {{ tuple "clustering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} containerPort: {{ tuple "clustering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe: readinessProbe:
tcpSocket: httpGet:
scheme: HTTP
path: /
port: {{ tuple "clustering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} port: {{ tuple "clustering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 15
periodSeconds: 10
volumeMounts: volumeMounts:
- name: senlin-bin - name: senlin-bin
mountPath: /tmp/senlin-api.sh mountPath: /tmp/senlin-api.sh

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.statefulset_engine }} {{- if .Values.manifests.deployment_engine }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.static.engine }} {{- $dependencies := .Values.dependencies.static.engine }}
@ -25,16 +25,18 @@ limitations under the License.
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1beta1
kind: StatefulSet kind: Deployment
metadata: metadata:
name: senlin-engine name: senlin-engine
spec: spec:
serviceName: senlin-engine
replicas: {{ .Values.pod.replicas.engine }} replicas: {{ .Values.pod.replicas.engine }}
template: template:
metadata: metadata:
labels: labels:
{{ tuple $envAll "senlin" "engine" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} {{ tuple $envAll "senlin" "engine" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
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" }}
spec: spec:
serviceAccountName: {{ $serviceAccountName }} serviceAccountName: {{ $serviceAccountName }}
affinity: affinity:
@ -59,8 +61,6 @@ spec:
readOnly: true readOnly: true
- name: pod-etc-senlin - name: pod-etc-senlin
mountPath: /etc/senlin mountPath: /etc/senlin
- name: pod-var-cache-senlin
mountPath: /var/cache/senlin
- name: senlin-etc - name: senlin-etc
mountPath: /etc/senlin/senlin.conf mountPath: /etc/senlin/senlin.conf
subPath: senlin.conf subPath: senlin.conf
@ -73,8 +73,6 @@ spec:
volumes: volumes:
- name: pod-etc-senlin - name: pod-etc-senlin
emptyDir: {} emptyDir: {}
- name: pod-var-cache-senlin
emptyDir: {}
- name: senlin-bin - name: senlin-bin
configMap: configMap:
name: senlin-bin name: senlin-bin

View File

@ -42,9 +42,17 @@ images:
ks_endpoints: docker.io/openstackhelm/heat:newton ks_endpoints: docker.io/openstackhelm/heat:newton
senlin_api: docker.io/openstackhelm/senlin:newton senlin_api: docker.io/openstackhelm/senlin:newton
senlin_engine: docker.io/openstackhelm/senlin:newton senlin_engine: docker.io/openstackhelm/senlin:newton
senlin_engine_cleaner: docker.io/openstackhelm/senlin:newton
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1 dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
pull_policy: "IfNotPresent" pull_policy: "IfNotPresent"
jobs:
engine_cleaner:
cron: "*/5 * * * *"
history:
success: 3
failed: 1
conf: conf:
paste: paste:
pipeline:senlin-api: pipeline:senlin-api:
@ -123,8 +131,11 @@ conf:
senlin: senlin:
DEFAULT: DEFAULT:
transport_url: null transport_url: null
host: senlin
database: database:
max_retries: -1 max_retries: -1
authentication:
auth_url: null
keystone_authtoken: keystone_authtoken:
auth_type: password auth_type: password
auth_version: v3 auth_version: v3
@ -155,6 +166,16 @@ bootstrap:
dependencies: dependencies:
static: static:
engine_cleaner:
jobs:
- senlin-db-sync
services:
- endpoint: internal
service: oslo_db
- endpoint: internal
service: oslo_messaging
- endpoint: internal
service: identity
api: api:
jobs: jobs:
- senlin-db-sync - senlin-db-sync
@ -349,6 +370,9 @@ pod:
senlin_bootstrap: senlin_bootstrap:
init_container: null init_container: null
senlin_bootstrap: senlin_bootstrap:
senlin_engine_cleaner:
init_container: null
senlin_engine_cleaner:
replicas: replicas:
api: 1 api: 1
engine: 1 engine: 1
@ -446,11 +470,20 @@ pod:
limits: limits:
memory: "1024Mi" memory: "1024Mi"
cpu: "2000m" cpu: "2000m"
engine_cleaner:
requests:
memory: "124Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
manifests: manifests:
configmap_bin: true configmap_bin: true
configmap_etc: true configmap_etc: true
cron_job_engine_cleaner: true
deployment_api: true deployment_api: true
deployment_engine: true
ingress_api: true ingress_api: true
job_bootstrap: true job_bootstrap: true
job_db_init: true job_db_init: true
@ -466,4 +499,3 @@ manifests:
secret_rabbitmq: true secret_rabbitmq: true
service_ingress_api: true service_ingress_api: true
service_api: true service_api: true
statefulset_engine: true