Code Review
/
oom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[COMMON] Add missing labels for etcd, mongo, postgres
[oom.git]
/
kubernetes
/
common
/
etcd
/
templates
/
statefulset.yaml
diff --git
a/kubernetes/common/etcd/templates/statefulset.yaml
b/kubernetes/common/etcd/templates/statefulset.yaml
index
7190c5b
..
829e17b
100644
(file)
--- a/
kubernetes/common/etcd/templates/statefulset.yaml
+++ b/
kubernetes/common/etcd/templates/statefulset.yaml
@@
-1,3
+1,4
@@
+{{/*
# Copyright © 2019 Intel Corporation Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Copyright © 2019 Intel Corporation Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@
-11,25
+12,16
@@
# 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.
# 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.
-apiVersion: apps/v1beta1
+*/}}
+apiVersion: apps/v1
kind: StatefulSet
kind: StatefulSet
-metadata:
- name: {{ include "common.fullname" . }}
- labels:
- heritage: "{{ .Release.Service }}"
- release: "{{ .Release.Name }}"
- chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
- app: {{ include "common.name" . }}
+metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
spec:
spec:
- serviceName: {{ include "common.servicename" .}}
+ selector: {{- include "common.selectors" . | nindent 4 }}
+ serviceName: {{ include "common.servicename" . }}
replicas: {{ .Values.replicaCount }}
template:
replicas: {{ .Values.replicaCount }}
template:
- metadata:
- labels:
- heritage: "{{ .Release.Service }}"
- release: "{{ .Release.Name }}"
- chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
- app: {{ include "common.name" . }}
+ metadata: {{- include "common.templateMetadata" . | nindent 6 }}
spec:
{{- if .Values.affinity }}
affinity:
spec:
{{- if .Values.affinity }}
affinity:
@@
-43,9
+35,11
@@
spec:
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
+ imagePullSecrets:
+ - name: "{{ include "common.namespace" . }}-docker-registry-key"
containers:
containers:
- - name: {{ include "common.
full
name" . }}
- image:
"{{ .Values.repository }}/{{ .Values.image }}"
+ - name: {{ include "common.name" . }}
+ image:
{{ include "repositoryGenerator.googleK8sRepository" . }}/{{ .Values.image }}
imagePullPolicy: "{{ .Values.pullPolicy }}"
ports:
- containerPort: {{ .Values.service.peerInternalPort }}
imagePullPolicy: "{{ .Values.pullPolicy }}"
ports:
- containerPort: {{ .Values.service.peerInternalPort }}
@@
-60,15
+54,14
@@
spec:
periodSeconds: {{ .Values.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
{{ end -}}
periodSeconds: {{ .Values.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
{{ end -}}
- resources:
-{{ include "common.resources" . | indent 10 }}
+ resources: {{ include "common.resources" . | nindent 10 }}
env:
- name: INITIAL_CLUSTER_SIZE
value: {{ .Values.replicaCount | quote }}
- name: SET_NAME
value: {{ include "common.fullname" . }}
- name: SERVICE_NAME
env:
- name: INITIAL_CLUSTER_SIZE
value: {{ .Values.replicaCount | quote }}
- name: SET_NAME
value: {{ include "common.fullname" . }}
- name: SERVICE_NAME
- value: {{ include "common.servicename" . }}
+ value: {{ include "common.servicename" . }}
.{{ include "common.namespace" . }}.svc.{{ .Values.global.clusterName }}
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | indent 8 }}
{{- end }}
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | indent 8 }}
{{- end }}
@@
-128,6
+121,10
@@
spec:
# we should wait for other pods to be up before trying to join
# otherwise we got "no such host" errors when trying to resolve other members
for i in $(seq 0 $((${INITIAL_CLUSTER_SIZE} - 1))); do
# we should wait for other pods to be up before trying to join
# otherwise we got "no such host" errors when trying to resolve other members
for i in $(seq 0 $((${INITIAL_CLUSTER_SIZE} - 1))); do
+ if [ "${SET_NAME}-${i}" == "${HOSTNAME}" ]; then
+ echo "Skipping self-checking"
+ continue
+ fi
while true; do
echo "Waiting for ${SET_NAME}-${i}.${SERVICE_NAME} to come up"
ping -W 1 -c 1 ${SET_NAME}-${i}.${SERVICE_NAME} > /dev/null && break
while true; do
echo "Waiting for ${SET_NAME}-${i}.${SERVICE_NAME} to come up"
ping -W 1 -c 1 ${SET_NAME}-${i}.${SERVICE_NAME} > /dev/null && break
@@
-175,7
+172,7
@@
spec:
fi
cat /var/run/etcd/new_member_envs
fi
cat /var/run/etcd/new_member_envs
-
source
/var/run/etcd/new_member_envs
+
.
/var/run/etcd/new_member_envs
collect_member &
collect_member &
@@
-213,14
+210,19
@@
spec:
volumeClaimTemplates:
- metadata:
name: {{ include "common.fullname" . }}-data
volumeClaimTemplates:
- metadata:
name: {{ include "common.fullname" . }}-data
+ labels:
+ name: {{ include "common.fullname" . }}
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ release: "{{ include "common.release" . }}"
+ heritage: "{{ .Release.Service }}"
spec:
accessModes:
spec:
accessModes:
- - "{{ .Values.persistence.accessMode }}"
+ - "{{ .Values.persistence.accessMode }}"
+ storageClassName: {{ include "common.storageClass" . }}
resources:
requests:
# upstream recommended max is 700M
storage: "{{ .Values.persistence.storage }}"
resources:
requests:
# upstream recommended max is 700M
storage: "{{ .Values.persistence.storage }}"
- storageClassName: {{ include "common.fullname" . }}-data
{{- else }}
volumes:
- name: {{ include "common.fullname" . }}-data
{{- else }}
volumes:
- name: {{ include "common.fullname" . }}-data
@@
-231,4
+233,3
@@
spec:
emptyDir: {}
{{- end }}
{{- end }}
emptyDir: {}
{{- end }}
{{- end }}
-