Skip to content

Commit d71f723

Browse files
authored
Merge pull request #95 from luxas/distroless-etcd
Don't make use of /bin/sh in etcd images & update etcd version
2 parents a8454bb + 1f23fa0 commit d71f723

File tree

3 files changed

+63
-55
lines changed

3 files changed

+63
-55
lines changed

charts/kcp/templates/etcd-statefulset.yaml

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,37 @@ spec:
4242
- name: etcd
4343
image: {{ .Values.etcd.image }}:{{ .Values.etcd.tag }}
4444
command:
45-
- /bin/sh
46-
- -c
47-
- |
48-
PEERS="{{ include "etcd.fullname" . }}-0=https://{{ include "etcd.fullname" . }}-0.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-1=https://{{ include "etcd.fullname" . }}-1.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-2=https://{{ include "etcd.fullname" . }}-2.{{ include "etcd.fullname" . }}:2380"
49-
exec etcd --name ${HOSTNAME} \
50-
--listen-peer-urls https://0.0.0.0:2380 \
51-
--initial-advertise-peer-urls https://${HOSTNAME}:2380 \
52-
--listen-client-urls https://0.0.0.0:2379 \
53-
--advertise-client-urls https://${HOSTNAME}:2379 \
54-
--initial-cluster-token etcd-cluster-1 \
55-
--initial-cluster ${PEERS} \
56-
--initial-cluster-state new \
57-
--auto-compaction-mode=periodic \
58-
--auto-compaction-retention=5m \
59-
--data-dir /var/run/etcd/default.etcd \
60-
--peer-client-cert-auth=true \
61-
--peer-cert-file=/etc/etcd/tls/peer/tls.crt \
62-
--peer-key-file=/etc/etcd/tls/peer/tls.key \
63-
--peer-trusted-ca-file=/etc/etcd/tls/peer-ca/tls.crt \
64-
--client-cert-auth=true \
65-
--cert-file=/etc/etcd/tls/server/tls.crt \
66-
--key-file=/etc/etcd/tls/server/tls.key \
67-
--trusted-ca-file=/etc/etcd/tls/client-ca/tls.crt \
68-
{{- if .Values.etcd.profiling.enabled }}
69-
--enable-pprof=true \
70-
{{- end }}
71-
--snapshot-count=5000
45+
- etcd
46+
- --name=$(HOSTNAME)
47+
- --listen-peer-urls=https://0.0.0.0:2380
48+
- --initial-advertise-peer-urls=https://$(HOSTNAME):2380
49+
- --listen-client-urls=https://0.0.0.0:2379
50+
- --advertise-client-urls=https://$(HOSTNAME):2379
51+
- --initial-cluster-token=etcd-cluster-1
52+
- --initial-cluster=$(PEERS)
53+
- --initial-cluster-state=new
54+
- --auto-compaction-mode=periodic
55+
- --auto-compaction-retention=5m
56+
- --data-dir=/var/run/etcd/default.etcd
57+
- --peer-client-cert-auth=true
58+
- --peer-cert-file=/etc/etcd/tls/peer/tls.crt
59+
- --peer-key-file=/etc/etcd/tls/peer/tls.key
60+
- --peer-trusted-ca-file=/etc/etcd/tls/peer-ca/tls.crt
61+
- --client-cert-auth=true
62+
- --cert-file=/etc/etcd/tls/server/tls.crt
63+
- --key-file=/etc/etcd/tls/server/tls.key
64+
- --trusted-ca-file=/etc/etcd/tls/client-ca/tls.crt
65+
{{- if .Values.etcd.profiling.enabled }}
66+
- --enable-pprof=true
67+
{{- end }}
68+
- --snapshot-count=5000
69+
env:
70+
- name: PEERS
71+
value: "{{ include "etcd.fullname" . }}-0=https://{{ include "etcd.fullname" . }}-0.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-1=https://{{ include "etcd.fullname" . }}-1.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-2=https://{{ include "etcd.fullname" . }}-2.{{ include "etcd.fullname" . }}:2380"
72+
- name: HOSTNAME
73+
valueFrom:
74+
fieldRef:
75+
fieldPath: metadata.name
7276
ports:
7377
- containerPort: 2379
7478
name: client

charts/kcp/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ externalPort: "" # defaults to 8443 for .Values.kcpFrontProxy.service.type "Load
33
etcd:
44
enabled: true
55
image: quay.io/coreos/etcd
6-
tag: v3.5.4
6+
tag: v3.5.15
77
resources:
88
requests:
99
cpu: 500m

charts/shard/templates/etcd-statefulset.yaml

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,37 @@ spec:
4242
- name: etcd
4343
image: {{ .Values.etcd.image }}:{{ .Values.etcd.tag }}
4444
command:
45-
- /bin/sh
46-
- -c
47-
- |
48-
PEERS="{{ include "etcd.fullname" . }}-0=https://{{ include "etcd.fullname" . }}-0.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-1=https://{{ include "etcd.fullname" . }}-1.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-2=https://{{ include "etcd.fullname" . }}-2.{{ include "etcd.fullname" . }}:2380"
49-
exec etcd --name ${HOSTNAME} \
50-
--listen-peer-urls https://0.0.0.0:2380 \
51-
--initial-advertise-peer-urls https://${HOSTNAME}:2380 \
52-
--listen-client-urls https://0.0.0.0:2379 \
53-
--advertise-client-urls https://${HOSTNAME}:2379 \
54-
--initial-cluster-token etcd-cluster-1 \
55-
--initial-cluster ${PEERS} \
56-
--initial-cluster-state new \
57-
--auto-compaction-mode=periodic \
58-
--auto-compaction-retention=5m \
59-
--data-dir /var/run/etcd/default.etcd \
60-
--peer-client-cert-auth=true \
61-
--peer-cert-file=/etc/etcd/tls/peer/tls.crt \
62-
--peer-key-file=/etc/etcd/tls/peer/tls.key \
63-
--peer-trusted-ca-file=/etc/etcd/tls/peer-ca/tls.crt \
64-
--client-cert-auth=true \
65-
--cert-file=/etc/etcd/tls/server/tls.crt \
66-
--key-file=/etc/etcd/tls/server/tls.key \
67-
--trusted-ca-file=/etc/etcd/tls/client-ca/tls.crt \
68-
{{- if .Values.etcd.profiling.enabled }}
69-
--enable-pprof=true \
70-
{{- end }}
71-
--snapshot-count=5000
45+
- etcd
46+
- --name=$(HOSTNAME)
47+
- --listen-peer-urls=https://0.0.0.0:2380
48+
- --initial-advertise-peer-urls=https://$(HOSTNAME):2380
49+
- --listen-client-urls=https://0.0.0.0:2379
50+
- --advertise-client-urls=https://$(HOSTNAME):2379
51+
- --initial-cluster-token=etcd-cluster-1
52+
- --initial-cluster=$(PEERS)
53+
- --initial-cluster-state=new
54+
- --auto-compaction-mode=periodic
55+
- --auto-compaction-retention=5m
56+
- --data-dir=/var/run/etcd/default.etcd
57+
- --peer-client-cert-auth=true
58+
- --peer-cert-file=/etc/etcd/tls/peer/tls.crt
59+
- --peer-key-file=/etc/etcd/tls/peer/tls.key
60+
- --peer-trusted-ca-file=/etc/etcd/tls/peer-ca/tls.crt
61+
- --client-cert-auth=true
62+
- --cert-file=/etc/etcd/tls/server/tls.crt
63+
- --key-file=/etc/etcd/tls/server/tls.key
64+
- --trusted-ca-file=/etc/etcd/tls/client-ca/tls.crt
65+
{{- if .Values.etcd.profiling.enabled }}
66+
- --enable-pprof=true
67+
{{- end }}
68+
- --snapshot-count=5000
69+
env:
70+
- name: PEERS
71+
value: "{{ include "etcd.fullname" . }}-0=https://{{ include "etcd.fullname" . }}-0.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-1=https://{{ include "etcd.fullname" . }}-1.{{ include "etcd.fullname" . }}:2380,{{ include "etcd.fullname" . }}-2=https://{{ include "etcd.fullname" . }}-2.{{ include "etcd.fullname" . }}:2380"
72+
- name: HOSTNAME
73+
valueFrom:
74+
fieldRef:
75+
fieldPath: metadata.name
7276
ports:
7377
- containerPort: 2379
7478
name: client

0 commit comments

Comments
 (0)