-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌱 Cleanup v1 cluster before creating v3 clusters on upgrade (#576)
* Cleanup v1 cluster before creating v3 clusters on upgrade Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com> * Cover provisioning to management v3 migration - Add e2e tests, verifying the added migration functionality Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com> * Clean up space for short e2e run Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com> --------- Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
- Loading branch information
1 parent
e9aa608
commit 80e434b
Showing
6 changed files
with
542 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{{- if and (index .Values "rancherTurtles" "features" "managementv3-cluster" "enabled") (index .Values "rancherTurtles" "features" "managementv3-cluster-migration" "enabled") }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: post-upgrade-job | ||
namespace: rancher-turtles-system | ||
annotations: | ||
"helm.sh/hook": post-upgrade | ||
"helm.sh/hook-weight": "1" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: post-upgrade-job-delete-clusters | ||
annotations: | ||
"helm.sh/hook": post-upgrade | ||
"helm.sh/hook-weight": "1" | ||
rules: | ||
- apiGroups: | ||
- provisioning.cattle.io | ||
resources: | ||
- clusters | ||
verbs: | ||
- list | ||
- delete | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: post-upgrade-job-delete-clusters | ||
annotations: | ||
"helm.sh/hook": post-upgrade | ||
"helm.sh/hook-weight": "1" | ||
subjects: | ||
- kind: ServiceAccount | ||
name: post-upgrade-job | ||
namespace: rancher-turtles-system | ||
roleRef: | ||
kind: ClusterRole | ||
name: post-upgrade-job-delete-clusters | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: post-upgrade-delete-clusters | ||
annotations: | ||
"helm.sh/hook": post-upgrade | ||
"helm.sh/hook-weight": "2" | ||
spec: | ||
ttlSecondsAfterFinished: 300 | ||
template: | ||
spec: | ||
serviceAccountName: post-upgrade-job | ||
containers: | ||
- name: post-upgrade-delete-clusters | ||
image: {{ index .Values "rancherTurtles" "features" "rancher-webhook" "kubectlImage" }} | ||
args: | ||
- delete | ||
- clusters.provisioning.cattle.io | ||
- --selector=cluster-api.cattle.io/owned | ||
- -A | ||
- --ignore-not-found=true | ||
- --wait | ||
restartPolicy: OnFailure | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.