Skip to content

feat: add kustomization for ClusterImageCatalog manifests#118

Closed
solidDoWant wants to merge 1 commit intocloudnative-pg:mainfrom
solidDoWant:main
Closed

feat: add kustomization for ClusterImageCatalog manifests#118
solidDoWant wants to merge 1 commit intocloudnative-pg:mainfrom
solidDoWant:main

Conversation

@solidDoWant
Copy link

@solidDoWant solidDoWant commented Nov 17, 2024

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

cdc86b7 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.

@Joker9944
Copy link

Wanted to do the exact same thing. Good stuff.

Signed-off-by: Fred Heinecke <fred.heinecke@yahoo.com>
@NiccoloFei
Copy link
Contributor

Related to cloudnative-pg/cloudnative-pg#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

@gbartolini
Copy link
Contributor

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

@gbartolini
Copy link
Contributor

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

@gbartolini gbartolini closed this Sep 10, 2025
@gbartolini
Copy link
Contributor

gbartolini commented Sep 12, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants