• Kubernetes: Apply parts of a manifest by labels

    2 min read

    kubernetes kubectl selector apply

    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...
  • kubectl: Retrieve a list of object names

    2 min read

    kubectl jsonpath

    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...
  • Using ephemeral containers

    3 min read

    kubernetes kubectl debug troubleshooting ephemeral containers

    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...
  • Convert manifest between API versions using kubectl convert plugin

    2 min read

    kubernetes plugins convert unused-volumes

    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...
  • How to write a kubectl plugin

    2 min read

    kubernetes plugins krew unused-volumes

    Sometimes we all end up writing small one-liners to perform some daily tasks with kubectl, it can come handy to create kubectl plugin to be able to add a command that does precisely that for us. Let's see how to add a custom command to kubectl:

    10/06/2022

    Read more...

More recent...

Older content...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets