📃
tech-diary
  • Overview
  • Kubernetes & OCP
    • Useful Scripts
    • FAQs
  • Docker
    • FAQs
  • Java Development
    • Spring Boot 2 Tips & FAQ
    • Maven Tips & FAQ
    • JDKs and IDEs Tips & FAQ
    • Unit Test Tips & FAQ
  • Go Development
    • Cobra Walkthrough Guide
    • Go Template Walkthrough Guide
    • Logging in Golang
    • Code Walkthrough for Identified OSS Projects
  • Operating Systems
    • RHEL
    • Ubuntu
    • Centos
  • DevOps
    • Git & GitHub Tips
  • Communities
  • RDBMS
    • Contribution Record
    • MySQL
  • Tools
    • VS Code
Powered by GitBook
On this page
  • How-tos
  • How to force delete a namespace?
  • How to patch service account with image pull secret?

Was this helpful?

  1. Kubernetes & OCP

FAQs

How-tos

How to force delete a namespace?

Sometimes a namespace will be pending at Terminating state forever for some reason. So here are the simple steps to force delete it:

export NAMESPACE_TO_DELETE=app-entitlement
kubectl get ns $NAMESPACE_TO_DELETE -o json | jq '.spec.finalizers=[]' > ns-without-finalizers.json
kubectl replace --raw "/api/v1/namespaces/$NAMESPACE_TO_DELETE/finalize" -f ./ns-without-finalizers.json
rm -f ns-without-finalizers.json

How to patch service account with image pull secret?

kubectl patch serviceaccount default \
    -p '{"imagePullSecrets": [{"name": "multiclusterhub-operator-pull-secret"}]}' \
    -n multicluster-endpoint

PreviousUseful ScriptsNextFAQs

Last updated 5 years ago

Was this helpful?