• 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.

    21/05/2023

    Read more...
  • Import a ServiceAccount token into kubeconfig

    2 min read

    ServiceAccount token kubeconfig import user credentials

    To locally run some process we might need to use some ServiceAccount credentials to make sure it has the same exact permissions it would have running it as a Pod. To do se we can import the ServiceAccount token into our kubeconfig to be able to impersonate it.

    29/05/2023

    Read more...
  • The truth behind Pulumi's AWS provider

    2 min read

    Pulumi Terraform provider AWS

    If when writing Pulumi code to deploy to AWS ever got the feeling that you where using some interface to write terraform code (HCL), there might be a reason for you to get that feeling.

    24/05/2023

    Read more...
  • Use a letsencrypt certificate on Kubernetes with cert-manager and Traefik

    4 min read

    traefik k3s ingress letsencrypt cert-manager

    To be able to automatically request letsencrypt certificates for the TLS-eanble Ingress objects in a kubernetes cluster with the traefik ingress controller we can use the cert-manager controller.

    23/05/2023

    Read more...
  • Running tcpdump on an OpenShift cluster

    3 min read

    OpenShift tcpdump troubleshooting

    If we want to take a look at the network traffic that we get out of an OpenShift node we can use the oc debug command to spin up a privileged pod with tcpdump installed. This way we don't need to ssh into the worker node.

    22/05/2023

    Read more...
  • Automatically stablish a SSH tunnel to connect to k8s with kubectl

    4 min read

    Kubernetes k3s SSH tunnel

    Kubernetes is a powerful container orchestration platform used by many organizations to deploy and manage their applications. Interacting with a Kubernetes cluster requires configuring the kubeconfig file with the necessary credentials. However, managing these credentials can be challenging, especially in scenarios where a bastion host or SSH tunnel is required.

    With kubectl-tokensshtunnel we can automate the process of creating an SSH tunnel to a remote server and retrieving the Kubernetes credentials from there. This tool simplifies access to remote Kubernetes clusters by securely caching the credentials for a specified duration.

    18/05/2023

    Read more...
  • Simplifying Input Parameters in Pulumi and AWS CDK Libraries

    2 min read

    Pulumi AWS CDK input parameters string pointers

    Some libraries require you to use string pointers or custom objects for some input parameters, notable examples are Pulumi and AWS CDK. If we only need to provide some static value for it can be annoying to use.

    16/05/2023

    Read more...
  • Operator-SDK: Set custom fields for kubectl get

    2 min read

    Kubernetes Operator-SDK CustomResourceDefinition additionalPrinterColumns get fields

    When writing a custom Kubernetes operator using operator-sdk we might want to change the fields are show when running kubectl get:

    $ kubectl get example
    NAME   AGE
    demo   4h20m
    

    To do so, we'll need to add the additionalPrinterColumns field the the CustomResourceDefinition, but since we are using operator-sdk to take care of this, we'll need to use some annotations in the resource definition file.

    15/05/2023

    Read more...
  • Velero: Backup and restore

    4 min read

    Kubernetes backup velero aws backup restore schedule

    Just in the same way we backup physical servers, we need to backup Kubernetes workloads to be able to restore it to its previous state: We'll need make sure we are going to be able to restore the objects of any namespace and it's data (PersistentVolumes)

    08/05/2023

    Read more...
  • Kustomize: Escape Forward Slash (/)

    2 min read

    Kustomize patches escape forward slash ~1 notation annotation path

    While writing Kustomize patches you might come across is the need to escape certain characters, such as the forward slash (/). This can be a bit tricky since the common conventions on how to escape a character don't apply here.

    03/05/2023

    Read more...

Older content...

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