30 lines
889 B
YAML
30 lines
889 B
YAML
{{- define "cluster-addons.cni-calico.config" -}}
|
|
{{- include "cluster-addons.job.defaults" (list . "cni-calico") }}
|
|
installType: helm
|
|
helm: {{ omit .Values.cni.calico "installation" | toYaml | nindent 2 }}
|
|
extraFiles:
|
|
installation.yaml: |
|
|
apiVersion: operator.tigera.io/v1
|
|
kind: Installation
|
|
metadata:
|
|
name: default
|
|
spec: {{ toYaml .Values.cni.calico.installation | nindent 6 }}
|
|
hooks:
|
|
postInstall: |
|
|
KUBEADM_POD_CIDR="$(
|
|
kubectl -n kube-system get configmap kubeadm-config -o jsonpath='{.data.ClusterConfiguration}' | \
|
|
yq '.networking.podSubnet'
|
|
)"
|
|
sed "s#__KUBEADM_POD_CIDR__#${KUBEADM_POD_CIDR}#" installation.yaml | kubectl apply -f -
|
|
preDelete: |
|
|
kubectl delete installations.operator.tigera.io default || true
|
|
{{- end }}
|
|
|
|
{{-
|
|
include "addon.job" (list
|
|
.
|
|
"cni-calico"
|
|
"cluster-addons.cni-calico.config"
|
|
)
|
|
}}
|