mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 18:59:09 +00:00
Remove the creation and use of the Kubectl image to apply configuration (#198)
Using kubectl to manage configuration is not a sustainable solution and not something that we want to promote users to do. This removes the creation of the image and use of the image in the Helm charts.
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
{{- if and .Values.ingress.enabled .Values.ingress.kubernetesAPI.enabled }}
|
||||
{{- $routerNS := .Release.Namespace }}
|
||||
{{- if .Values.ingress.namespacedNetworks }}
|
||||
{{- $routerNS = "default" }}
|
||||
{{- end }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ include "kubernetes-operator.fullname" . }}-kubernetes-service-expose
|
||||
labels:
|
||||
app.kubernetes.io/component: operator
|
||||
{{- include "kubernetes-operator.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
helm.sh/hook: post-upgrade,post-install
|
||||
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:
|
||||
initContainers:
|
||||
- name: wait-network-ready
|
||||
image: "netbirdio/kubectl:latest"
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
args:
|
||||
- kubectl wait --for 'jsonpath={.status.networkID}' -n {{ $routerNS }} nbroutingpeer router;
|
||||
containers:
|
||||
- name: apply-nbresource
|
||||
image: "netbirdio/kubectl:latest"
|
||||
env:
|
||||
- name: NBRESOURCE_VALUE
|
||||
value: |
|
||||
apiVersion: netbird.io/v1
|
||||
kind: NBResource
|
||||
metadata:
|
||||
finalizers:
|
||||
- netbird.io/cleanup
|
||||
name: kubernetes
|
||||
namespace: default
|
||||
spec:
|
||||
address: kubernetes.default.{{.Values.cluster.dns}}
|
||||
groups:
|
||||
{{- if .Values.ingress.kubernetesAPI.groups }}
|
||||
{{ toYaml .Values.ingress.kubernetesAPI.groups }}
|
||||
{{- else }}
|
||||
- {{ .Values.cluster.name }}-default-api-access
|
||||
{{- end }}
|
||||
name: {{ .Values.ingress.kubernetesAPI.resourceName | default "default-kubernetes-api" }}
|
||||
networkID: ${NETWORK_ID}
|
||||
{{- if .Values.ingress.kubernetesAPI.policies }}
|
||||
policyName: "{{ join "," .Values.ingress.kubernetesAPI.policies }}"
|
||||
{{- end }}
|
||||
tcpPorts:
|
||||
- 443
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
args:
|
||||
- kubectl delete NBResource --ignore-not-found -n default kubernetes; export NETWORK_ID=$(kubectl get NBRoutingPeer -n {{ $routerNS }} router -o 'jsonpath={.status.networkID}'); echo "$NBRESOURCE_VALUE" | envsubst | kubectl apply -f -
|
||||
serviceAccountName: {{ include "kubernetes-operator.serviceAccountName" . }}
|
||||
restartPolicy: Never
|
||||
{{- end }}
|
||||
@@ -133,6 +133,7 @@ operator:
|
||||
|
||||
affinity: {}
|
||||
|
||||
# DEPRECATED: Use NetworkRouters and NetworkResources instead.
|
||||
ingress:
|
||||
# Enable ingress capabilities to expose services
|
||||
enabled: false
|
||||
@@ -140,52 +141,6 @@ ingress:
|
||||
namespacedNetworks: false
|
||||
# Allow creating policies through Service annotations
|
||||
allowAutomaticPolicyCreation: false
|
||||
kubernetesAPI: # DEPRECATED: Use netbirdio/netbird-operator-configs Chart instead
|
||||
enabled: false
|
||||
groups: []
|
||||
# - group1
|
||||
# - group2
|
||||
policies: []
|
||||
# - default
|
||||
router: # DEPRECATED: Use netbirdio/netbird-operator-configs Chart instead
|
||||
# Deploy routing peer(s)
|
||||
enabled: false
|
||||
# replicas: 3
|
||||
# resources:
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 100Mi
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 100Mi
|
||||
# labels: {}
|
||||
# annotations: {}
|
||||
# nodeSelector: {}
|
||||
# tolerations: []
|
||||
# Only needed if namespacedNetworks is set to true
|
||||
namespaces: {}
|
||||
# default:
|
||||
# replicas: 3
|
||||
# resources:
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 100Mi
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 100Mi
|
||||
# labels: {}
|
||||
# annotations: {}
|
||||
# nodeSelector: {}
|
||||
# tolerations: []
|
||||
# NetBird Policies for use with exposed services
|
||||
policies: {} # DEPRECATED: Use netbirdio/netbird-operator-configs Chart instead
|
||||
# default:
|
||||
# name: Kubernetes Default Policy
|
||||
# sourceGroups:
|
||||
# - All
|
||||
|
||||
gatewayAPI:
|
||||
enabled: false
|
||||
|
||||
cluster:
|
||||
# Cluster DNS name (used for webhooks certificates and for network resource DNS names)
|
||||
@@ -202,6 +157,9 @@ netbirdAPI: {}
|
||||
|
||||
#routingClientImage: "netbirdio/netbird:latest"
|
||||
|
||||
gatewayAPI:
|
||||
enabled: false
|
||||
|
||||
general:
|
||||
# General labels, applied to all created K8s resources
|
||||
labels: {}
|
||||
|
||||
Reference in New Issue
Block a user