• ExternalSecret: Partially load a secret

    2 min read

    Kubernetes ExternalSecret

    Sometimes we might have a secret stored in the AWS Secrets Manager with multiple properties but we don't really need all the data stored in the secret. We can tell External Secrets Operator to use just a specific key instead of using the whole secret.

    13/06/2023

    Read more...
  • Add new line when printing data using jsonpath

    2 min read

    kubectl jsonpath output formatting new lines custom delimiters

    When we print values using jsonpath we'll get all the values in a single line (actually, it won't even bother adding the newline character at the end of the list):

    $ kubectl get ns -o jsonpath='{ .items[*].metadata.name }'
    default dynamodb-operator ec2-operator iam-operator kube-node-lease kube-public kube-system local-path-storage testvault
    

    06/06/2023

    Read more...
  • Set the default container for kubectl

    2 min read

    kubernetes Pod default container kubectl

    One of the many improvements we get in Kubernetes 1.27 is the ability to set what's the default container:

    apiVersion: v1
    kind: Pod
    metadata:
      name: multi-container-pod
    spec:
      containers:
      - image: alpine:latest
        name: one
        command:
        - sh
        - -c
        - 'while true; do echo one; sleep 1m; done'
      - image: alpine:latest
        name: two
        command:
        - sh
        - -c
        - 'while true; do echo two; sleep 2m; done'
      - image: alpine:latest
        name: three
        command:
        - sh
        - -c
        - 'while true; do echo tree; sleep 3m; done'
    

    01/06/2023

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

More recent...

Older content...