Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
320548fd
Commit
320548fd
authored
Sep 01, 2017
by
shashidharatd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete the federation namespace from fcp instead of individual objects
parent
1a3a0713
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
common.sh
federation/cluster/common.sh
+9
-10
No files found.
federation/cluster/common.sh
View file @
320548fd
...
@@ -74,17 +74,16 @@ function cleanup-federation-api-objects {
...
@@ -74,17 +74,16 @@ function cleanup-federation-api-objects {
set
+o errexit
set
+o errexit
echo
"Cleaning Federation control plane objects"
echo
"Cleaning Federation control plane objects"
# Delete all resources with the federated-cluster label.
kube::log::status
"Removing namespace
\"
${
FEDERATION_NAMESPACE
}
\"
from
\"
${
FEDERATION_KUBE_CONTEXT
}
\"
"
$host_kubectl
delete pods,svc,rc,deployment,secret
-lapp
=
federated-cluster
# Try deleting until the namespace is completely gone.
while
$host_kubectl
--context
=
"
${
FEDERATION_KUBE_CONTEXT
}
"
delete namespace
"
${
FEDERATION_NAMESPACE
}
"
>
/dev/null 2>&1
;
do
# Delete all PVs bound to PVCs in FEDERATION_NAMESPACE
# It is usually slower to remove a namespace because it involves
pvs
=
$(
$host_kubectl
get pvc
--namespace
=
${
FEDERATION_NAMESPACE
}
-o
jsonpath
=
'{.items[*].spec.volumeName}'
)
# performing a cascading deletion of all the resources in the
while
$host_kubectl
delete pv
${
pvs
}
>
/dev/null 2>&1
;
do
# namespace. So we sleep a little longer than other resources
sleep
2
# before retrying
sleep
5
done
done
kube::log::status
"Removed namespace
\"
${
FEDERATION_NAMESPACE
}
\"
from
\"
${
FEDERATION_KUBE_CONTEXT
}
\"
"
# Delete all resources in FEDERATION_NAMESPACE.
$host_kubectl
delete pvc,pods,svc,rc,deployment,secret
--namespace
=
${
FEDERATION_NAMESPACE
}
--all
# This is a big hammer. We get rid of federation-system namespace from
# This is a big hammer. We get rid of federation-system namespace from
# all the clusters
# all the clusters
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment