From d6c0b8d24cef5a390813d0fe0c937d78165427ed Mon Sep 17 00:00:00 2001 From: vac Date: Mon, 8 Apr 2024 22:51:42 +0800 Subject: [PATCH] feat: add gateway-api-crds chart --- .github/workflows/release-charts.yaml | 66 +++++++++++++++++++++ charts/gateway-api-crds/.helmignore | 23 +++++++ charts/gateway-api-crds/Chart.yaml | 19 ++++++ charts/gateway-api-crds/README.md | 10 ++++ charts/gateway-api-crds/templates/NOTES.txt | 1 + charts/gateway-api-crds/values.yaml | 4 ++ 6 files changed, 123 insertions(+) create mode 100644 .github/workflows/release-charts.yaml create mode 100644 charts/gateway-api-crds/.helmignore create mode 100644 charts/gateway-api-crds/Chart.yaml create mode 100644 charts/gateway-api-crds/README.md create mode 100644 charts/gateway-api-crds/templates/NOTES.txt create mode 100644 charts/gateway-api-crds/values.yaml diff --git a/.github/workflows/release-charts.yaml b/.github/workflows/release-charts.yaml new file mode 100644 index 0000000000..24e9be96ae --- /dev/null +++ b/.github/workflows/release-charts.yaml @@ -0,0 +1,66 @@ +name: Release Charts + +on: + push: + paths: + - .github/workflows/release-charts.yaml + - charts/** + branches: + - main + - feat/gateway-api-crds-chart + +jobs: + release: + permissions: + contents: write # to push chart release and create a release (helm/chart-releaser-action) + packages: write # needed for ghcr access + id-token: write # needed for keyless signing + + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Fetch history + run: git fetch --prune --unshallow + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Copy crds to chart templates + run: cp -v config/crd/standard/*.yaml charts/gateway-api-crds/templates/ + + - name: Set up Helm + uses: azure/setup-helm@v3.5 + with: + version: v3.12.0 + + - name: Run chart-releaser + # TODO: pin chart-releaser, currently the latest release (v1.6.0) does not support skip_upload + uses: helm/chart-releaser-action@13fe82a5149cf0b212e16453d25b3c59f2b4d3ef + with: + skip_existing: true + skip_upload: true + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + CR_GENERATE_RELEASE_NOTES: true + + # see https://github.com/helm/chart-releaser/issues/183 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push charts to GHCR + run: | + shopt -s nullglob + for pkg in .cr-release-packages/*; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts" + done diff --git a/charts/gateway-api-crds/.helmignore b/charts/gateway-api-crds/.helmignore new file mode 100644 index 0000000000..0e8a0eb36f --- /dev/null +++ b/charts/gateway-api-crds/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/gateway-api-crds/Chart.yaml b/charts/gateway-api-crds/Chart.yaml new file mode 100644 index 0000000000..0f5012b543 --- /dev/null +++ b/charts/gateway-api-crds/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v2 +type: application +version: 0.0.1-alpha3 +name: gateway-api-crds +icon: https://avatars.githubusercontent.com/u/36015203?s=400&v=4 +description: | + A Helm chart that collects custom resource definitions (CRDs) from the Kubernetes Gateway API, + allowing for seamless integration with GitOps tools +keywords: + - kubernetes + - gateway-api + - crds +appVersion: 1.0.0 +home: https://gateway-api.sigs.k8s.io +sources: + - https://github.com/kubernetes-sigs/gateway-api +maintainers: + - name: vac + email: dot.fun@protonmail.com diff --git a/charts/gateway-api-crds/README.md b/charts/gateway-api-crds/README.md new file mode 100644 index 0000000000..cab54fd470 --- /dev/null +++ b/charts/gateway-api-crds/README.md @@ -0,0 +1,10 @@ +# Kubernetes Gateway API CRDs + +This chart brings Custom Resource Definitions (CRD) used by Kubernetes Gateway API. + +Inspired by the following great resources: + +* https://github.com/helm/chart-releaser-action +* https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-operator-crds +* https://github.com/kubernetes-sigs/metrics-server/tree/master/charts/metrics-server +* https://github.com/kubernetes/dashboard/tree/master/charts/kubernetes-dashboard diff --git a/charts/gateway-api-crds/templates/NOTES.txt b/charts/gateway-api-crds/templates/NOTES.txt new file mode 100644 index 0000000000..ae7abe56ae --- /dev/null +++ b/charts/gateway-api-crds/templates/NOTES.txt @@ -0,0 +1 @@ +See https://github.com/kubernetes-sigs/gateway-api/tree/main/config/crd/standard diff --git a/charts/gateway-api-crds/values.yaml b/charts/gateway-api-crds/values.yaml new file mode 100644 index 0000000000..006334c855 --- /dev/null +++ b/charts/gateway-api-crds/values.yaml @@ -0,0 +1,4 @@ +## Annotations for CRDs +## +#crds: +# annotations: {}