feat: run upgrade with -e, set argo app yaml file as parameter
This commit is contained in:
parent
7b33509107
commit
0297e91990
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash -e
|
||||
|
||||
if [ -n "$DEBUG" ]; then
|
||||
set -x
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
#VERSION="v1.23.10-3"
|
||||
VERSION="latest"
|
||||
VERSION="v1.23"
|
||||
#VERSION="latest"
|
||||
ARGO_APP=${1:-/tmp/new-kubezero-argoapp.yaml}
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
. $SCRIPT_DIR/libhelm.sh
|
||||
@ -143,5 +144,5 @@ argo_used && enable_argo
|
||||
# Final step is to commit the new argocd kubezero app
|
||||
kubectl get app kubezero -n argocd -o yaml | yq 'del(.status) | del(.metadata) | .metadata.name="kubezero" | .metadata.namespace="argocd"' | yq 'sort_keys(..) | .spec.source.helm.values |= (from_yaml | to_yaml)' > /tmp/new-kubezero-argoapp.yaml
|
||||
|
||||
echo "Please commit /tmp/new-kubezero-argoapp.yaml as the updated kubezero/application.yaml for your cluster!"
|
||||
echo "Please commit $ARGO_APP as the updated kubezero/application.yaml for your cluster."
|
||||
echo "Then head over to ArgoCD for this cluster and sync all KubeZero modules to apply remaining upgrades."
|
||||
|
@ -26,6 +26,8 @@ yq e '.addons |
|
||||
# extract network
|
||||
yq e '.network |
|
||||
.cilium.enabled = true |
|
||||
.calico.enabled = true |
|
||||
.multus.enabled = true |
|
||||
.multus.defaultNetworks = ["cilium"] |
|
||||
.cilium.cluster.name = strenv(CLUSTERNAME) |
|
||||
{"network": .}' ${HOSTFS}/etc/kubernetes/kubeadm-values.yaml > $WORKDIR/network-values.yaml
|
||||
@ -52,3 +54,6 @@ kubectl get application kubezero -n argocd -o yaml | \
|
||||
kubezero_chart_version=$(yq .version /charts/kubezero/Chart.yaml) \
|
||||
yq '.spec.source.helm.values |= load_str("/tmp/kubezero/kubezero-values.yaml") | .spec.source.targetRevision = strenv(kubezero_chart_version)' | \
|
||||
kubectl apply -f -
|
||||
|
||||
# finally remove annotation to allow argo to sync again
|
||||
kubectl patch app kubezero -n argocd --type json -p='[{"op": "remove", "path": "/metadata/annotations"}]'
|
||||
|
Loading…
Reference in New Issue
Block a user