• Testing a TCP connection using bash

    2 min read

    bash test connection

    To be able to debug issues we can test a TCP connection using netcat (nc) or even telnet. But when we are on a containerized environment such as Kubernetes it can be a challenge when the container doesn't have the right tools for the job

    $ nc
    bash: nc: command not found
    $ netcat
    bash: netcat: command not found
    $ telnet
    bash: telnet: command not found
    

    05/07/2021

    Read more...
  • Using terraform try function to retrieve optional values on maps

    2 min read

    terraform try function

    It's common practice to use a map in terraform to configure resources. If we want to use a map with optional values we can make use of the try() function

    Let's us the following map as an example:

      config = {
        namespaces = ["namespace1", "namespace2"]
    
        (...)
      }
    

    02/07/2021

    Read more...
  • Using an HPA object to autoscale a deployment based on it's Pods CPU metrics

    3 min read

    kubernetes autoscale deployment CPU metrics

    On Kubernetes, scaling an application is just a matter of defining how many replicas we want:

    $ kubectl scale deployment/demo --replicas=5
    deployment.apps/demo scaled
    

    Having to manually adjust the number of replicas is not really practical. Here's where the HorizontalPodAutoscaler (HPA) comes into play

    01/07/2021

    Read more...
  • Kubernetes Pod: Share a temporal Volume across containers

    2 min read

    kubernetes volume pod

    If we need to be able to share some data across containers (one generates the data and the other one consumes it) we can use an emptyDir to create a Volume to mount on both containers.

    30/06/2021

    Read more...
  • What's the meaning of the sections of a kubeconfig file?

    2 min read

    kubernetes kubeconfig format

    The configuration file kubeconfig (~/.kube/config) is used to get access to a Kubernetes cluster. It looks like a Kubernetes object that defines the cluster, the user and the context to use:

    apiVersion: v1
    kind: Config
    preferences: {}
    
    clusters:
    (...)
    
    users:
    (...)
    
    contexts:
    (...)
    

    Let's take a minikube kubeconfig as an example

    29/06/2021

    Read more...

More recent...

Older content...