• Using Abbreviated Commits in Git

    1 min read

    git commit abbreviated

    To pin some code to a specific version we can use a commit ID instead of a tag but using such a long string might feel a tad cumbersome:

    $ git log
    commit fb944d599d5487229463478928834cac20963f75 (HEAD -> main)
    Author: Eric <some@thing.com>
    Date:   Wed Jun 7 20:27:17 2023 +0100
    
        Fix exit with no error when cert violates lookahead (#2395)
    
    (...)
    

    22/06/2023

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

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