mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Rename Helm chart and Docker image and move to GHCR (#233)
This change does a few things, none of these are breaking. It changes the registry from Docker Hub to GHCR, as we dont have the same rate limiting issues with unauthenticated pulls. It changes the release process to push the Helm chart as an OCI artifact removing the need for GH pages. It renames both the image and chart from kubernetes-operator to netbird-operator. This name is cleaner and easier for people to understand in a sea of Helm charts. Funnily enough this is not a breaking change as the release name is used and not the chart name. So in place upgrades just work. Fixes #207 Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
@@ -8,4 +8,4 @@ jobs:
|
|||||||
- name: Clone the code
|
- name: Clone the code
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
||||||
- name: Lint Helm Chart
|
- name: Lint Helm Chart
|
||||||
run: helm lint ./helm/kubernetes-operator
|
run: helm lint ./charts/netbird-operator
|
||||||
|
|||||||
@@ -3,15 +3,16 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
branches:
|
permissions:
|
||||||
- main
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
id-token: write
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone the code
|
- name: Clone the code
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
||||||
@@ -19,23 +20,41 @@ jobs:
|
|||||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
- name: Set up Docker
|
||||||
|
uses: docker/setup-docker-action@b2189fbf2a6592b51fee7cdd93ee2bfaeba733db #v5.1.0
|
||||||
|
with:
|
||||||
|
daemon-config: |
|
||||||
|
{
|
||||||
|
"features": {
|
||||||
|
"containerd-snapshotter": true
|
||||||
|
}
|
||||||
|
}
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #v4.0.0
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #v4.0.0
|
||||||
- name: Login to Docker Hub
|
with:
|
||||||
|
driver: docker
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #v4.1.0
|
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #v4.1.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
registry: ghcr.io
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
username: ${{ github.repository_owner }}
|
||||||
- name: Build image
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
id: build
|
- name: Prepare versions
|
||||||
|
id: prep
|
||||||
run: |
|
run: |
|
||||||
|
IMG_TAG="${GITHUB_REF_NAME}"
|
||||||
if [[ "${{ github.ref_type }}" == "tag" ]]; then
|
if [[ "${{ github.ref_type }}" == "tag" ]]; then
|
||||||
IMG_TAG="${GITHUB_REF_NAME#v}"
|
HELM_VERSION=${GITHUB_REF_NAME#v}
|
||||||
else
|
else
|
||||||
IMG_TAG="${GITHUB_SHA::7}"
|
HELM_VERSION="0.0.0-${GITHUB_REF_NAME}"
|
||||||
fi
|
fi
|
||||||
IMG=$(make build-image-multiarch) || exit 1
|
echo "IMG_TAG=${IMG_TAG}" >> $GITHUB_OUTPUT
|
||||||
echo "IMG=${IMG}" >> $GITHUB_OUTPUT
|
echo "HELM_VERSION=${HELM_VERSION}" >> $GITHUB_OUTPUT
|
||||||
- name: Push image
|
- name: Build and push image
|
||||||
run: |
|
run: |
|
||||||
docker push ${{ steps.build.outputs.IMG }}
|
IMG_REF=$(make build-image-multiarch IMG_REPOSITORY=${{ github.repository_owner }}/netbird-operator IMG_TAG=${{ steps.prep.outputs.IMG_TAG }}) || exit 1
|
||||||
|
docker push ${IMG_REF}
|
||||||
|
- name: Build and push Helm chart
|
||||||
|
run: |
|
||||||
|
helm package --app-version ${{ steps.prep.outputs.IMG_TAG }} --version ${{ steps.prep.outputs.HELM_VERSION }} charts/netbird-operator
|
||||||
|
helm push netbird-operator-${{ steps.prep.outputs.HELM_VERSION }}.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
|
||||||
|
|||||||
+3
-3
@@ -2,10 +2,10 @@ FROM gcr.io/distroless/static:nonroot
|
|||||||
ARG TARGETOS
|
ARG TARGETOS
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
LABEL org.opencontainers.image.title="NetBird Operator" \
|
LABEL org.opencontainers.image.title="NetBird Operator" \
|
||||||
org.opencontainers.image.description="Kubernetes operator for NetBird." \
|
org.opencontainers.image.description="Kubernetes operator for NetBird" \
|
||||||
org.opencontainers.image.source="https://github.com/netbirdio/kubernetes-operator" \
|
org.opencontainers.image.source="https://github.com/netbirdio/kubernetes-operator" \
|
||||||
org.opencontainers.image.vendor="NetBird" \
|
org.opencontainers.image.vendor="NetBird" \
|
||||||
org.opencontainers.image.licenses="BSD-3-Clause"
|
org.opencontainers.image.licenses="BSD-3-Clause"
|
||||||
COPY bin/${TARGETOS}-${TARGETARCH}/netbird-operator .
|
COPY bin/${TARGETOS}-${TARGETARCH}/netbird-operator /usr/local/bin/
|
||||||
USER 65532:65532
|
USER 65532:65532
|
||||||
ENTRYPOINT ["/netbird-operator"]
|
ENTRYPOINT ["netbird-operator"]
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ else
|
|||||||
GOBIN = $(shell go env GOBIN)
|
GOBIN = $(shell go env GOBIN)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
IMG_REGISTRY ?= docker.io
|
IMG_REGISTRY ?= ghcr.io
|
||||||
IMG_REPOSITORY ?= netbirdio/kubernetes-operator
|
IMG_REPOSITORY ?= netbirdio/netbird-operator
|
||||||
IMG_TAG ?= dev
|
IMG_TAG ?= dev
|
||||||
IMG_REF := $(IMG_REGISTRY)/$(IMG_REPOSITORY):$(IMG_TAG)
|
IMG_REF := $(IMG_REGISTRY)/$(IMG_REPOSITORY):$(IMG_TAG)
|
||||||
|
|
||||||
.PHONY: generate
|
.PHONY: generate
|
||||||
generate: api/v1/zz_generated.deepcopy.go api/v1alpha1/zz_generated.deepcopy.go pkg/applyconfigurations helm/kubernetes-operator/crds docs/api-reference.md
|
generate: api/v1/zz_generated.deepcopy.go api/v1alpha1/zz_generated.deepcopy.go pkg/applyconfigurations charts/netbird-operator/crds docs/api-reference.md
|
||||||
|
|
||||||
api/v1/zz_generated.deepcopy.go api/v1alpha1/zz_generated.deepcopy.go: $(shell find api -not -name 'zz_generated*') hack/boilerplate.go.txt
|
api/v1/zz_generated.deepcopy.go api/v1alpha1/zz_generated.deepcopy.go: $(shell find api -not -name 'zz_generated*') hack/boilerplate.go.txt
|
||||||
@go tool controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
|
@go tool controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
|
||||||
@@ -25,9 +25,9 @@ pkg/applyconfigurations: $(shell find api -not -name 'zz_generated*') hack/boile
|
|||||||
@go tool controller-gen applyconfiguration:headerFile="hack/boilerplate.go.txt" object:headerFile="hack/boilerplate.go.txt" paths="./..."
|
@go tool controller-gen applyconfiguration:headerFile="hack/boilerplate.go.txt" object:headerFile="hack/boilerplate.go.txt" paths="./..."
|
||||||
@touch pkg/applyconfigurations
|
@touch pkg/applyconfigurations
|
||||||
|
|
||||||
helm/kubernetes-operator/crds: $(shell find api)
|
charts/netbird-operator/crds: $(shell find api)
|
||||||
@go tool controller-gen crd paths="./..." output:crd:artifacts:config=helm/kubernetes-operator/crds
|
@go tool controller-gen crd paths="./..." output:crd:artifacts:config=charts/netbird-operator/crds
|
||||||
@touch helm/kubernetes-operator/crds
|
@touch charts/netbird-operator/crds
|
||||||
|
|
||||||
docs/api-reference.md: $(shell find api) docs/.crd-ref-docs.yaml
|
docs/api-reference.md: $(shell find api) docs/.crd-ref-docs.yaml
|
||||||
@go tool crd-ref-docs --log-level error --output-path docs/api-reference.md --renderer markdown --source-path api/v1alpha1 --config docs/.crd-ref-docs.yaml
|
@go tool crd-ref-docs --log-level error --output-path docs/api-reference.md --renderer markdown --source-path api/v1alpha1 --config docs/.crd-ref-docs.yaml
|
||||||
@@ -51,29 +51,29 @@ bin/linux-%/netbird-operator: $(shell find api cmd internal pkg) go.mod go.sum
|
|||||||
|
|
||||||
.PHONY: build-image
|
.PHONY: build-image
|
||||||
build-image: build
|
build-image: build
|
||||||
@docker buildx build -t ${IMG_REF} .
|
@DOCKER_BUILDKIT=1 docker build -t ${IMG_REF} .
|
||||||
@echo ${IMG_REF}
|
@echo ${IMG_REF}
|
||||||
|
|
||||||
.PHONY: build-image-multiarch
|
.PHONY: build-image-multiarch
|
||||||
build-image-multiarch: generate bin/linux-amd64/netbird-operator bin/linux-arm64/netbird-operator
|
build-image-multiarch: generate bin/linux-amd64/netbird-operator bin/linux-arm64/netbird-operator
|
||||||
@docker buildx build --platform linux/amd64,linux/arm64 -t ${IMG_REF} .
|
@DOCKER_BUILDKIT=1 docker build --platform linux/amd64,linux/arm64 -t ${IMG_REF} .
|
||||||
@echo ${IMG_REF}
|
@echo ${IMG_REF}
|
||||||
|
|
||||||
## Generate a consolidated YAML with CRDs and deployment.
|
## Generate a consolidated YAML with CRDs and deployment.
|
||||||
.PHONY: build-installer
|
.PHONY: build-installer
|
||||||
build-installer: generate
|
build-installer: generate
|
||||||
mkdir -p manifests
|
mkdir -p manifests
|
||||||
helm template --include-crds kubernetes-operator helm/kubernetes-operator > manifests/install.yaml
|
helm template --include-crds netbird-operator charts/netbird-operator > manifests/install.yaml
|
||||||
|
|
||||||
##@ Deployment
|
##@ Deployment
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: generate
|
install: generate
|
||||||
kubectl apply --server-side -f helm/kubernetes-operator/crds
|
kubectl apply --server-side -f charts/netbird-operator/crds
|
||||||
|
|
||||||
.PHONY: uninstall
|
.PHONY: uninstall
|
||||||
uninstall:
|
uninstall:
|
||||||
kubectl delete -f helm/kubernetes-operator/crds
|
kubectl delete -f charts/netbird-operator/crds
|
||||||
|
|
||||||
run: install
|
run: install
|
||||||
kubectl create namespace netbird --dry-run=client -o yaml | kubectl apply -f -
|
kubectl create namespace netbird --dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: netbird-operator
|
||||||
|
description: Kubernetes operator for NetBird
|
||||||
|
type: application
|
||||||
|
version: "0.0.0"
|
||||||
|
appVersion: ""
|
||||||
+20
-20
@@ -1,7 +1,7 @@
|
|||||||
{{/*
|
{{/*
|
||||||
Expand the name of the chart.
|
Expand the name of the chart.
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.name" -}}
|
{{- define "netbird-operator.name" -}}
|
||||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
{{- end }}
|
{{- 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).
|
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.
|
If release name contains chart name it will be used as a full name.
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.fullname" -}}
|
{{- define "netbird-operator.fullname" -}}
|
||||||
{{- if .Values.fullnameOverride }}
|
{{- if .Values.fullnameOverride }}
|
||||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
{{- else }}
|
{{- 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.
|
Create chart name and version as used by the chart label.
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.chart" -}}
|
{{- define "netbird-operator.chart" -}}
|
||||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Common labels
|
Common labels
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.labels" -}}
|
{{- define "netbird-operator.labels" -}}
|
||||||
helm.sh/chart: {{ include "kubernetes-operator.chart" . }}
|
helm.sh/chart: {{ include "netbird-operator.chart" . }}
|
||||||
{{ include "kubernetes-operator.selectorLabels" . }}
|
{{ include "netbird-operator.selectorLabels" . }}
|
||||||
{{- if .Chart.AppVersion }}
|
{{- if .Chart.AppVersion }}
|
||||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -50,17 +50,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|||||||
{{/*
|
{{/*
|
||||||
Selector labels
|
Selector labels
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.selectorLabels" -}}
|
{{- define "netbird-operator.selectorLabels" -}}
|
||||||
app.kubernetes.io/name: {{ include "kubernetes-operator.name" . }}
|
app.kubernetes.io/name: {{ include "netbird-operator.name" . }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create the name of the service account to use
|
Create the name of the service account to use
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.serviceAccountName" -}}
|
{{- define "netbird-operator.serviceAccountName" -}}
|
||||||
{{- if .Values.operator.serviceAccount.create }}
|
{{- if .Values.operator.serviceAccount.create }}
|
||||||
{{- default (include "kubernetes-operator.fullname" .) .Values.operator.serviceAccount.name }}
|
{{- default (include "netbird-operator.fullname" .) .Values.operator.serviceAccount.name }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- default "default" .Values.operator.serviceAccount.name }}
|
{{- default "default" .Values.operator.serviceAccount.name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -70,23 +70,23 @@ Create the name of the service account to use
|
|||||||
{{/*
|
{{/*
|
||||||
Create the name of the webhook service
|
Create the name of the webhook service
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.webhookService" -}}
|
{{- define "netbird-operator.webhookService" -}}
|
||||||
{{- printf "%s-webhook-service" (include "kubernetes-operator.fullname" .) -}}
|
{{- printf "%s-webhook-service" (include "netbird-operator.fullname" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create the name of the webhook cert secret
|
Create the name of the webhook cert secret
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.webhookCertSecret" -}}
|
{{- define "netbird-operator.webhookCertSecret" -}}
|
||||||
{{- printf "%s-tls" (include "kubernetes-operator.fullname" .) -}}
|
{{- printf "%s-tls" (include "netbird-operator.fullname" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Generate certificates for webhook
|
Generate certificates for webhook
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "kubernetes-operator.webhookCerts" -}}
|
{{- define "netbird-operator.webhookCerts" -}}
|
||||||
{{- $serviceName := (include "kubernetes-operator.webhookService" .) -}}
|
{{- $serviceName := (include "netbird-operator.webhookService" .) -}}
|
||||||
{{- $secretName := (include "kubernetes-operator.webhookCertSecret" .) -}}
|
{{- $secretName := (include "netbird-operator.webhookCertSecret" .) -}}
|
||||||
{{- $secret := lookup "v1" "Secret" .Release.Namespace $secretName -}}
|
{{- $secret := lookup "v1" "Secret" .Release.Namespace $secretName -}}
|
||||||
{{- if (and .Values.webhook.tls.caCert .Values.webhook.tls.cert .Values.webhook.tls.key) -}}
|
{{- if (and .Values.webhook.tls.caCert .Values.webhook.tls.cert .Values.webhook.tls.key) -}}
|
||||||
caCert: {{ .Values.webhook.tls.caCert | b64enc }}
|
caCert: {{ .Values.webhook.tls.caCert | b64enc }}
|
||||||
@@ -98,10 +98,10 @@ clientCert: {{ index $secret.data "tls.crt" }}
|
|||||||
clientKey: {{ index $secret.data "tls.key" }}
|
clientKey: {{ index $secret.data "tls.key" }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $altNames := list (printf "%s.%s" $serviceName .Release.Namespace) (printf "%s.%s.svc" $serviceName .Release.Namespace) (printf "%s.%s.%s" $serviceName .Release.Namespace .Values.cluster.dns) -}}
|
{{- $altNames := list (printf "%s.%s" $serviceName .Release.Namespace) (printf "%s.%s.svc" $serviceName .Release.Namespace) (printf "%s.%s.%s" $serviceName .Release.Namespace .Values.cluster.dns) -}}
|
||||||
{{- $ca := genCA "kubernetes-operator-ca" 3650 -}}
|
{{- $ca := genCA "netbird-operator-ca" 3650 -}}
|
||||||
{{- $cert := genSignedCert (include "kubernetes-operator.fullname" .) nil $altNames 3650 $ca -}}
|
{{- $cert := genSignedCert (include "netbird-operator.fullname" .) nil $altNames 3650 $ca -}}
|
||||||
caCert: {{ $ca.Cert | b64enc }}
|
caCert: {{ $ca.Cert | b64enc }}
|
||||||
clientCert: {{ $cert.Cert | b64enc }}
|
clientCert: {{ $cert.Cert | b64enc }}
|
||||||
clientKey: {{ $cert.Key | b64enc }}
|
clientKey: {{ $cert.Key | b64enc }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
+7
-9
@@ -1,15 +1,15 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: operator
|
app.kubernetes.io/component: operator
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.operator.replicaCount }}
|
replicas: {{ .Values.operator.replicaCount }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "kubernetes-operator.selectorLabels" . | nindent 6 }}
|
{{- include "netbird-operator.selectorLabels" . | nindent 6 }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
{{- with .Values.operator.podAnnotations }}
|
{{- with .Values.operator.podAnnotations }}
|
||||||
@@ -18,7 +18,7 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: operator
|
app.kubernetes.io/component: operator
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 8 }}
|
{{- include "netbird-operator.labels" . | nindent 8 }}
|
||||||
{{- with .Values.operator.podLabels }}
|
{{- with .Values.operator.podLabels }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -27,7 +27,7 @@ spec:
|
|||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
serviceAccountName: {{ include "kubernetes-operator.serviceAccountName" . }}
|
serviceAccountName: {{ include "netbird-operator.serviceAccountName" . }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml .Values.operator.podSecurityContext | nindent 8 }}
|
{{- toYaml .Values.operator.podSecurityContext | nindent 8 }}
|
||||||
containers:
|
containers:
|
||||||
@@ -36,8 +36,6 @@ spec:
|
|||||||
{{- toYaml .Values.operator.securityContext | nindent 12 }}
|
{{- toYaml .Values.operator.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.operator.image.registry }}/{{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag | default .Chart.AppVersion }}"
|
image: "{{ .Values.operator.image.registry }}/{{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag | default .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
|
||||||
command:
|
|
||||||
- /manager
|
|
||||||
args:
|
args:
|
||||||
{{- if .Values.operator.metrics.enabled }}
|
{{- if .Values.operator.metrics.enabled }}
|
||||||
- --metrics-bind-address=:{{ .Values.operator.metrics.port}}
|
- --metrics-bind-address=:{{ .Values.operator.metrics.port}}
|
||||||
@@ -104,7 +102,7 @@ spec:
|
|||||||
name: {{ .Values.netbirdAPI.keyFromSecret.name }}
|
name: {{ .Values.netbirdAPI.keyFromSecret.name }}
|
||||||
key: {{ .Values.netbirdAPI.keyFromSecret.key }}
|
key: {{ .Values.netbirdAPI.keyFromSecret.key }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
key: NB_API_KEY
|
key: NB_API_KEY
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -131,7 +129,7 @@ spec:
|
|||||||
- name: webhook-certs
|
- name: webhook-certs
|
||||||
secret:
|
secret:
|
||||||
defaultMode: 420
|
defaultMode: 420
|
||||||
secretName: {{ template "kubernetes-operator.webhookCertSecret" . }}
|
secretName: {{ template "netbird-operator.webhookCertSecret" . }}
|
||||||
{{- with .Values.operator.volumes }}
|
{{- with .Values.operator.volumes }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
+2
-2
@@ -4,7 +4,7 @@ kind: GatewayClass
|
|||||||
metadata:
|
metadata:
|
||||||
name: netbird-private
|
name: netbird-private
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
controllerName: "gateway.netbird.io/controller"
|
controllerName: "gateway.netbird.io/controller"
|
||||||
---
|
---
|
||||||
@@ -13,7 +13,7 @@ kind: GatewayClass
|
|||||||
metadata:
|
metadata:
|
||||||
name: netbird-public
|
name: netbird-public
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
controllerName: "gateway.netbird.io/controller"
|
controllerName: "gateway.netbird.io/controller"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
+2
-2
@@ -7,7 +7,7 @@ metadata:
|
|||||||
- netbird.io/cleanup
|
- netbird.io/cleanup
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: operator
|
app.kubernetes.io/component: operator
|
||||||
{{- include "kubernetes-operator.labels" $ | nindent 4 }}
|
{{- include "netbird-operator.labels" $ | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
helm.sh/resource-policy: keep
|
helm.sh/resource-policy: keep
|
||||||
name: {{ $k }}
|
name: {{ $k }}
|
||||||
@@ -29,4 +29,4 @@ spec:
|
|||||||
{{- if hasKey $v "bidirectional" }}
|
{{- if hasKey $v "bidirectional" }}
|
||||||
bidirectional: {{ $v.bidirectional }}
|
bidirectional: {{ $v.bidirectional }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
+3
-3
@@ -9,7 +9,7 @@ metadata:
|
|||||||
- netbird.io/cleanup
|
- netbird.io/cleanup
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: operator
|
app.kubernetes.io/component: operator
|
||||||
{{- include "kubernetes-operator.labels" $ | nindent 4 }}
|
{{- include "netbird-operator.labels" $ | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
helm.sh/resource-policy: keep
|
helm.sh/resource-policy: keep
|
||||||
name: router
|
name: router
|
||||||
@@ -52,7 +52,7 @@ metadata:
|
|||||||
- netbird.io/cleanup
|
- netbird.io/cleanup
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: operator
|
app.kubernetes.io/component: operator
|
||||||
{{- include "kubernetes-operator.labels" $ | nindent 4 }}
|
{{- include "netbird-operator.labels" $ | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
helm.sh/resource-policy: keep
|
helm.sh/resource-policy: keep
|
||||||
name: router
|
name: router
|
||||||
@@ -86,4 +86,4 @@ spec: {}
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
+12
-12
@@ -1,9 +1,9 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- netbird.io
|
- netbird.io
|
||||||
@@ -164,24 +164,24 @@ rules:
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "kubernetes-operator.serviceAccountName" . }}
|
name: {{ include "netbird-operator.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- ""
|
- ""
|
||||||
@@ -218,14 +218,14 @@ rules:
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
kind: Role
|
kind: Role
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "netbird-operator.fullname" . }}
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: {{ include "kubernetes-operator.serviceAccountName" . }}
|
name: {{ include "netbird-operator.serviceAccountName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
+6
-6
@@ -2,9 +2,9 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}-metrics
|
name: {{ include "netbird-operator.fullname" . }}-metrics
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.operator.metrics.type }}
|
type: {{ .Values.operator.metrics.type }}
|
||||||
ports:
|
ports:
|
||||||
@@ -13,15 +13,15 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
targetPort: {{ .Values.operator.metrics.port }}
|
targetPort: {{ .Values.operator.metrics.port }}
|
||||||
selector:
|
selector:
|
||||||
{{- include "kubernetes-operator.selectorLabels" . | nindent 4 }}
|
{{- include "netbird-operator.selectorLabels" . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.webhookService" . }}
|
name: {{ include "netbird-operator.webhookService" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.webhook.service.type }}
|
type: {{ .Values.webhook.service.type }}
|
||||||
ports:
|
ports:
|
||||||
@@ -30,4 +30,4 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
targetPort: {{ .Values.webhook.service.targetPort }}
|
targetPort: {{ .Values.webhook.service.targetPort }}
|
||||||
selector:
|
selector:
|
||||||
{{- include "kubernetes-operator.selectorLabels" . | nindent 4 }}
|
{{- include "netbird-operator.selectorLabels" . | nindent 4 }}
|
||||||
+2
-2
@@ -2,9 +2,9 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "kubernetes-operator.serviceAccountName" . }}
|
name: {{ include "netbird-operator.serviceAccountName" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
{{- with .Values.operator.serviceAccount.annotations }}
|
{{- with .Values.operator.serviceAccount.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
+20
-20
@@ -1,22 +1,22 @@
|
|||||||
{{ $tls := fromYaml ( include "kubernetes-operator.webhookCerts" . ) }}
|
{{ $tls := fromYaml ( include "netbird-operator.webhookCerts" . ) }}
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: MutatingWebhookConfiguration
|
kind: MutatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
{{- if $.Values.webhook.enableCertManager }}
|
{{- if $.Values.webhook.enableCertManager }}
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "kubernetes-operator.fullname" . }}-serving-cert
|
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "netbird-operator.fullname" . }}-serving-cert
|
||||||
{{- end }}
|
{{- end }}
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}-mpod-webhook
|
name: {{ include "netbird-operator.fullname" . }}-mpod-webhook
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
webhooks:
|
webhooks:
|
||||||
- clientConfig:
|
- clientConfig:
|
||||||
{{- if not $.Values.webhook.enableCertManager }}
|
{{- if not $.Values.webhook.enableCertManager }}
|
||||||
caBundle: {{ $tls.caCert }}
|
caBundle: {{ $tls.caCert }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
service:
|
service:
|
||||||
name: {{ template "kubernetes-operator.webhookService" . }}
|
name: {{ template "netbird-operator.webhookService" . }}
|
||||||
namespace: {{ $.Release.Namespace }}
|
namespace: {{ $.Release.Namespace }}
|
||||||
path: /mutate--v1-pod
|
path: /mutate--v1-pod
|
||||||
failurePolicy: {{ .Values.webhook.failurePolicy }}
|
failurePolicy: {{ .Values.webhook.failurePolicy }}
|
||||||
@@ -33,7 +33,7 @@ webhooks:
|
|||||||
- key: app.kubernetes.io/name
|
- key: app.kubernetes.io/name
|
||||||
operator: NotIn
|
operator: NotIn
|
||||||
values:
|
values:
|
||||||
- {{ include "kubernetes-operator.name" . }}
|
- {{ include "netbird-operator.name" . }}
|
||||||
{{- if .Values.webhook.objectSelector.matchExpressions }}
|
{{- if .Values.webhook.objectSelector.matchExpressions }}
|
||||||
{{- toYaml .Values.webhook.objectSelector.matchExpressions | nindent 4 }}
|
{{- toYaml .Values.webhook.objectSelector.matchExpressions | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -58,18 +58,18 @@ kind: ValidatingWebhookConfiguration
|
|||||||
metadata:
|
metadata:
|
||||||
{{- if $.Values.webhook.enableCertManager }}
|
{{- if $.Values.webhook.enableCertManager }}
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "kubernetes-operator.fullname" . }}-serving-cert
|
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ template "netbird-operator.fullname" . }}-serving-cert
|
||||||
{{- end }}
|
{{- end }}
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}-vnbgroup-webhook
|
name: {{ include "netbird-operator.fullname" . }}-vnbgroup-webhook
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
{{- include "netbird-operator.labels" . | nindent 4 }}
|
||||||
webhooks:
|
webhooks:
|
||||||
- clientConfig:
|
- clientConfig:
|
||||||
{{- if not $.Values.webhook.enableCertManager }}
|
{{- if not $.Values.webhook.enableCertManager }}
|
||||||
caBundle: {{ $tls.caCert }}
|
caBundle: {{ $tls.caCert }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
service:
|
service:
|
||||||
name: {{ template "kubernetes-operator.webhookService" . }}
|
name: {{ template "netbird-operator.webhookService" . }}
|
||||||
namespace: {{ $.Release.Namespace }}
|
namespace: {{ $.Release.Namespace }}
|
||||||
path: /validate-netbird-io-v1-nbgroup
|
path: /validate-netbird-io-v1-nbgroup
|
||||||
failurePolicy: {{ .Values.webhook.failurePolicy }}
|
failurePolicy: {{ .Values.webhook.failurePolicy }}
|
||||||
@@ -97,10 +97,10 @@ webhooks:
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "kubernetes-operator.webhookCertSecret" . }}
|
name: {{ template "netbird-operator.webhookCertSecret" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
labels:
|
labels:
|
||||||
{{ include "kubernetes-operator.labels" . | indent 4 }}
|
{{ include "netbird-operator.labels" . | indent 4 }}
|
||||||
type: kubernetes.io/tls
|
type: kubernetes.io/tls
|
||||||
data:
|
data:
|
||||||
ca.crt: {{ $tls.caCert }}
|
ca.crt: {{ $tls.caCert }}
|
||||||
@@ -110,26 +110,26 @@ data:
|
|||||||
apiVersion: cert-manager.io/v1
|
apiVersion: cert-manager.io/v1
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "kubernetes-operator.fullname" . }}-serving-cert
|
name: {{ template "netbird-operator.fullname" . }}-serving-cert
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
labels:
|
labels:
|
||||||
{{ include "kubernetes-operator.labels" . | indent 4 }}
|
{{ include "netbird-operator.labels" . | indent 4 }}
|
||||||
spec:
|
spec:
|
||||||
dnsNames:
|
dnsNames:
|
||||||
- {{ template "kubernetes-operator.webhookService" . }}.{{ .Release.Namespace }}.svc
|
- {{ template "netbird-operator.webhookService" . }}.{{ .Release.Namespace }}.svc
|
||||||
- {{ template "kubernetes-operator.webhookService" . }}.{{ .Release.Namespace }}.{{ .Values.cluster.dns }}
|
- {{ template "netbird-operator.webhookService" . }}.{{ .Release.Namespace }}.{{ .Values.cluster.dns }}
|
||||||
issuerRef:
|
issuerRef:
|
||||||
kind: Issuer
|
kind: Issuer
|
||||||
name: {{ template "kubernetes-operator.fullname" . }}-selfsigned-issuer
|
name: {{ template "netbird-operator.fullname" . }}-selfsigned-issuer
|
||||||
secretName: {{ template "kubernetes-operator.webhookCertSecret" . }}
|
secretName: {{ template "netbird-operator.webhookCertSecret" . }}
|
||||||
---
|
---
|
||||||
apiVersion: cert-manager.io/v1
|
apiVersion: cert-manager.io/v1
|
||||||
kind: Issuer
|
kind: Issuer
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "kubernetes-operator.fullname" . }}-selfsigned-issuer
|
name: {{ template "netbird-operator.fullname" . }}-selfsigned-issuer
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
labels:
|
labels:
|
||||||
{{ include "kubernetes-operator.labels" . | indent 4 }}
|
{{ include "netbird-operator.labels" . | indent 4 }}
|
||||||
spec:
|
spec:
|
||||||
selfSigned: {}
|
selfSigned: {}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -41,9 +41,9 @@ operator:
|
|||||||
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
|
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
|
||||||
image:
|
image:
|
||||||
# Set operator image registry
|
# Set operator image registry
|
||||||
registry: docker.io
|
registry: ghcr.io
|
||||||
# Set operator image repository
|
# Set operator image repository
|
||||||
repository: netbirdio/kubernetes-operator
|
repository: netbirdio/netbird-operator
|
||||||
# This sets the pull policy for images.
|
# This sets the pull policy for images.
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
# Overrides the image tag whose default is the chart appVersion.
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
@@ -5,7 +5,7 @@ This example walks you through how to setup a Netbird Gateway API and expose Ngi
|
|||||||
Build image locally and load it into Kind.
|
Build image locally and load it into Kind.
|
||||||
```shell
|
```shell
|
||||||
make build-image
|
make build-image
|
||||||
kind load docker-image docker.io/netbirdio/kubernetes-operator:dev
|
kind load docker-image ghcr.io/netbirdio/kubernetes-operator:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the Gateway API CRDs.
|
Install the Gateway API CRDs.
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
apiVersion: v2
|
|
||||||
name: kubernetes-operator
|
|
||||||
description: NetBird Kubernetes Operator
|
|
||||||
type: application
|
|
||||||
version: "0.3.1"
|
|
||||||
appVersion: "0.3.1"
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{{/*apiVersion: batch/v1*/}}
|
|
||||||
{{/*kind: Job*/}}
|
|
||||||
{{/*metadata:*/}}
|
|
||||||
{{/* name: {{ include "kubernetes-operator.fullname" . }}-delete-router-deployments*/}}
|
|
||||||
{{/* labels:*/}}
|
|
||||||
{{/* app.kubernetes.io/component: operator*/}}
|
|
||||||
{{/* {{- include "kubernetes-operator.labels" . | nindent 4 }}*/}}
|
|
||||||
{{/* annotations:*/}}
|
|
||||||
{{/* helm.sh/hook: pre-delete*/}}
|
|
||||||
{{/* helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded*/}}
|
|
||||||
{{/*spec:*/}}
|
|
||||||
{{/* backoffLimit: 3*/}}
|
|
||||||
{{/* template:*/}}
|
|
||||||
{{/* metadata:*/}}
|
|
||||||
{{/* name: {{ include "kubernetes-operator.fullname" . }}*/}}
|
|
||||||
{{/* labels:*/}}
|
|
||||||
{{/* app.kubernetes.io/component: operator*/}}
|
|
||||||
{{/* {{- include "kubernetes-operator.labels" . | nindent 8 }}*/}}
|
|
||||||
{{/* {{- with .Values.operator.podLabels }}*/}}
|
|
||||||
{{/* {{- toYaml . | nindent 8 }}*/}}
|
|
||||||
{{/* {{- end }}*/}}
|
|
||||||
{{/* spec:*/}}
|
|
||||||
{{/* containers:*/}}
|
|
||||||
{{/* - name: pre-delete*/}}
|
|
||||||
{{/* image: "netbirdio/kubectl:latest"*/}}
|
|
||||||
{{/* imagePullPolicy: {{ .Values.operator.image.pullPolicy }}*/}}
|
|
||||||
{{/* command:*/}}
|
|
||||||
{{/* - sh*/}}
|
|
||||||
{{/* - -c*/}}
|
|
||||||
{{/* args:*/}}
|
|
||||||
{{/* - kubectl get NBRoutingPeer -A --no-headers -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name | while read "L"; do kubectl patch --type=json -p '[{"op":"replace","path":"/spec/disableDeployment","value":true}]' NBRoutingPeer -n $(echo "$L" | awk '{print $1}') $(echo "$L" | awk '{print $2}'); done*/}}
|
|
||||||
{{/* - name: delete-wait*/}}
|
|
||||||
{{/* image: "netbirdio/kubectl:latest"*/}}
|
|
||||||
{{/* imagePullPolicy: {{ .Values.operator.image.pullPolicy }}*/}}
|
|
||||||
{{/* command:*/}}
|
|
||||||
{{/* - sh*/}}
|
|
||||||
{{/* - -c*/}}
|
|
||||||
{{/* args:*/}}
|
|
||||||
{{/* - kubectl get NBRoutingPeer -A --no-headers -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name | while read "L"; do kubectl wait --for=delete deployment -n $(echo "$L" | awk '{print $1}') $(echo "$L" | awk '{print $2}'); done*/}}
|
|
||||||
{{/* serviceAccountName: {{ include "kubernetes-operator.serviceAccountName" . }}*/}}
|
|
||||||
{{/* restartPolicy: Never*/}}
|
|
||||||
@@ -58,7 +58,7 @@ var _ = BeforeSuite(func() {
|
|||||||
|
|
||||||
By("bootstrapping test environment")
|
By("bootstrapping test environment")
|
||||||
testEnv = &envtest.Environment{
|
testEnv = &envtest.Environment{
|
||||||
CRDDirectoryPaths: []string{filepath.Join("..", "..", "helm", "kubernetes-operator", "crds")},
|
CRDDirectoryPaths: []string{filepath.Join("..", "..", "charts", "netbird-operator", "crds")},
|
||||||
ErrorIfCRDPathMissing: true,
|
ErrorIfCRDPathMissing: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ var _ = BeforeSuite(func() {
|
|||||||
|
|
||||||
By("bootstrapping test environment")
|
By("bootstrapping test environment")
|
||||||
testEnv = &envtest.Environment{
|
testEnv = &envtest.Environment{
|
||||||
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "helm", "kubernetes-operator", "crds")},
|
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "charts", "netbird-operator", "crds")},
|
||||||
ErrorIfCRDPathMissing: false,
|
ErrorIfCRDPathMissing: false,
|
||||||
|
|
||||||
// WebhookInstallOptions: envtest.WebhookInstallOptions{
|
// WebhookInstallOptions: envtest.WebhookInstallOptions{
|
||||||
|
|||||||
@@ -155,13 +155,15 @@ func TestE2E(t *testing.T) {
|
|||||||
err = actionCfg.Init(clientGetter, netbirdNamespace, "secret")
|
err = actionCfg.Init(clientGetter, netbirdNamespace, "secret")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
charter, err := loader.Load("../../helm/kubernetes-operator")
|
charter, err := loader.Load("../../charts/netbird-operator")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
vals := map[string]any{
|
vals := map[string]any{
|
||||||
"image": map[string]any{
|
"operator": map[string]any{
|
||||||
"tag": "dev",
|
"image": map[string]any{
|
||||||
"pullPolicy": "Never",
|
"tag": "dev",
|
||||||
|
"pullPolicy": "Never",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"webhook": map[string]any{
|
"webhook": map[string]any{
|
||||||
"enableCertManager": false,
|
"enableCertManager": false,
|
||||||
@@ -171,7 +173,7 @@ func TestE2E(t *testing.T) {
|
|||||||
_, err = action.NewGet(actionCfg).Run(netbirdNamespace)
|
_, err = action.NewGet(actionCfg).Run(netbirdNamespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
install := action.NewInstall(actionCfg)
|
install := action.NewInstall(actionCfg)
|
||||||
install.ReleaseName = netbirdNamespace
|
install.ReleaseName = "netbird-operator"
|
||||||
install.Namespace = netbirdNamespace
|
install.Namespace = netbirdNamespace
|
||||||
install.CreateNamespace = true
|
install.CreateNamespace = true
|
||||||
install.WaitStrategy = kube.StatusWatcherStrategy
|
install.WaitStrategy = kube.StatusWatcherStrategy
|
||||||
@@ -183,7 +185,7 @@ func TestE2E(t *testing.T) {
|
|||||||
upgrade.Namespace = netbirdNamespace
|
upgrade.Namespace = netbirdNamespace
|
||||||
upgrade.WaitStrategy = kube.StatusWatcherStrategy
|
upgrade.WaitStrategy = kube.StatusWatcherStrategy
|
||||||
upgrade.Timeout = 60 * time.Second
|
upgrade.Timeout = 60 * time.Second
|
||||||
_, err := upgrade.RunWithContext(t.Context(), netbirdNamespace, charter, vals)
|
_, err := upgrade.RunWithContext(t.Context(), "netbird-operator", charter, vals)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user