|
| 1 | +{{- $etcd_scheme := EtcdScheme }} |
1 | 2 | kind: ConfigMap
|
2 | 3 | apiVersion: v1
|
3 | 4 | metadata:
|
4 | 5 | name: cilium-config
|
5 | 6 | namespace: kube-system
|
6 | 7 | data:
|
7 |
| - # This etcd-config contains the etcd endpoints of your cluster. If you use |
8 |
| - # TLS please make sure you uncomment the ca-file line and add the respective |
9 |
| - # certificate has a k8s secret, see explanation bellow in the comment labeled |
10 |
| - # "ETCD-CERT" |
11 | 8 | etcd-config: |-
|
12 | 9 | ---
|
13 | 10 | endpoints: [{{ $cluster := index .EtcdClusters 0 -}}
|
14 | 11 | {{- range $j, $member := $cluster.Members -}}
|
15 | 12 | {{- if $j }},{{ end -}}
|
16 |
| - "http://etcd-{{ $member.Name }}.internal.{{ ClusterName }}:4001" |
| 13 | + "{{ $etcd_scheme }}://etcd-{{ $member.Name }}.internal.{{ ClusterName }}:4001" |
17 | 14 | {{- end }}]
|
18 |
| - # |
19 |
| - # In case you want to use TLS in etcd, uncomment the following line |
20 |
| - # and add the certificate as explained in the comment labeled "ETCD-CERT" |
21 |
| - #ca-file: '/var/lib/etcd-secrets/etcd-ca' |
22 |
| - # |
23 |
| - # In case you want client to server authentication, uncomment the following |
24 |
| - # lines and add the certificate and key in cilium-etcd-secrets bellow |
25 |
| - #key-file: '/var/lib/etcd-secrets/etcd-client-key' |
26 |
| - #cert-file: '/var/lib/etcd-secrets/etcd-client-crt' |
| 15 | + {{- if eq $etcd_scheme "https" }} |
| 16 | + ca-file: '/var/lib/etcd-secrets/ca.pem' |
| 17 | + key-file: '/var/lib/etcd-secrets/calico-client-key.pem' |
| 18 | + cert-file: '/var/lib/etcd-secrets/calico-client.pem' |
| 19 | + {{- end }} |
27 | 20 |
|
28 | 21 | # If you want to run cilium in debug mode change this value to true
|
29 | 22 | debug: "false"
|
|
32 | 25 | # If you want to clean cilium state; change this value to true
|
33 | 26 | clean-cilium-state: "false"
|
34 | 27 | ---
|
35 |
| -# The etcd secrets can be populated in kubernetes. |
36 |
| -# For more information see: https://kubernetes.io/docs/concepts/configuration/secret |
37 |
| -apiVersion: v1 |
38 |
| -kind: Secret |
39 |
| -type: Opaque |
40 |
| -metadata: |
41 |
| - name: cilium-etcd-secrets |
42 |
| - namespace: kube-system |
43 |
| -data: |
44 |
| - # ETCD-CERT: Each value should contain the whole certificate in base64, on a |
45 |
| - # single line. You can generate the base64 with: $ base64 -w 0 ./ca.pem |
46 |
| - # (the "-w 0" generates the output on a single line) |
47 |
| - etcd-ca: "" |
48 |
| - etcd-client-key: "" |
49 |
| - etcd-client-crt: "" |
50 |
| ---- |
51 | 28 | apiVersion: v1
|
52 | 29 | kind: ServiceAccount
|
53 | 30 | metadata:
|
@@ -365,9 +342,11 @@ spec:
|
365 | 342 | - name: etcd-config-path
|
366 | 343 | mountPath: /var/lib/etcd-config
|
367 | 344 | readOnly: true
|
| 345 | + {{- if eq $etcd_scheme "https" }} |
368 | 346 | - name: etcd-secrets
|
369 | 347 | mountPath: /var/lib/etcd-secrets
|
370 | 348 | readOnly: true
|
| 349 | + {{- end }} |
371 | 350 | securityContext:
|
372 | 351 | capabilities:
|
373 | 352 | add:
|
@@ -402,10 +381,11 @@ spec:
|
402 | 381 | items:
|
403 | 382 | - key: etcd-config
|
404 | 383 | path: etcd.config
|
405 |
| - # To read the k8s etcd secrets in case the user might want to use TLS |
| 384 | + {{- if eq $etcd_scheme "https" }} |
406 | 385 | - name: etcd-secrets
|
407 |
| - secret: |
408 |
| - secretName: cilium-etcd-secrets |
| 386 | + hostPath: |
| 387 | + path: /srv/kubernetes/calico |
| 388 | + {{- end }} |
409 | 389 | tolerations:
|
410 | 390 | - effect: NoSchedule
|
411 | 391 | key: node-role.kubernetes.io/master
|
|
0 commit comments