• Getting Kubernetes documentation using kubectl

    3 min read

    kubernetes explain

    While forking on Kubernetes manifest it's easy to forget the available fields for each Kubernetes object. Using kubectl explain we can get all the fields available with a short description of them. Pretty much a man inside kubectl

    13/08/2021

    Read more...
  • Kubernetes: cannot delete Pods with local storage

    2 min read

    kubernetes kubectl drain local storage emptyDir

    While draining a node it might fail with the message cannot delete Pods with local storage as follows:

    $ kubectl drain tycho.pet2cattle.com --ignore-daemonsets
    node/tycho.pet2cattle.com already cordoned
    error: unable to drain node "tycho.pet2cattle.com", aborting command...
    
    There are pending nodes to be drained:
     tycho.pet2cattle.com
    error: cannot delete Pods with local storage (use --delete-emptydir-data to override): spinnaker-ampa/spin-rosco-658fdb4694-v99jt
    

    02/08/2021

    Read more...
  • tree visualization of Kubernetes objects

    2 min read

    kubernetes krew tree kubectl

    Some kubernetes objects creates and manages other kubernetes objects in order to provide it's functionality. For example, the Deployment object creates a ReplicaSet that in turn creates the desired Pod objects. We can always track down this relationship using kubectl describe but using the tree krew plugin we can see the relationship in a visual way. We can install it like so:

    $ kubectl krew install tree
    

    14/06/2021

    Read more...
  • kubernetes: Rollback a deployment update

    2 min read

    kubectl rolling update history undo

    When performing rolling updates we can see it's history using kubectl rollout history:

    $ kubectl rollout history deploy pet2cattle
    deployment.apps/pet2cattle 
    REVISION  CHANGE-CAUSE
    100       <none>
    101       <none>
    102       <none>
    103       <none>
    104       <none>
    105       <none>
    106       <none>
    107       <none>
    109       kubectl scale deployment/pet2cattle --replicas=2 --record=true
    110       kubectl scale deployment/pet2cattle --replicas=5 --record=true
    111       kubectl scale deployment/pet2cattle --replicas=1 --record=true
    

    If have any problem with the update we can undo and update using kubectl rollout undo

    25/05/2021

    Read more...
  • How to imperatively change a container's image

    2 min read

    kubernetes set image

    To change a container's image we can:

    • Update the yaml definition and push it using kubectl apply
    • Use kubectl edit to update it using a definition fetched from the Kubernetes cluster itself
    • To use kubectl set image to set the new image

    Let's check how to use kubectl set image

    14/05/2021

    Read more...

More recent...

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