2 min read
We can use the kubectl patch command with the -p option to update an existing kubernetes object:
$ kubectl patch sc gp2 -p '{"allowVolumeExpansion": true}'
storageclass.storage.k8s.io/gp2 patched
When the patch is small is a very convenient way of patching it but as the patch grows it becomes less convenient
19/09/2022
Read more...2 min read
Sometimes we might have a manifest file with a lot of objects in it but we don't really need them all. We can use it's labels to install just the objects that have a specific label.
15/09/2022
Read more...2 min read
If we need to write some script to retrieve a certain information that kubectl can provide, we can always add the option to remove headers and use something like awk to narrowit down. There's also a better way than doing this:
kubectl get ns --no-headers | awk '{ print $1 }'
31/08/2022
Read more...3 min read
Starting Kubernetes 1.23, ephemeral containers are enabled by default (in beta though). Using ephemeral containers we can now troubleshoot pods by deploying a temporary container into it with extra privileges or binaries to use
22/08/2022
Read more...2 min read
We can install the kubectl convert plugin to help us convert manifest between different API versions: For example, from an Ingress using the extensions/v1beta1 API version to networking.k8s.io/v1
16/06/2022
Read more...