-
Notifications
You must be signed in to change notification settings - Fork 4
Add helm charts #158
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
Merged
Add helm charts #158
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
95fa1d2
Add helm charts
SzymonSAP 74e8c19
Remove node selector
SzymonSAP b1b4ad6
Split REUSE path list into multiple lines
SzymonSAP ca2ace7
Remove empty if in manager maniferst
SzymonSAP 262cfb4
Update helm charts documentation
SzymonSAP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Release Helm Chart | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - 'v*.*.*' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| helm-chart: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Helm | ||
| uses: azure/setup-helm@v4 | ||
| with: | ||
| version: v3.16.2 | ||
|
|
||
| - name: Determine chart version | ||
| id: chart_version | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
| # Use SHA for main branch | ||
| CHART_VERSION="0.0.0-$(echo ${{ github.sha }} | cut -c1-7)" | ||
| elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| # Use tag version (strip 'v' prefix) | ||
| CHART_VERSION="${GITHUB_REF#refs/tags/v}" | ||
| else | ||
| # Use PR SHA for dry run | ||
| CHART_VERSION="0.0.0-$(echo ${{ github.sha }} | cut -c1-7)" | ||
| fi | ||
| echo "version=$CHART_VERSION" >> $GITHUB_OUTPUT | ||
| - name: Install Kustomize | ||
| run: | | ||
| curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash | ||
| mv kustomize /usr/local/bin | ||
| - name: Prepare CRDs folder | ||
| run: | | ||
| mkdir -p dist/chart/crds | ||
| kustomize build config/default | yq ea 'select(.kind == "CustomResourceDefinition")' > dist/chart/crds/crds.yaml | ||
| rm -rf dist/chart/templates/crd | ||
| - name: Package Helm chart | ||
| run: | | ||
| helm package dist/chart --version ${{ steps.chart_version.outputs.version }} | ||
| - name: Log in to GitHub Container Registry | ||
| run: | | ||
| echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin | ||
| - name: Push Helm chart to GHCR | ||
| run: | | ||
| helm push boot-operator-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: Test Chart | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| test-e2e: | ||
| name: Run on Ubuntu | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Clone the code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Install Helm | ||
| run: | | ||
| curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | ||
| - name: Verify Helm installation | ||
| run: helm version | ||
|
|
||
| - name: Lint Helm Chart | ||
| run: | | ||
| helm lint ./dist/chart | ||
| - name: Install the latest version of kind | ||
| run: | | ||
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 | ||
| chmod +x ./kind | ||
| sudo mv ./kind /usr/local/bin/kind | ||
| - name: Verify kind installation | ||
| run: kind version | ||
|
|
||
| - name: Create kind cluster | ||
| run: kind create cluster | ||
|
|
||
| - name: Prepare boot-operator | ||
| run: | | ||
| go mod tidy | ||
| make docker-build IMG=boot-operator:v0.1.0 | ||
| kind load docker-image boot-operator:v0.1.0 | ||
| - name: Install cert-manager via Helm | ||
| run: | | ||
| helm repo add jetstack https://charts.jetstack.io | ||
| helm repo update | ||
| helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true | ||
| - name: Wait for cert-manager to be ready | ||
| run: | | ||
| kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager | ||
| kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-cainjector | ||
| kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-webhook | ||
| - name: Install Helm chart for project | ||
| run: | | ||
| helm install my-release ./dist/chart --create-namespace --namespace boot-operator-system | ||
| - name: Check Helm release status | ||
| run: | | ||
| helm status my-release --namespace boot-operator-system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ SPDX-PackageSupplier = "IronCore authors <[email protected]>" | |
| SPDX-PackageDownloadLocation = "https://github.com/ironcore-dev/boot-operator" | ||
|
|
||
| [[annotations]] | ||
| path = [".github/**", ".gitignore", "CODEOWNERS", "Dockerfile", "Makefile", "PROJECT", "config/**", "gen/**", "go.mod", "go.sum", "hack/**", "server/**", "templates/**", "internal/**", "cmd/**", "api/**", "config/**", "test/**", "CONTRIBUTING.md", "PROJECT", "mkdocs.yml", ".dockerignore", ".golangci.yml", "REUSE.toml"] | ||
| path = [".github/**", ".gitignore", "CODEOWNERS", "Dockerfile", "Makefile", "PROJECT", "config/**", "dist/**", "dist/**", "gen/**", "go.mod", "go.sum", "hack/**", "server/**", "templates/**", "internal/**", "cmd/**", "api/**", "config/**", "test/**", "CONTRIBUTING.md", "PROJECT", "mkdocs.yml", ".dockerignore", ".golangci.yml", "REUSE.toml"] | ||
| precedence = "aggregate" | ||
| SPDX-FileCopyrightText = "2025 SAP SE or an SAP affiliate company and IronCore contributors" | ||
| SPDX-License-Identifier = "Apache-2.0" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Patterns to ignore when building Helm packages. | ||
| # Operating system files | ||
| .DS_Store | ||
|
|
||
| # Version control directories | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
|
|
||
| # Backup and temporary files | ||
| *.swp | ||
| *.tmp | ||
| *.bak | ||
| *.orig | ||
| *~ | ||
|
|
||
| # IDE and editor-related files | ||
| .idea/ | ||
| .vscode/ | ||
|
|
||
| # Helm chart artifacts | ||
| dist/chart/*.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: v2 | ||
| name: boot-operator | ||
| description: A Helm chart to distribute the project boot-operator | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "0.1.0" | ||
| icon: "https://example.com/icon.png" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| {{- define "chart.name" -}} | ||
| {{- if .Chart }} | ||
| {{- if .Chart.Name }} | ||
| {{- .Chart.Name | trunc 63 | trimSuffix "-" }} | ||
| {{- else if .Values.nameOverride }} | ||
| {{ .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| boot-operator | ||
| {{- end }} | ||
| {{- else }} | ||
| boot-operator | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
|
|
||
| {{- define "chart.labels" -}} | ||
| {{- if .Chart.AppVersion -}} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| {{- if .Chart.Version }} | ||
| helm.sh/chart: {{ .Chart.Version | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/name: {{ include "chart.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
|
|
||
| {{- define "chart.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "chart.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
|
|
||
| {{- define "chart.hasMutatingWebhooks" -}} | ||
| {{- $hasMutating := false }} | ||
| {{- range . }} | ||
| {{- if eq .type "mutating" }} | ||
| $hasMutating = true }}{{- end }} | ||
| {{- end }} | ||
| {{ $hasMutating }}}}{{- end }} | ||
|
|
||
|
|
||
| {{- define "chart.hasValidatingWebhooks" -}} | ||
| {{- $hasValidating := false }} | ||
| {{- range . }} | ||
| {{- if eq .type "validating" }} | ||
| $hasValidating = true }}{{- end }} | ||
| {{- end }} | ||
| {{ $hasValidating }}}}{{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| {{- if .Values.certmanager.enable }} | ||
| # Self-signed Issuer | ||
| apiVersion: cert-manager.io/v1 | ||
| kind: Issuer | ||
| metadata: | ||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| name: selfsigned-issuer | ||
| namespace: {{ .Release.Namespace }} | ||
| spec: | ||
| selfSigned: {} | ||
| {{- if .Values.webhook.enable }} | ||
| --- | ||
| # Certificate for the webhook | ||
| apiVersion: cert-manager.io/v1 | ||
| kind: Certificate | ||
| metadata: | ||
| annotations: | ||
| {{- if .Values.crd.keep }} | ||
| "helm.sh/resource-policy": keep | ||
| {{- end }} | ||
| name: serving-cert | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| spec: | ||
| dnsNames: | ||
| - boot-operator.{{ .Release.Namespace }}.svc | ||
| - boot-operator.{{ .Release.Namespace }}.svc.cluster.local | ||
| - boot-operator-webhook-service.{{ .Release.Namespace }}.svc | ||
| issuerRef: | ||
| kind: Issuer | ||
| name: selfsigned-issuer | ||
| secretName: webhook-server-cert | ||
| {{- end }} | ||
| {{- if .Values.metrics.enable }} | ||
| --- | ||
| # Certificate for the metrics | ||
| apiVersion: cert-manager.io/v1 | ||
| kind: Certificate | ||
| metadata: | ||
| annotations: | ||
| {{- if .Values.crd.keep }} | ||
| "helm.sh/resource-policy": keep | ||
| {{- end }} | ||
| labels: | ||
| {{- include "chart.labels" . | nindent 4 }} | ||
| name: metrics-certs | ||
| namespace: {{ .Release.Namespace }} | ||
| spec: | ||
| dnsNames: | ||
| - boot-operator.{{ .Release.Namespace }}.svc | ||
| - boot-operator.{{ .Release.Namespace }}.svc.cluster.local | ||
| - boot-operator-metrics-service.{{ .Release.Namespace }}.svc | ||
| issuerRef: | ||
| kind: Issuer | ||
| name: selfsigned-issuer | ||
| secretName: metrics-server-cert | ||
| {{- end }} | ||
| {{- end }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this list on every line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, Eg, https://github.com/ironcore-dev/metal-operator/blob/main/REUSE.toml#L8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done