fix: various bugfixes for 1.21 cluster

This commit is contained in:
Stefan Reimer 2021-12-21 16:05:08 +01:00
parent 826b4d356e
commit 362fb2479d
10 changed files with 51 additions and 27 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: kubezero-addons name: kubezero-addons
description: KubeZero umbrella chart for various optional cluster addons description: KubeZero umbrella chart for various optional cluster addons
type: application type: application
version: 0.2.3 version: 0.2.4
home: https://kubezero.com home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png
keywords: keywords:

View File

@ -9,6 +9,7 @@ spec:
jobTemplate: jobTemplate:
spec: spec:
backoffLimit: 1 backoffLimit: 1
ttlSecondsAfterFinished: 3600
template: template:
spec: spec:
containers: containers:

View File

@ -18,9 +18,11 @@ aws-node-termination-handler:
managedAsgTag: "aws-node-termination-handler/managed" managedAsgTag: "aws-node-termination-handler/managed"
enableSqsTerminationDraining: true enableSqsTerminationDraining: true
enableProbesServer: true
deleteLocalData: true deleteLocalData: true
ignoreDaemonSets: true ignoreDaemonSets: true
taintNode: true taintNode: true
emitKubernetesEvents: true
# -- https://sqs.${AWS::Region}.amazonaws.com/${AWS::AccountId}/${ClusterName}_Nth # -- https://sqs.${AWS::Region}.amazonaws.com/${AWS::AccountId}/${ClusterName}_Nth
queueURL: "" queueURL: ""

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: kubezero-network name: kubezero-network
description: KubeZero umbrella chart for all things network description: KubeZero umbrella chart for all things network
type: application type: application
version: 0.1.0 version: 0.1.1
home: https://kubezero.com home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png
keywords: keywords:

View File

@ -113,6 +113,7 @@ spec:
args: args:
- "--multus-conf-file=auto" - "--multus-conf-file=auto"
- "--cni-version=0.3.1" - "--cni-version=0.3.1"
- "--cni-bin-dir=/host/usr/libexec/cni"
resources: resources:
requests: requests:
cpu: "100m" cpu: "100m"
@ -122,38 +123,28 @@ spec:
memory: "50Mi" memory: "50Mi"
securityContext: securityContext:
privileged: true privileged: true
capabilities:
add: ["SYS_ADMIN"]
volumeMounts: volumeMounts:
- name: run
mountPath: /run
- name: cni - name: cni
mountPath: /host/etc/cni/net.d mountPath: /host/etc/cni/net.d
- name: cnibin - name: cnibin
mountPath: /host/opt/cni/bin mountPath: /host/usr/libexec/cni
- name: multus-cfg - name: multus-cfg
mountPath: /tmp/multus-conf mountPath: /tmp/multus-conf
initContainers:
- name: install-multus-binary
image: ghcr.io/k8snetworkplumbingwg/multus-cni:{{ .Values.multus.tag }}
command:
- "cp"
- "/usr/src/multus-cni/bin/multus"
- "/host/opt/cni/bin/multus"
resources:
requests:
cpu: "10m"
memory: "15Mi"
securityContext:
privileged: true
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
mountPropagation: Bidirectional
terminationGracePeriodSeconds: 10 terminationGracePeriodSeconds: 10
volumes: volumes:
- name: run
hostPath:
path: /run
- name: cni - name: cni
hostPath: hostPath:
path: /etc/cni/net.d path: /etc/cni/net.d
- name: cnibin - name: cnibin
hostPath: hostPath:
path: /opt/cni/bin path: /usr/libexec/cni
- name: multus-cfg - name: multus-cfg
configMap: configMap:
name: multus-cni-config name: multus-cni-config

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: kubezero name: kubezero
description: KubeZero - Root App of Apps chart description: KubeZero - Root App of Apps chart
type: application type: application
version: 1.21.8-3 version: 1.21.8-4
home: https://kubezero.com home: https://kubezero.com
icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png
keywords: keywords:

View File

@ -8,6 +8,7 @@ clusterBackup:
{{- with index .Values "addons" "aws-node-termination-handler" }} {{- with index .Values "addons" "aws-node-termination-handler" }}
aws-node-termination-handler: aws-node-termination-handler:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
enablePrometheusServer: {{ .Values.metrics.enabled }}
{{- end }} {{- end }}
{{- with .Values.addons.fuseDevicePlugin }} {{- with .Values.addons.fuseDevicePlugin }}

View File

@ -8,7 +8,7 @@ HighAvailableControlplane: false
addons: addons:
enabled: false enabled: false
targetRevision: 0.2.3 targetRevision: 0.2.4
network: network:
enabled: false enabled: false

View File

@ -145,12 +145,12 @@ if [ "$1" == 'upgrade' ]; then
# network # network
yq eval '.network // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml yq eval '.network // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml
helm template kubezero/kubezero-network --version 0.1.0 --include-crds --namespace kube-system --name-template network \ helm template kubezero/kubezero-network --version 0.1.1 --include-crds --namespace kube-system --name-template network \
-f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG -f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG
# addons # addons
yq eval '.addons // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml yq eval '.addons // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml
helm template kubezero/kubezero-addons --version 0.2.2 --include-crds --namespace kube-system --name-template addons \ helm template kubezero/kubezero-addons --version 0.2.4 --include-crds --namespace kube-system --name-template addons \
-f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG -f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG
###################### ######################
@ -299,12 +299,12 @@ elif [[ "$1" =~ "^(bootstrap|recover|join)$" ]]; then
# network # network
yq eval '.network // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml yq eval '.network // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml
helm template kubezero/kubezero-network --version 0.1.0 --include-crds --namespace kube-system --name-template network \ helm template kubezero/kubezero-network --version 0.1.1 --include-crds --namespace kube-system --name-template network \
-f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG -f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG
# addons # addons
yq eval '.addons // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml yq eval '.addons // ""' ${HOSTFS}/etc/kubernetes/kubezero.yaml > _values.yaml
helm template kubezero/kubezero-addons --version 0.2.2 --include-crds --namespace kube-system --name-template addons \ helm template kubezero/kubezero-addons --version 0.2.4 --include-crds --namespace kube-system --name-template addons \
-f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG -f _values.yaml --kube-version $KUBE_VERSION | kubectl apply -f - $LOG
fi fi

View File

@ -0,0 +1,29 @@
#!/bin/bash -x
YAML=$1
# Convert keys
yq eval -i '
.spec.source.repoURL="https://cdn.zero-downtime.net/charts" |
.spec.source.targetRevision="1.21.8-4" |
del(.spec.source.helm.parameters)' $YAML
# Extract values
yq eval '.spec.source.helm.values' $1 > _values.yaml
# Remove kiam and calico from Argo
yq eval -i 'del(.calico) | del(.kiam)' _values.yaml
# Move storage into module
yq eval -i '.storage.enabled=true' _values.yaml
[ $(yq eval 'has(".aws-ebs-csi-driver")' _values.yaml) == "true" ] && yq eval -i '.storage.aws-ebs-csi-driver=.aws-ebs-csi-driver' _values.yaml
[ $(yq eval 'has(".aws-efs-csi-driver")' _values.yaml) == "true" ] && yq eval -i '.storage.aws-efs-csi-driver=.aws-efs-csi-driver' _values.yaml
# Finally remove old helm apps
yq eval -i 'del(.aws-ebs-csi-driver) | del(.aws-efs-csi-driver)' _values.yaml
# merge _values.yaml back
yq eval -i '.spec.source.helm.values |= strload("_values.yaml")' $YAML
rm -f _values.yaml