• Add new line when printing data using jsonpath

    2 min read

    kubectl jsonpath output formatting new lines custom delimiters

    When we print values using jsonpath we'll get all the values in a single line (actually, it won't even bother adding the newline character at the end of the list):

    $ kubectl get ns -o jsonpath='{ .items[*].metadata.name }'
    default dynamodb-operator ec2-operator iam-operator kube-node-lease kube-public kube-system local-path-storage testvault


  • Managing Environment Variables with kubectl

    2 min read

    kubernetes kubectl environment variable set unset

    In today's highly dynamic and containerized environments, managing environment variables is crucial for configuring applications effectively. With the Kubernetes command-line tool, kubectl, you can imperatively set or remove environment variables for your existing objects.


  • What's the difference between kubectl apply and kubectl replace?

    2 min read

    difference kubectl apply replace

    To update a kubernetes object we can use kubectl apply or kubectl replace, but depending on what and how we want it updated we need to use one or the other.


  • Wait for Kubernetes objects to become available using kubectl wait

    2 min read

    kubernetes kubectl wait

    Sometimes we need to wait for some condition to be met before continuing applying resources on the cluster (or accessing them in som way). We can use kubectl wait to block an script until some criteria is met.


  • Show current Kubernetes context in the menu bar

    2 min read

    kubernetes context macos tray icon

    Some commands might be safe to execute while connected to some environments, but can definitely break stuff is applied to the wrong Kubernetes cluster. However, having to execute kubectl config current-context too ofter to make sure we are connected to the right cluster is no fun either.

    With kubectx tray we can have a small icon on the tray bar to help us identify what's the current cluster.



Older content...

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