feat: add kustomization for ClusterImageCatalog manifests
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 witherror 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.yamlfails 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.
Wanted to do the exact same thing. Good stuff.
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
We have now moved to a different model and catalogs are in the artifacts project. Would this still be relevant?
I am closing this. I have added a new issue to keep track of that (#309).
Merged as part of #309 - thanks for the @solidDoWant. Please test this and let us know!