Fix migration to v0.37.0
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
parent
ded6a9fd69
commit
bb9db7fcaf
3 changed files with 6 additions and 9 deletions
|
|
@ -11,12 +11,10 @@ stringData:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if or .Values.cloudInit .Values.sshKeys }}
|
{{- if or .Values.cloudInit .Values.sshKeys }}
|
||||||
---
|
---
|
||||||
apiVersion: core.cozystack.io/v1alpha1
|
apiVersion: v1
|
||||||
kind: TenantSecret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "virtual-machine.fullname" . }}-cloud-init
|
name: {{ include "virtual-machine.fullname" . }}-cloud-init
|
||||||
labels:
|
|
||||||
apps.cozystack.io/virtual-machine: {{ .Release.Name }}
|
|
||||||
stringData:
|
stringData:
|
||||||
userdata: |
|
userdata: |
|
||||||
{{- if .Values.cloudInit }}
|
{{- if .Values.cloudInit }}
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ kubectl get hr -A -o go-template='{{ range .items }}{{ if .spec.suspend }}{{ .sp
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# TODO: Update all Cozystack managed charts to latest version
|
# Update all Cozystack managed charts to latest version
|
||||||
# kubectl get hr -A -l cozystack.io/ui=true --no-headers | awk '{print "kubectl patch helmrelease -n " $1 " " $2 " --type=merge -p '\''{\"spec\":{\"chart\":{\"spec\":{\"version\":\"*\"}}}}'\'' "}' | sh -x
|
kubectl get hr -A -l cozystack.io/ui=true --no-headers | awk '{print "kubectl patch helmrelease -n " $1 " " $2 " --type=merge -p '\''{\"spec\":{\"chart\":{\"spec\":{\"version\":\">= 0.0.0-0\"}}}}'\'' "}' | sh -x
|
||||||
|
|
||||||
# Reconcile platform chart
|
# Reconcile platform chart
|
||||||
trap 'exit' INT TERM
|
trap 'exit' INT TERM
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,9 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
kubectl delete ingresses.networking.k8s.io --all -n cozy-dashboard --ignore-not-found
|
kubectl delete ingresses.networking.k8s.io --all -n cozy-dashboard --ignore-not-found
|
||||||
kubectl delete cozystackresourcedefinitions --all-namespaces --all --ignore-not-found
|
|
||||||
kubectl delete crd cozystackresourcedefinitions.cozystack.io --ignore-not-found
|
kubectl delete crd cozystackresourcedefinitions.cozystack.io --ignore-not-found
|
||||||
|
|
||||||
timestamp=$(date --rfc-3339=ns)
|
timestamp=$(date --rfc-3339=ns || date)
|
||||||
# Make sure webhook is upgraded first, then run migration
|
# Make sure webhook is upgraded first, then run migration
|
||||||
cozypkg -C packages/system/cozystack-controller -n cozy-system reconcile cozystack-controller --force --with-source
|
cozypkg -C packages/system/cozystack-controller -n cozy-system reconcile cozystack-controller --force --with-source
|
||||||
kubectl wait hr/cozystack-controller -n cozy-system --timeout=4m --for=condition=ready || exit 1
|
kubectl wait hr/cozystack-controller -n cozy-system --timeout=4m --for=condition=ready || exit 1
|
||||||
|
|
@ -20,7 +19,7 @@ kubectl get namespace -o custom-columns=NAME:.metadata.name --no-headers |
|
||||||
kubectl annotate \
|
kubectl annotate \
|
||||||
pods,services,pvc,secrets,ingresses.networking.k8s.io,workloadmonitors.cozystack.io \
|
pods,services,pvc,secrets,ingresses.networking.k8s.io,workloadmonitors.cozystack.io \
|
||||||
-n "$namespace" --all \
|
-n "$namespace" --all \
|
||||||
migration.cozystack.io="$timestamp" --overwrite)
|
migration.cozystack.io="$timestamp" --overwrite || true)
|
||||||
done
|
done
|
||||||
# Stamp version
|
# Stamp version
|
||||||
kubectl create configmap -n cozy-system cozystack-version \
|
kubectl create configmap -n cozy-system cozystack-version \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue