2025-11-25 20:36:17 +02:00
|
|
|
{{- if .Values.router.enabled }}
|
|
|
|
|
{{- if .Values.namespacedNetworks }}
|
|
|
|
|
{{ $defaults := .Values.router }}
|
|
|
|
|
{{ range $k, $v := .Values.router.namespaces }}
|
|
|
|
|
apiVersion: netbird.io/v1
|
|
|
|
|
kind: NBRoutingPeer
|
|
|
|
|
metadata:
|
|
|
|
|
finalizers:
|
|
|
|
|
- netbird.io/cleanup
|
|
|
|
|
labels:
|
|
|
|
|
app.kubernetes.io/component: operator
|
|
|
|
|
{{- include "netbird-operator-config.labels" $ | nindent 4 }}
|
|
|
|
|
name: router
|
|
|
|
|
namespace: {{ $k }}
|
|
|
|
|
{{ $spec := merge $defaults $v }}
|
2026-03-03 08:29:52 +01:00
|
|
|
{{- if or (or (or $spec.replicas $spec.resources) (or $spec.labels $spec.annotations)) (or (or $spec.nodeSelector $spec.tolerations) $spec.privileged) }}
|
2025-11-25 20:36:17 +02:00
|
|
|
spec:
|
|
|
|
|
{{- if $spec.replicas }}
|
|
|
|
|
replicas: {{ $spec.replicas }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if $spec.resources }}
|
|
|
|
|
resources:
|
|
|
|
|
{{- toYaml $spec.resources | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if $spec.labels }}
|
|
|
|
|
labels:
|
|
|
|
|
{{- toYaml $spec.labels | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if $spec.annotations }}
|
|
|
|
|
annotations:
|
|
|
|
|
{{- toYaml $spec.annotations | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if $spec.nodeSelector }}
|
|
|
|
|
nodeSelector:
|
|
|
|
|
{{- toYaml $spec.nodeSelector | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if $spec.tolerations }}
|
|
|
|
|
tolerations:
|
|
|
|
|
{{- toYaml $spec.tolerations | nindent 4 }}
|
|
|
|
|
{{- end }}
|
2026-03-03 08:29:52 +01:00
|
|
|
{{- if $spec.privileged }}
|
|
|
|
|
privileged: {{ $spec.privileged }}
|
|
|
|
|
{{- end }}
|
2025-11-25 20:36:17 +02:00
|
|
|
{{- end }}
|
|
|
|
|
---
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- else }}
|
|
|
|
|
{{- with .Values.router }}
|
|
|
|
|
apiVersion: netbird.io/v1
|
|
|
|
|
kind: NBRoutingPeer
|
|
|
|
|
metadata:
|
|
|
|
|
finalizers:
|
|
|
|
|
- netbird.io/cleanup
|
|
|
|
|
labels:
|
|
|
|
|
app.kubernetes.io/component: operator
|
|
|
|
|
{{- include "netbird-operator-config.labels" $ | nindent 4 }}
|
|
|
|
|
name: router
|
2026-03-03 08:29:52 +01:00
|
|
|
{{- if or (or (or .replicas .resources) (or .labels .annotations)) (or (or .nodeSelector .tolerations) .privileged) }}
|
2025-11-25 20:36:17 +02:00
|
|
|
spec:
|
|
|
|
|
{{- if .replicas }}
|
|
|
|
|
replicas: {{ .replicas }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .resources }}
|
|
|
|
|
resources:
|
|
|
|
|
{{- toYaml .resources | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .labels }}
|
|
|
|
|
labels:
|
|
|
|
|
{{- toYaml .labels | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .annotations }}
|
|
|
|
|
annotations:
|
|
|
|
|
{{- toYaml .annotations | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .nodeSelector }}
|
|
|
|
|
nodeSelector:
|
|
|
|
|
{{- toYaml .nodeSelector | nindent 4 }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if .tolerations }}
|
|
|
|
|
tolerations:
|
|
|
|
|
{{- toYaml .tolerations | nindent 4 }}
|
|
|
|
|
{{- end }}
|
2026-03-03 08:29:52 +01:00
|
|
|
{{- if .privileged }}
|
|
|
|
|
privileged: {{ .privileged }}
|
|
|
|
|
{{- end }}
|
2025-11-25 20:36:17 +02:00
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- end }}
|
2026-02-12 16:45:07 +01:00
|
|
|
{{- end }}
|