• What's a kubernetes DaemonSet?

    2 min read

    kubernetes DaemonSet

    When it comes to kubernetes objects, maybe the one that is quite common but still causes a lot of confusion is the DaemonSet. What's it's function?

    04/06/2021

    Read more...
  • tail multiple kubernetes pods

    2 min read

    stern kubernetes pods

    While debugging issues we might need to be able to see the output from multiple pods (or multiple) at the same time to be able to understand how they are interacting. Stern allows you to tail multiple pods on Kubernetes and even multiple containers within the pod

    03/06/2021

    Read more...
  • kubernetes: enforce resource limits using LimitRange

    3 min read

    LimitRange enforce kubernetes resource limits

    If we want to make sure the resources for a given namespace are controlled yet we want to be able to give full control to whoever is creating objects in that namespace, we can use LimitRange to enforce some resource constraints:

    • We can enforce a minimum and maximum (and it's default value) for compute resources per Pod or Container or storage request per PersistentVolumeClaim in the namespace
    • We can also enfornce a ratio between request and limit for a resource (so that we are not abusing the control setting limits that are too wide) Set default request/limit for compute resources in a namespace and automatically inject them to Containers at runtime.

    This is implemented as an admission controller that observes the incoming requests and makes sure that it does not violate any of the constraints enumerated in the LimitRange object within it's namespace.

    02/06/2021

    Read more...
  • kubernetes: pod restart policy

    2 min read

    restartPolicy pod kubernetes

    When defining objects that contain a pod template (such a Deployment or a Job) but also when defining a plain pod we can control under which circumstances a pod will be restarted

    The container restart policy can be controlled using restartPolicy on the spec at the same level where we define the containers:

    apiVersion: batch/v1
    kind: Job
    metadata:
      name: demo-restartPolicy-job
    spec:
      backoffLimit: 2
      template:
        metadata:
          name: demo-restartPolicy-pod
        spec:
          containers:
          - name: demo
            image: sonarsource/sonar-scanner-cli
          restartPolicy: Never  
    

    01/06/2021

    Read more...
  • psql: Get the time it took a query to complete

    1 min read

    If you need to known the amount of time it took a query to complete on PostgreSQL, you can use the \timing function that psql has

    31/05/2021

    Read more...

More recent...

Older content...