Skip to content

Instantly share code, notes, and snippets.

View qinqon's full-sized avatar

Enrique Llorente Pastora qinqon

View GitHub Profile
@johscheuer
johscheuer / get_pod_netns.sh
Last active November 28, 2024 17:34
This script get's the netns from a Kubernetes pod
#### WAY with crictl
#### TODO validate crictl with docker runtime !!
# Get all pods of a specific node
#kubectl get po --field-selector=spec.nodeName="fluffy-master" --all-namespaces
kubectl get --all-namespaces po --field-selector=spec.nodeName=="$(hostname)" -o json | jq -r '.items[] | select(.status.hostIP!=.status.podIP) | "\(.metadata.name) \(.metadata.namespace)"'
# Get the Pod ID of the Pod with crictl
POD_ID=$(sudo crictl pods --name=nginx-6f858d4d45-vnszm --namespace=default -q --no-trunc)
Clear keypairs and stacks https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/ovb-manage-stack/templates/cleanup-stacks-keypairs.sh.j2
Delete a specific stack https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/ovb-manage-stack/tasks/ovb-delete-stack.yml
# Clear all the stacks #############################################################
ALL_STACKS=$(openstack stack list | grep "COMPLETE\|CREATE_FAILED" | cut -d '|' -f 3)
echo $ALL_STACKS
for STACK in $ALL_STACKS; do
echo "Deleting Heat stack $STACK"