Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add kustomization for ClusterImageCatalog manifests #118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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.

2 participants