postgres-containers icon indicating copy to clipboard operation
postgres-containers copied to clipboard

feat: add kustomization for ClusterImageCatalog manifests

Open solidDoWant opened this issue 1 year ago • 2 comments

This adds a kustomization file that always includes the latest ClusterImageCatalog manifest for the default distribution.

cdc86b77be5ac72bbce39136a5e56e140d2aad2a added support for multiple Debian releases, and changed the ClusterImageCatalog.yaml from a file to a symlink. This is great if you have the repo cloned, but it broke several install methods, including what's listed in the CNPG docs:

  • kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/postgres-containers/main/Debian/ClusterImageCatalog.yaml (as listed in the docs) fails with error validating data: invalid object to validate [...]

  • Inclusion in a kustomization.yaml file i.e.

    ---
    apiVersion: kustomize.config.k8s.io/v1beta1
    kind: Kustomization
    resources:
      - https://raw.githubusercontent.com/cloudnative-pg/postgres-containers/refs/heads/main/Debian/ClusterImageCatalog.yaml
    

    fails with error: accumulating resources: accumulation err [...] missing Resource metadata': [...]

  • Installation via flux CD with a git source fails as flux deletes symlinks for security reasons

This fixes all of the above install methods (and probably others) by adding a kustomization.yaml file. Users can specify this file, or in some cases the Debian directory, to install the correct manifest:

  • kubectl apply -k kubectl apply -k https://github.com/cloudnative-pg/postgres-containers//Debian/?ref=main

  • Inclusion in a kustomization.yaml file i.e.

    ---
    apiVersion: kustomize.config.k8s.io/v1beta1
    kind: Kustomization
    resources:
      - https://github.com/cloudnative-pg/postgres-containers//Debian/?ref=main
    
  • Flux CD git source and Kustomization with path: /Debian

The file will be automatically when the CD pipeline is ran, just like the symlinked ClusterImageCatalog.yaml.

solidDoWant avatar Nov 17 '24 11:11 solidDoWant

Wanted to do the exact same thing. Good stuff.

Joker9944 avatar Dec 01 '24 12:12 Joker9944

Related to https://github.com/cloudnative-pg/cloudnative-pg/issues/4687. Thanks for the patch! this seems reasonable at a first glance, we may even want to remove the symlink given that I don't think it serves a purpose anymore if we implement it this way

NiccoloFei avatar Dec 19 '24 14:12 NiccoloFei

We have now moved to a different model and catalogs are in the artifacts project. Would this still be relevant?

gbartolini avatar Sep 10 '25 15:09 gbartolini

I am closing this. I have added a new issue to keep track of that (#309).

gbartolini avatar Sep 10 '25 16:09 gbartolini

Merged as part of #309 - thanks for the @solidDoWant. Please test this and let us know!

gbartolini avatar Sep 12 '25 17:09 gbartolini