Skip to content

Commit

Permalink
feature. add step for unsetting policy crs
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed May 24, 2024
1 parent ae12015 commit e0778ef
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tks-cluster/remove-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ spec:
- name: target_namespace
value: "{{workflow.parameters.cluster_id}}"

- - name: deletePolicyCR
template: deletePolicyCR
arguments:
parameters:
- name: target_namespace
value: "{{workflow.parameters.cluster_id}}"

- - name: deleteArgoCDAppGroup
templateRef:
name: delete-apps
Expand Down Expand Up @@ -386,3 +393,31 @@ spec:
value: "{{inputs.parameters.target_namespace}}"
- name: CLUSTER_NAME
value: "{{workflow.parameters.cluster_id}}"

- name: deletePolicyCR
inputs:
parameters:
- name: target_namespace
container:
name: delete-policy-cr
image: harbor.taco-cat.xyz/tks/tks-cluster-init:v1.0.0
command:
- /bin/bash
- "-exc"
- |
cp /kube/value kubeconfig_adm
export KUBECONFIG=kubeconfig_adm
kubectl delete tkspolicy -n ${TARGET_NAMESPACE}
kubectl get tkspolicy -n ${TARGET_NAMESPACE} -o json | \
jq -c '.items[] | .metadata.finalizers = null | {apiVersion, kind, metadata, spec}' | kubectl apply -f
kubectl delete tkspolicytemplate -n ${TARGET_NAMESPACE}
kubectl get tkspolicytemplate -n ${TARGET_NAMESPACE} -o json | \
jq -c '.items[] | .metadata.finalizers = null | {apiVersion, kind, metadata, spec}' | kubectl apply -f
env:
- name: TARGET_NAMESPACE
value: "{{inputs.parameters.target_namespace}}"
volumeMounts:
- name: kubeconfig-adm
mountPath: "/kube"

0 comments on commit e0778ef

Please sign in to comment.