Skip to content

Commit 7d4d29e

Browse files
committed
helm: kvstoremesh with external etcd
have the option to use external etcd with kvstoremesh
1 parent df7a76e commit 7d4d29e

File tree

9 files changed

+23
-2
lines changed

9 files changed

+23
-2
lines changed

Documentation/helm-values.rst

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Documentation/network/clustermesh/clustermesh.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ Example install using the Cilium CLI:
147147
cilium install --set cluster.name=$CLUSTER1 --set cluster.id=1 --context $CLUSTER1
148148
cilium install --set cluster.name=$CLUSTER2 --set cluster.id=2 --context $CLUSTER2
149149
150+
.. note::
151+
152+
If you are planning on using external etcd with your cluster, you have to set the value of the Helm option ``clustermesh.kvstoremeshExternalKVStore``
153+
to ``true`` for the KVStoreMesh to run with the external etcd instead of creating a new etcd instance upon creation.
154+
150155
.. important::
151156

152157
If you change the cluster ID and/or cluster name in a cluster with running

install/kubernetes/cilium/README.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/kubernetes/cilium/templates/clustermesh-apiserver/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
securityContext:
4747
{{- toYaml . | nindent 8 }}
4848
{{- end }}
49+
{{- if not .Values.clustermesh.kvstoremeshExternalKVStore}}
4950
initContainers:
5051
- name: etcd-init
5152
image: {{ include "cilium.image" .Values.clustermesh.apiserver.image | quote }}
@@ -98,7 +99,9 @@ spec:
9899
resources:
99100
{{- toYaml . | nindent 10 }}
100101
{{- end }}
102+
{{- end }}
101103
containers:
104+
{{- if not .Values.clustermesh.kvstoremeshExternalKVStore}}
102105
- name: etcd
103106
# The clustermesh-apiserver container image includes an etcd binary.
104107
image: {{ include "cilium.image" .Values.clustermesh.apiserver.image | quote }}
@@ -260,6 +263,7 @@ spec:
260263
lifecycle:
261264
{{- toYaml . | nindent 10 }}
262265
{{- end }}
266+
{{- end }}
263267
{{- if .Values.clustermesh.apiserver.kvstoremesh.enabled }}
264268
- name: kvstoremesh
265269
image: {{ include "cilium.image" .Values.clustermesh.apiserver.image | quote }}

install/kubernetes/cilium/templates/clustermesh-config/clustermesh-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
{{- end }}
1212
data:
1313
{{- $kvstoremesh := and .Values.clustermesh.useAPIServer .Values.clustermesh.apiserver.kvstoremesh.enabled }}
14-
{{- $override := ternary (printf "https://clustermesh-apiserver.%s.svc:2379" .Release.Namespace) "" $kvstoremesh }}
14+
{{- $override := ternary (join "\n- " $.Values.etcd.endpoints) (ternary (printf "https://clustermesh-apiserver.%s.svc:2379" .Release.Namespace) "" $kvstoremesh) .Values.clustermesh.kvstoremeshExternalKVStore }}
1515
{{- range .Values.clustermesh.config.clusters }}
1616
{{ .name }}: {{ include "clustermesh-config-generate-etcd-cfg" (list . $.Values.clustermesh.config.domain $override) | b64enc }}
1717
{{- /* The parenthesis around .tls are required, since it can be null: https://stackoverflow.com/a/68807258 */}}

install/kubernetes/cilium/templates/validate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153

154154
{{/* validate clustermesh-apiserver */}}
155155
{{- if .Values.clustermesh.useAPIServer }}
156-
{{- if and (ne .Values.identityAllocationMode "crd") (ne .Values.identityAllocationMode "doublewrite-readkvstore") (ne .Values.identityAllocationMode "doublewrite-readcrd") }}
156+
{{- if and (ne .Values.identityAllocationMode "crd") (ne .Values.identityAllocationMode "doublewrite-readkvstore") (ne .Values.identityAllocationMode "doublewrite-readcrd") (not .Values.clustermesh.kvstoremeshExternalKVStore) }}
157157
{{ fail (printf "The clustermesh-apiserver cannot be enabled in combination with .Values.identityAllocationMode=%s. To establish a Cluster Mesh, directly configure the parameters to access the remote kvstore through .Values.clustermesh.config" .Values.identityAllocationMode ) }}
158158
{{- end }}
159159
{{- if .Values.disableEndpointCRD }}

install/kubernetes/cilium/values.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,9 @@
13891389
"enableMCSAPISupport": {
13901390
"type": "boolean"
13911391
},
1392+
"kvstoremeshExternalKVStore": {
1393+
"type": "boolean"
1394+
},
13921395
"maxConnectedClusters": {
13931396
"type": "integer"
13941397
},

install/kubernetes/cilium/values.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/kubernetes/cilium/values.yaml.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,8 @@ clustermesh:
29382938
# maximum allocatable cluster-local identities.
29392939
# Supported values are 255 and 511.
29402940
maxConnectedClusters: 255
2941+
# -- Use external KVStore for KVStoreMesh.
2942+
kvstoremeshExternalKVStore: false
29412943
# -- Enable the synchronization of Kubernetes EndpointSlices corresponding to
29422944
# the remote endpoints of appropriately-annotated global services through ClusterMesh
29432945
enableEndpointSliceSynchronization: false

0 commit comments

Comments
 (0)