Recently there was a lot of stuff going on in the world and i didn’t really had any will to post anything, which is a shame. I’ve started to recover K8s in my memory by starting the study process all over again.
And sometime ago we had quite “fun” situation. One of the developers “accidentally” deleted the namespace in their new dev environment.
As me and my colleague needed some study experience we didn’t really want to go with an easy process and just restore the cluster from the last backup point, but we wanted to restore only the namespace.
So first of all we fired up the backup, found out that the namespace and all the deployments are there. We had to comeback few times to our backup as more and more things we needed.
So here is a list of all the items we had to recover:
- Service Accounts
- Role Bindings
- Configuration Maps
You can simply get this information by running:
kubectl get ‘resource type’ ‘resource name’ -n ‘namespace name’ -o yaml
And apply the manifest by using:
kubectl apply -f ‘file.yml’
That is a short read, but hope it was usefull 🙂