Remove goreleaser and fix helm packaging (#6)

Goreleaser was causing issues when helm chart action created releases
for packaged helm chart, this PR replaces goreleaser with a much simpler
build and push model, and returns packaged helm charts to normal.
This commit is contained in:
M. Essam
2025-03-05 09:03:04 +01:00
committed by GitHub
parent 3716e5daba
commit cea60745d2
22 changed files with 238 additions and 346 deletions
+30 -44
View File
@@ -8,13 +8,8 @@ on:
- main
pull_request:
env:
GORELEASER_VER: "v2.3.2"
jobs:
release:
env:
flags: ""
runs-on: ubuntu-latest
permissions:
contents: read
@@ -24,51 +19,42 @@ jobs:
id-token: write
steps:
- name: Parse semver string
id: semver_parser
uses: booxmedialtd/ws-action-parse-semver@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
input_string: ${{ (startsWith(github.ref, 'refs/tags/v') && github.ref) || 'refs/tags/v0.0.0' }}
version_extractor_regex: '\/v(.*)$'
# list of Docker images to use as base name for tags
images: |
netbirdio/kubernetes-operator
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}}
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "flags=--snapshot" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # It is required for GoReleaser to work properly
- name: Install modules
run: go mod tidy
- name: check git status
run: git --no-pager diff --exit-code
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Login to Docker hub
- name: Login to Docker Hub
if: github.repository == github.event.pull_request.head.repo.full_name || !github.head_ref
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Install OS build dependencies
run: sudo apt update && sudo apt install -y -q gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Install goversioninfo
run: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@233067e
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
version: ${{ env.GORELEASER_VER }}
args: release --clean ${{ env.flags }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
"org.opencontainers.image.created={{.Date}}"
"org.opencontainers.image.title={{.ProjectName}}"
"org.opencontainers.image.version={{.Version}}"
"org.opencontainers.image.revision={{.FullCommit}}"
"org.opencontainers.image.version={{.Version}}"
"maintainer=dev@netbird.io"
+14 -38
View File
@@ -4,7 +4,7 @@ on:
push:
paths:
# update this file to trigger helm chart release
- 'helm/netbird-operator/Chart.yaml'
- 'helm/kubernetes-operator/Chart.yaml'
branches:
- main
@@ -18,49 +18,25 @@ jobs:
contents: write
pages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Set ENVs
id: env-setup
- name: Configure Git
run: |
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Package Charts
run: |
# Package charts
mkdir -p charts/.ci-build
echo "Setting chart version to ${{ steps.env-setup.outputs.CHART_VERSION }}"
for DIR in $CHART_BASE_DIR/*; do
# Check if Chart.yaml exists in this directory
if [ -f "${DIR}/Chart.yaml" ]; then
echo "Packaging ${DIR}"
helm dependency update $DIR
helm lint $DIR
helm package $DIR --destination charts/.ci-build
fi
done
git fetch --all
- name: Upload chart artifacts
uses: actions/upload-artifact@v4
- name: Install Helm
uses: azure/setup-helm@v3.4
with:
name: helm-charts-${{ github.ref_name }}
path: charts/.ci-build/*
retention-days: 30
version: v3.4.2
- name: Publish to GH-Pages
id: ghpublish
run: |
git checkout $GH_PAGES_BRANCH --force
helm repo index charts/.ci-build/ --merge index.yaml --url ${{ github.server_url }}/${{github.repository}}/releases/download/${{ github.ref_name }}
cp charts/.ci-build/index.yaml index.yaml
echo "New index:" && cat index.yaml
git add index.yaml charts
git commit -a -m "bot: update pages index for helm charts"
git push origin $GH_PAGES_BRANCH
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.4.1
with:
charts_dir: helm
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "helm-v{{ .Version }}"
+2 -2
View File
@@ -44,7 +44,7 @@ jobs:
- name: Lint Helm Chart
run: |
helm lint ./helm/netbird-operator
helm lint ./helm/kubernetes-operator
- name: Install cert-manager via Helm
run: |
@@ -60,7 +60,7 @@ jobs:
- name: Install Helm chart for project
run: |
helm install test-chart --create-namespace --namespace netbird --set 'operator.image.tag=debug' ./helm/netbird-operator
helm install test-chart --create-namespace --namespace netbird --set 'operator.image.tag=debug' ./helm/kubernetes-operator
- name: Check Helm release status
run: |
-86
View File
@@ -1,86 +0,0 @@
version: 2
project_name: kubernetes-operator
release:
disable: true
builds:
- id: manager
dir: cmd
binary: manager
env: [CGO_ENABLED=0]
goos:
- linux
goarch:
- arm
- amd64
- arm64
ldflags:
- -s -w
mod_timestamp: "{{ .CommitTimestamp }}"
dockers:
- image_templates:
- netbirdio/kubernetes-operator:{{ .Version }}-amd64
ids:
- manager
goarch: amd64
dockerfile: Dockerfile.release
use: buildx
skip_push: false
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=maintainer=dev@netbird.io"
- image_templates:
- netbirdio/kubernetes-operator:{{ .Version }}-arm64v8
ids:
- manager
goarch: arm64
dockerfile: Dockerfile.release
use: buildx
skip_push: false
build_flag_templates:
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=maintainer=dev@netbird.io"
- image_templates:
- netbirdio/kubernetes-operator:{{ .Version }}-arm
ids:
- manager
goarch: arm
goarm: 6
dockerfile: Dockerfile.release
use: buildx
skip_push: false
build_flag_templates:
- "--platform=linux/arm"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=maintainer=dev@netbird.io"
docker_manifests:
- name_template: netbirdio/kubernetes-operator:{{ .Version }}
skip_push: false
image_templates:
- netbirdio/kubernetes-operator:{{ .Version }}-arm64v8
- netbirdio/kubernetes-operator:{{ .Version }}-arm
- netbirdio/kubernetes-operator:{{ .Version }}-amd64
- name_template: netbirdio/kubernetes-operator:latest
image_templates:
- netbirdio/kubernetes-operator:{{ .Version }}-arm64v8
- netbirdio/kubernetes-operator:{{ .Version }}-arm
- netbirdio/kubernetes-operator:{{ .Version }}-amd64
+6 -6
View File
@@ -43,7 +43,7 @@ help: ## Display this help.
.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=helm/netbird-operator/crds
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=helm/kubernetes-operator/crds
.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -126,7 +126,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
.PHONY: build-installer
build-installer: manifests ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p manifests
$(HELM) template --include-crds netbird-operator helm/netbird-operator > manifests/install.yaml
$(HELM) template --include-crds kubernetes-operator helm/kubernetes-operator > manifests/install.yaml
##@ Deployment
@@ -136,19 +136,19 @@ endif
.PHONY: install
install: manifests ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUBECTL) apply -f helm/netbird-operator/crds
$(KUBECTL) apply -f helm/kubernetes-operator/crds
.PHONY: uninstall
uninstall: manifests ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUBECTL) delete -f helm/netbird-operator/crds
$(KUBECTL) delete -f helm/kubernetes-operator/crds
.PHONY: deploy
deploy: manifests ## Deploy controller to the K8s cluster specified in ~/.kube/config.
$(HELM) install -n netbird --create-namespace netbird-operator --set operator.image.tag=$(word 2,$(subst :, ,${IMG})) helm/netbird-operator
$(HELM) install -n netbird --create-namespace kubernetes-operator --set operator.image.tag=$(word 2,$(subst :, ,${IMG})) helm/kubernetes-operator
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(HELM) uninstall -n netbird netbird-operator
$(HELM) uninstall -n netbird kubernetes-operator
##@ Dependencies
+3 -3
View File
@@ -26,12 +26,12 @@ kubectl apply -n netbird -f https://github.com/netbirdio/kubernetes-operator/rel
```sh
helm repo add netbirdio https://netbirdio.github.io/kubernetes-operator
helm install -n netbird netbird-operator netbirdio/netbird-operator
helm install -n netbird kubernetes-operator netbirdio/kubernetes-operator
```
For more options, check the default values by running
```sh
helm show values netbirdio/netbird-operator
helm show values netbirdio/kubernetes-operator
```
### To Uninstall
@@ -45,7 +45,7 @@ kubectl delete namespace netbird
**Using helm**
```sh
helm uninstall -n netbird netbird-operator
helm uninstall -n netbird kubernetes-operator
```
### Provision pods with NetBird access
@@ -1,5 +1,5 @@
apiVersion: v2
name: netbird-operator
name: kubernetes-operator
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
@@ -0,0 +1,16 @@
netbirdAPI:
key: "nbp_1TpgsCUaF2BU3NVZfaDrGpoY1jx2iT2g7rWj"
operator:
image:
tag: "v0.1.0"
ingress:
enabled: true
router:
enabled: true
policies:
default:
name: Kubernetes Default Policy
sourceGroups:
- All
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "netbird-operator.name" -}}
{{- define "kubernetes-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
@@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "netbird-operator.fullname" -}}
{{- define "kubernetes-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "netbird-operator.chart" -}}
{{- define "kubernetes-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "netbird-operator.labels" -}}
helm.sh/chart: {{ include "netbird-operator.chart" . }}
{{ include "netbird-operator.selectorLabels" . }}
{{- define "kubernetes-operator.labels" -}}
helm.sh/chart: {{ include "kubernetes-operator.chart" . }}
{{ include "kubernetes-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "netbird-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "netbird-operator.name" . }}
{{- define "kubernetes-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubernetes-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "netbird-operator.serviceAccountName" -}}
{{- define "kubernetes-operator.serviceAccountName" -}}
{{- if .Values.operator.serviceAccount.create }}
{{- default (include "netbird-operator.fullname" .) .Values.operator.serviceAccount.name }}
{{- default (include "kubernetes-operator.fullname" .) .Values.operator.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.operator.serviceAccount.name }}
{{- end }}
@@ -65,23 +65,23 @@ Create the name of the service account to use
{{/*
Create the name of the webhook service
*/}}
{{- define "netbird-operator.webhookService" -}}
{{- printf "%s-webhook-service" (include "netbird-operator.fullname" .) -}}
{{- define "kubernetes-operator.webhookService" -}}
{{- printf "%s-webhook-service" (include "kubernetes-operator.fullname" .) -}}
{{- end -}}
{{/*
Create the name of the webhook cert secret
*/}}
{{- define "netbird-operator.webhookCertSecret" -}}
{{- printf "%s-tls" (include "netbird-operator.fullname" .) -}}
{{- define "kubernetes-operator.webhookCertSecret" -}}
{{- printf "%s-tls" (include "kubernetes-operator.fullname" .) -}}
{{- end -}}
{{/*
Generate certificates for webhook
*/}}
{{- define "netbird-operator.webhookCerts" -}}
{{- $serviceName := (include "netbird-operator.webhookService" .) -}}
{{- $secretName := (include "netbird-operator.webhookCertSecret" .) -}}
{{- define "kubernetes-operator.webhookCerts" -}}
{{- $serviceName := (include "kubernetes-operator.webhookService" .) -}}
{{- $secretName := (include "kubernetes-operator.webhookCertSecret" .) -}}
{{- $secret := lookup "v1" "Secret" .Release.Namespace $secretName -}}
{{- if (and .Values.webhook.tls.caCert .Values.webhook.tls.cert .Values.webhook.tls.key) -}}
caCert: {{ .Values.webhook.tls.caCert | b64enc }}
@@ -93,8 +93,8 @@ clientCert: {{ index $secret.data "tls.crt" }}
clientKey: {{ index $secret.data "tls.key" }}
{{- else -}}
{{- $altNames := list (printf "%s.%s" $serviceName .Release.Namespace) (printf "%s.%s.svc" $serviceName .Release.Namespace) (printf "%s.%s.svc.%s" $serviceName .Release.Namespace .Values.webhook.cluster.dnsDomain) -}}
{{- $ca := genCA "netbird-operator-ca" 3650 -}}
{{- $cert := genSignedCert (include "netbird-operator.fullname" .) nil $altNames 3650 $ca -}}
{{- $ca := genCA "kubernetes-operator-ca" 3650 -}}
{{- $cert := genSignedCert (include "kubernetes-operator.fullname" .) nil $altNames 3650 $ca -}}
caCert: {{ $ca.Cert | b64enc }}
clientCert: {{ $cert.Cert | b64enc }}
clientKey: {{ $cert.Key | b64enc }}
@@ -1,15 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "netbird-operator.fullname" . }}
name: {{ include "kubernetes-operator.fullname" . }}
labels:
app.kubernetes.io/component: operator
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.operator.replicaCount }}
selector:
matchLabels:
{{- include "netbird-operator.selectorLabels" . | nindent 6 }}
{{- include "kubernetes-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.operator.podAnnotations }}
@@ -18,7 +18,7 @@ spec:
{{- end }}
labels:
app.kubernetes.io/component: operator
{{- include "netbird-operator.labels" . | nindent 8 }}
{{- include "kubernetes-operator.labels" . | nindent 8 }}
{{- with .Values.operator.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -27,7 +27,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "netbird-operator.serviceAccountName" . }}
serviceAccountName: {{ include "kubernetes-operator.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.operator.podSecurityContext | nindent 8 }}
containers:
@@ -85,7 +85,7 @@ spec:
- name: webhook-certs
secret:
defaultMode: 420
secretName: {{ template "netbird-operator.webhookCertSecret" . }}
secretName: {{ template "kubernetes-operator.webhookCertSecret" . }}
{{- with .Values.operator.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -1,9 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "netbird-operator.fullname" . }}
name: {{ include "kubernetes-operator.fullname" . }}
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- netbird.io
@@ -49,24 +49,24 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "netbird-operator.fullname" . }}
name: {{ include "kubernetes-operator.fullname" . }}
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "netbird-operator.fullname" . }}
name: {{ include "kubernetes-operator.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "netbird-operator.serviceAccountName" . }}
name: {{ include "kubernetes-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "netbird-operator.fullname" . }}
name: {{ include "kubernetes-operator.fullname" . }}
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
@@ -103,14 +103,14 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "netbird-operator.fullname" . }}
name: {{ include "kubernetes-operator.fullname" . }}
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "netbird-operator.fullname" . }}
name: {{ include "kubernetes-operator.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "netbird-operator.serviceAccountName" . }}
name: {{ include "kubernetes-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
@@ -2,9 +2,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "netbird-operator.fullname" . }}-metrics
name: {{ include "kubernetes-operator.fullname" . }}-metrics
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
spec:
type: {{ .Values.operator.metrics.type }}
ports:
@@ -13,15 +13,15 @@ spec:
protocol: TCP
targetPort: {{ .Values.operator.metrics.port }}
selector:
{{- include "netbird-operator.selectorLabels" . | nindent 4 }}
{{- include "kubernetes-operator.selectorLabels" . | nindent 4 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "netbird-operator.webhookService" . }}
name: {{ include "kubernetes-operator.webhookService" . }}
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
spec:
type: {{ .Values.webhook.service.type }}
ports:
@@ -30,4 +30,4 @@ spec:
protocol: TCP
targetPort: {{ .Values.webhook.service.targetPort }}
selector:
{{- include "netbird-operator.selectorLabels" . | nindent 4 }}
{{- include "kubernetes-operator.selectorLabels" . | nindent 4 }}
@@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "netbird-operator.serviceAccountName" . }}
name: {{ include "kubernetes-operator.serviceAccountName" . }}
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
{{- with .Values.operator.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
@@ -1,22 +1,22 @@
{{ $tls := fromYaml ( include "netbird-operator.webhookCerts" . ) }}
{{ $tls := fromYaml ( include "kubernetes-operator.webhookCerts" . ) }}
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
{{- if $.Values.webhook.enableCertManager }}
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "netbird-operator.fullname" . }}-serving-cert
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "kubernetes-operator.fullname" . }}-serving-cert
{{- end }}
name: {{ include "netbird-operator.fullname" . }}-mpod-webhook
name: {{ include "kubernetes-operator.fullname" . }}-mpod-webhook
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
webhooks:
- clientConfig:
{{- if not $.Values.webhook.enableCertManager -}}
caBundle: {{ $tls.caCert }}
{{ end }}
service:
name: {{ template "netbird-operator.webhookService" . }}
name: {{ template "kubernetes-operator.webhookService" . }}
namespace: {{ $.Release.Namespace }}
path: /mutate--v1-pod
failurePolicy: Fail
@@ -33,7 +33,7 @@ webhooks:
- key: app.kubernetes.io/name
operator: NotIn
values:
- {{ include "netbird-operator.name" . }}
- {{ include "kubernetes-operator.name" . }}
{{- if .Values.webhook.objectSelector.matchExpressions }}
{{- toYaml .Values.webhook.objectSelector.matchExpressions | nindent 4 }}
{{- end }}
@@ -57,18 +57,18 @@ kind: ValidatingWebhookConfiguration
metadata:
{{- if $.Values.webhook.enableCertManager }}
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "netbird-operator.fullname" . }}-serving-cert
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "kubernetes-operator.fullname" . }}-serving-cert
{{- end }}
name: {{ include "netbird-operator.fullname" . }}-vnbsetupkey-webhook
name: {{ include "kubernetes-operator.fullname" . }}-vnbsetupkey-webhook
labels:
{{- include "netbird-operator.labels" . | nindent 4 }}
{{- include "kubernetes-operator.labels" . | nindent 4 }}
webhooks:
- clientConfig:
{{- if not $.Values.webhook.enableCertManager -}}
caBundle: {{ $tls.caCert }}
{{ end }}
service:
name: {{ template "netbird-operator.webhookService" . }}
name: {{ template "kubernetes-operator.webhookService" . }}
namespace: {{ $.Release.Namespace }}
path: /validate-netbird-io-v1-nbsetupkey
failurePolicy: Fail
@@ -96,10 +96,10 @@ webhooks:
apiVersion: v1
kind: Secret
metadata:
name: {{ template "netbird-operator.webhookCertSecret" . }}
name: {{ template "kubernetes-operator.webhookCertSecret" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "netbird-operator.labels" . | indent 4 }}
{{ include "kubernetes-operator.labels" . | indent 4 }}
type: kubernetes.io/tls
data:
ca.crt: {{ $tls.caCert }}
@@ -109,26 +109,26 @@ data:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ template "netbird-operator.fullname" . }}-serving-cert
name: {{ template "kubernetes-operator.fullname" . }}-serving-cert
namespace: {{ .Release.Namespace }}
labels:
{{ include "netbird-operator.labels" . | indent 4 }}
{{ include "kubernetes-operator.labels" . | indent 4 }}
spec:
dnsNames:
- {{ template "netbird-operator.webhookService" . }}.{{ .Release.Namespace }}.svc
- {{ template "netbird-operator.webhookService" . }}.{{ .Release.Namespace }}.svc.{{ .Values.webhook.cluster.dnsDomain }}
- {{ template "kubernetes-operator.webhookService" . }}.{{ .Release.Namespace }}.svc
- {{ template "kubernetes-operator.webhookService" . }}.{{ .Release.Namespace }}.svc.{{ .Values.webhook.cluster.dnsDomain }}
issuerRef:
kind: Issuer
name: {{ template "netbird-operator.fullname" . }}-selfsigned-issuer
secretName: {{ template "netbird-operator.webhookCertSecret" . }}
name: {{ template "kubernetes-operator.fullname" . }}-selfsigned-issuer
secretName: {{ template "kubernetes-operator.webhookCertSecret" . }}
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ template "netbird-operator.fullname" . }}-selfsigned-issuer
name: {{ template "kubernetes-operator.fullname" . }}-selfsigned-issuer
namespace: {{ .Release.Namespace }}
labels:
{{ include "netbird-operator.labels" . | indent 4 }}
{{ include "kubernetes-operator.labels" . | indent 4 }}
spec:
selfSigned: {}
{{- end }}
+1 -1
View File
@@ -66,7 +66,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "helm", "netbird-operator", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "helm", "kubernetes-operator", "crds")},
ErrorIfCRDPathMissing: true,
}
+1 -1
View File
@@ -82,7 +82,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "helm", "netbird-operator", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "helm", "kubernetes-operator", "crds")},
ErrorIfCRDPathMissing: false,
// WebhookInstallOptions: envtest.WebhookInstallOptions{

Some files were not shown because too many files have changed in this diff Show More