> For the complete documentation index, see [llms.txt](https://brightzheng100.gitbook.io/tech-diary/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brightzheng100.gitbook.io/tech-diary/kubernetes_ocp/faqs.md).

# 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
```
