Skip to content

Draft: Create images reference list after each CI deployment run

Alexandre Seitz requested to merge aseitz/ci_all_images into main

@tmmorin @Yordle @rletrocquer

What does this MR do and why?

add a new python script that should be executed after cluster deployment in order to produce a YAML file with an exhaustive list of all images used for a deployment with the following format:

- aliases:
  - docker.io/bitnami/postgresql:16.2.0-debian-12-r8
  kustomizations:
  - sylva-system/harbor-postgres
  - sylva-system/postgres
  repoDigest: docker.io/bitnami/postgresql@sha256:90fda44bfa425c2bb08f7b079070481c77abc07eaa6c691d7101b09f807f1dcc
...

with:

  • repoDigest is the key, it identifies a uniq image with its sha256
  • aliases is a list of string, we can have multiple times the same image with different names
  • kustomizations: a list of all kustomizations (or sylva units) using this image

The python takes in parameters:

  • --kubeconfig : path to kubeconfig file
  • --output-dir : path to directory where artifacts will be created
  • --crictl-image: (optional) path to file generated by #1392

The python script connects to cluster:

  • list all namespaces
  • list all kustomizations for all namespaces
  • execute 'flux tree -n kustomization ' to get all dependent resources for each kustomization
  • then parse all resources and look for images in Deployment, Job, Replicaset, Pod, StatefulSet

Related reference(s)

closes #1371

Edited by Alexandre Seitz

Merge request reports