Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Disable gardener workflow schedule (#33)
Browse files Browse the repository at this point in the history
* Uninstallation fixes

* Gardener workflow tuning
  • Loading branch information
pbochynski authored Nov 4, 2020
1 parent 5c6d0ac commit e325262
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/app-connector-e2e-gardener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ on:
description: 'Shoot cluster name'
required: true
default: 'ci'
schedule:
- cron: '0 * * * *' # every hour

jobs:
build:
Expand Down Expand Up @@ -51,9 +49,9 @@ jobs:
run: |
./app-connector-example.sh
- name: Uninstall Kyma
env:
SHOOT_NAME: ${{ github.event.inputs.shoot }}
run: |
./uninstall-kyma.sh
export SHOOT_NAME=$(kubectl get cm shoot-info -n kube-system -ojsonpath='{.data.domain}')
kubectl --kubeconfig ./garden-kubeconfig.yaml annotate shoot $SHOOT_NAME confirmation.gardener.cloud/deletion=true
kubectl --kubeconfig ./garden-kubeconfig.yaml delete shoot $SHOOT_NAME
3 changes: 2 additions & 1 deletion create-cluster-gardener.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ while [[ $STATUS != "True" ]]; do
sleep 5
done

kubectl --kubeconfig ./garden-kubeconfig.yaml get secret $SHOOT_NAME.kubeconfig -ojsonpath='{.data.kubeconfig}' | base64 --decode > ~/.kube/config
kubectl --kubeconfig ./garden-kubeconfig.yaml get secret $SHOOT_NAME.kubeconfig -ojsonpath='{.data.kubeconfig}' | base64 --decode > ~/.kube/config
chmod 600 ~/.kube/config
10 changes: 1 addition & 9 deletions uninstall-kyma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

SECONDS=0

# Wait until number of background jobs is less than $1, try every $2 second(s)
function waitForJobs() {
while (( (( JOBS_COUNT=$(jobs -p | wc -l) )) > $1 )); do echo "Waiting for $JOBS_COUNT command(s) executed in the background, elapsed time: $(( $SECONDS/60 )) min $(( $SECONDS % 60 )) sec"; jobs >/dev/null ; sleep $2; done
}
kubectl delete ValidatingWebhookConfiguration config.webhook.eventing.knative.dev
kubectl delete ValidatingWebhookConfiguration validation.webhook.eventing.knative.dev
kubectl delete MutatingWebhookConfiguration webhook.eventing.knative.dev
Expand All @@ -16,10 +12,7 @@ kubectl delete apirules --all -A
kubectl delete rules.oathkeeper.ory.sh --all -A
kubectl delete secret -n istio-system kyma-gateway-certs-cacert

helm ls -A -ojson | jq -r '.[] | "helm delete \(.name) -n \(.namespace)"' | while read -r line; do bash -c "$line &" ; done

# Wait for jobs - helm commands executed in the background
waitForJobs 0 5
helm ls -A -ojson | jq -r '.[] | "helm delete \(.name) -n \(.namespace)"' | while read -r line; do bash -c "$line" ; done

kubectl delete -f resources/cluster-essentials/files -n kyma-system

Expand All @@ -30,5 +23,4 @@ kubectl delete ns knative-eventing
kubectl delete ns natss
kubectl delete ns mocks


echo "Kyma uninstalled in $(( $SECONDS/60 )) min $(( $SECONDS % 60 )) sec"

0 comments on commit e325262

Please sign in to comment.