• How to install packages on alpine-based containers

    2 min read

    containers alpine package

    Whether you are running containers on Kubernetes or in docker you might need to install packages on the running containers. You will notice that most of them are based on Alpine Linux because of its small size.

    Alpine Linux is a distribution based on musl and BusyBox with its own package-management system, apk-tools.

    19/03/2021

    Read more...
  • Using the nodeSelector for selecting a kubernetes cluster partition

    4 min read

    kubernetes pod nodeSelector scheduler

    On a kubernetes cluster not all nodes are expected to have the same amount of resources so we might need to schedule some pods on specific nodes due to the resources they have (for example access to a GPU) or due to the network connectivity they have (for example edge nodes). Using nodeSelector we can the scheduler how we want out pods to be scheduled

    18/03/2021

    Read more...
  • Use kubie to simplify changes between kubernetes contexts and namespaces

    2 min read

    kubernetes kubectl context kubie

    On another post we talked about how to change kubernetes context using kubectl and there's another post for setting a default namespace for a given context. kubie is a tool that helps trying to make it easier

    17/03/2021

    Read more...
  • kubernetes: List available API using kubectl

    2 min read

    kubernetes list API version k3s

    With kubectl api-resources we can get the list of available objects, but the same object can be defined using different API versions, for example the Ingress object is different on v1beta1 compared to v1. Using kubectl api-versions we can get the list of all the available API versions on our kubernetes cluster

    16/03/2021

    Read more...
  • kubernetes: Get events across multiple objects

    4 min read

    kubernetes get events kubectl

    The most commonly used way to get events is by using kubectl describe on each object like this:

    $ kubectl describe pod pet2cattle-6597f8464d-hgxpp
    Name:         pet2cattle-6597f8464d-hgxpp
    (...)
    Events:
      Type     Reason     Age    From               Message
      ----     ------     ----   ----               -------
      Normal   Scheduled  3m47s  default-scheduler  Successfully assigned kube-system/pet2cattle-6597f8464d-hgxpp to scopuli.lolcathost.systemadmin.es
      Normal   Pulled     3m46s  kubelet            Container image "172.18.1.46:5000/p2c:3.44" already present on machine
      Normal   Created    3m46s  kubelet            Created container pet2cattle-sitemap
      Normal   Started    3m46s  kubelet            Started container pet2cattle-sitemap
      Normal   Pulled     3m41s  kubelet            Container image "172.18.1.46:5000/p2c:3.44" already present on machine
      Normal   Created    3m41s  kubelet            Created container pet2cattle-indexer
      Normal   Started    3m40s  kubelet            Started container pet2cattle-indexer
      Normal   Pulled     3m32s  kubelet            Container image "172.18.1.46:5000/p2c:3.44" already present on machine
      Normal   Created    3m32s  kubelet            Created container pet2cattle
      Normal   Started    3m31s  kubelet            Started container pet2cattle
      Warning  Unhealthy  3m26s  kubelet            Liveness probe failed: Get http://10.42.0.8:8000/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
    

    It's quite convenient when we are looking for events related to a given but becomes a pain if we need to see how the events are triggered on multiple objects.

    15/03/2021

    Read more...

More recent...

Older content...