• Prometheus: Add label to a metric

    1 min read

    prometheus relabel_configs add label

    In Prometheus, to be able to add a label to the metrics retrieved by a particular job we can use relabel_configs.

    08/03/2023

    Read more...
  • Kustomize: Disabling hashed ConfigMap when using configMapGenerator

    2 min read

    kustomize configMapGenerator ConfigMap

    When we try to use configMapGenerator to generate a ConfigMap containing some files like this:

    configMapGenerator:
    - name: config-files
      behavior: create
      files:
      - files/file1.txt
      - files/file2.txt
    

    By default, it is going to append a hash to it:

    $ kubectl get configmap
    NAME                          DATA   AGE
    config-files-m55tkfhh8f       2      45d
    

    If we need to access this ConfigMap by name we might want to remove the hash.

    07/03/2023

    Read more...
  • Optional Secrets as Volumes or Environment variables

    3 min read

    kubernetes secret optional volume envirnment variable

    Secrets contain sensitive data such as passwords, tokens, and certificates. They can be used by Kubernetes pods to authenticate with other systems. However, some of them might be optional so we'll want to be able to create the Pod without having to use some template engine to handle whether the secret is present or not.

    06/03/2023

    Read more...
  • sceptre: Defining an explicit dependency

    1 min read

    sceptre explicit dependencies

    When we are using the output of one stack as a parameter for another one we are defining an implicit dependency: sceptre is going to create one first, get it's output and then create the other one. If we still need to create some stack after another but we are not using any output as parameter, we can still define an explicit dependency.

    01/03/2023

    Read more...
  • Kubernetes: Search for rule granting certain action

    3 min read

    kubernetes role clusterrole rule lookup

    To be able to audit access permissions of users un a Kubernetes cluster we might be interested in searching for Roles or ClusterRoles that grants access to a certain object:

    27/02/2023

    Read more...

More recent...

Older content...