Merge "Etcd: update chart to match current format"

This commit is contained in:
Zuul 2018-02-23 18:20:57 +00:00 committed by Gerrit Code Review
commit a5290c5e26
5 changed files with 103 additions and 22 deletions

View File

@ -0,0 +1,23 @@
#!/bin/sh
{{/*
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
exec etcd \
--listen-client-urls http://0.0.0.0:{{ tuple "etcd" "internal" "client" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} \
--advertise-client-urls {{ tuple "etcd" "internal" "client" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | trimSuffix "/" }}

View File

@ -0,0 +1,28 @@
{{/*
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.configmap_bin }}
{{- $envAll := . }}
{{- $configMapBinName := printf "%s-%s" $envAll.Release.Name "etcd-bin" }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $configMapBinName }}
data:
etcd.sh: |
{{ tuple "bin/_etcd.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}

View File

@ -12,16 +12,20 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
{{- if .Values.manifests.deployment }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.etcd }} {{- $dependencies := .Values.dependencies.etcd }}
{{- $serviceAccountName := "etcd" }} {{- $rcControllerName := printf "%s-%s" $envAll.Release.Name "etcd" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{- $configMapBinName := printf "%s-%s" $envAll.Release.Name "etcd-bin" }}
{{ tuple $envAll $dependencies $rcControllerName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
name: etcd name: {{ $rcControllerName | quote }}
spec: spec:
replicas: {{ .Values.pod.replicas.etcd }} replicas: {{ .Values.pod.replicas.etcd }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
@ -30,7 +34,7 @@ spec:
labels: labels:
{{ tuple $envAll "etcd" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} {{ tuple $envAll "etcd" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec: spec:
serviceAccountName: {{ $serviceAccountName }} serviceAccountName: {{ $rcControllerName | quote }}
affinity: affinity:
{{ tuple $envAll "etcd" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} {{ tuple $envAll "etcd" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
nodeSelector: nodeSelector:
@ -42,13 +46,20 @@ spec:
image: {{ .Values.images.tags.etcd }} image: {{ .Values.images.tags.etcd }}
imagePullPolicy: {{ .Values.images.pull_policy }} imagePullPolicy: {{ .Values.images.pull_policy }}
command: command:
- etcd - /tmp/etcd.sh
- --listen-client-urls
- http://0.0.0.0:{{ .Values.network.port }}
- --advertise-client-urls
- http://{{ .Values.network.host }}:{{ .Values.network.port }}
ports: ports:
- containerPort: {{ .Values.network.port }} - containerPort: {{ tuple "etcd" "internal" "client" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe: readinessProbe:
tcpSocket: tcpSocket:
port: {{ .Values.network.port }} port: {{ tuple "etcd" "internal" "client" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: etcd-bin
mountPath: /tmp/etcd.sh
subPath: etcd.sh
readOnly: true
volumes:
- name: etcd-bin
configMap:
name: {{ $configMapBinName | quote }}
defaultMode: 0555
{{- end }}

View File

@ -12,15 +12,17 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
{{- if .Values.manifests.service }}
{{- $envAll := . }} {{- $envAll := . }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ .Values.network.host }} name: {{ tuple "etcd" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec: spec:
sessionAffinity: ClientIP sessionAffinity: ClientIP
ports: ports:
- port: {{ .Values.network.port }} - port: {{ tuple "etcd" "internal" "client" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
selector: selector:
{{ tuple $envAll "etcd" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ tuple $envAll "etcd" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }}

View File

@ -28,21 +28,17 @@ labels:
node_selector_key: openstack-control-plane node_selector_key: openstack-control-plane
node_selector_value: enabled node_selector_value: enabled
network:
host: etcd
port: 2379
dependencies: dependencies:
etcd: etcd:
jobs: null jobs: null
pod: pod:
affinity: affinity:
anti: anti:
type: type:
default: preferredDuringSchedulingIgnoredDuringExecution default: preferredDuringSchedulingIgnoredDuringExecution
topologyKey: topologyKey:
default: kubernetes.io/hostname default: kubernetes.io/hostname
replicas: replicas:
etcd: 1 etcd: 1
lifecycle: lifecycle:
@ -53,3 +49,24 @@ pod:
rolling_update: rolling_update:
max_surge: 3 max_surge: 3
max_unavailable: 1 max_unavailable: 1
endpoints:
cluster_domain_suffix: cluster.local
etcd:
name: etcd
hosts:
default: etcd
host_fqdn_override:
default: null
path:
default: null
scheme:
default: 'http'
port:
client:
default: 2379
manifests:
configmap_bin: true
deployment: true
service: true