diff --git a/charts/netbird/templates/dashboard-http-route.yaml b/charts/netbird/templates/dashboard-http-route.yaml new file mode 100644 index 0000000..8f9a2b4 --- /dev/null +++ b/charts/netbird/templates/dashboard-http-route.yaml @@ -0,0 +1,30 @@ +{{- if .Values.dashboard.enabled -}} +{{- if .Values.dashboard.httpRoute.enabled -}} +{{- $fullName := printf "%s-dashboard" (include "netbird.fullname" .) -}} +{{- $svcPort := .Values.dashboard.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }}-http-route + namespace: {{ include "netbird.namespace" . }} + labels: + {{- include "netbird.dashboard.labels" . | nindent 4 }} +spec: + {{- with .Values.dashboard.httpRoute.parentRefs }} + parentRefs: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.dashboard.httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + matches: + - path: + type: PathPrefix + value: / +{{- end }} +{{- end }} diff --git a/charts/netbird/templates/management-grpc-route.yaml b/charts/netbird/templates/management-grpc-route.yaml new file mode 100644 index 0000000..2eb84eb --- /dev/null +++ b/charts/netbird/templates/management-grpc-route.yaml @@ -0,0 +1,36 @@ +{{- if .Values.management.enabled -}} +{{- if .Values.management.grpcRoute.enabled -}} +{{- $fullName := printf "%s-management-grpc" (include "netbird.fullname" .) -}} +{{- $useBackwardsGrpcService := .Values.management.useBackwardsGrpcService -}} +{{- $svcNameGrpc := printf "%s-management-grpc" (include "netbird.fullname" .) -}} +{{- $svcPortGrpc := .Values.management.serviceGrpc.port -}} +{{- $svcName := printf "%s-management" (include "netbird.fullname" .) -}} +{{- $svcPort := .Values.management.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: GRPCRoute +metadata: + name: {{ $fullName }}-grpc-route + namespace: {{ include "netbird.namespace" . }} + labels: + {{- include "netbird.management.labels" . | nindent 4 }} +spec: + {{- with .Values.management.grpcRoute.parentRefs }} + parentRefs: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.management.grpcRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: {{ if $useBackwardsGrpcService }}{{ $svcNameGrpc }}{{ else }}{{ $svcName }}{{ end }} + port: {{ if $useBackwardsGrpcService }}{{ $svcPortGrpc }}{{ else }}{{ $svcPort }}{{ end }} + matches: + - headers: + - name: Content-Type + value: application/grpc + method: + service: management.ManagementService +{{- end }} +{{- end }} diff --git a/charts/netbird/templates/management-http-route.yaml b/charts/netbird/templates/management-http-route.yaml new file mode 100644 index 0000000..80183e7 --- /dev/null +++ b/charts/netbird/templates/management-http-route.yaml @@ -0,0 +1,30 @@ +{{- if .Values.management.enabled -}} +{{- if .Values.management.httpRoute.enabled -}} +{{- $fullName := printf "%s-management" (include "netbird.fullname" .) -}} +{{- $svcPort := .Values.management.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }}-http-route + namespace: {{ include "netbird.namespace" . }} + labels: + {{- include "netbird.management.labels" . | nindent 4 }} +spec: + {{- with .Values.management.httpRoute.parentRefs }} + parentRefs: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.management.httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + matches: + - path: + type: PathPrefix + value: /api +{{- end }} +{{- end }} diff --git a/charts/netbird/templates/relay-http-route.yaml b/charts/netbird/templates/relay-http-route.yaml new file mode 100644 index 0000000..e071a3a --- /dev/null +++ b/charts/netbird/templates/relay-http-route.yaml @@ -0,0 +1,30 @@ +{{- if .Values.relay.enabled -}} +{{- if .Values.relay.httpRoute.enabled -}} +{{- $fullName := printf "%s-relay" (include "netbird.fullname" .) -}} +{{- $svcPort := .Values.relay.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }}-http-route + namespace: {{ include "netbird.namespace" . }} + labels: + {{- include "netbird.relay.labels" . | nindent 4 }} +spec: + {{- with .Values.relay.httpRoute.parentRefs }} + parentRefs: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.relay.httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + matches: + - path: + type: PathPrefix + value: /relay +{{- end }} +{{- end }} diff --git a/charts/netbird/templates/signal-grpc-route.yaml b/charts/netbird/templates/signal-grpc-route.yaml new file mode 100644 index 0000000..da2b56c --- /dev/null +++ b/charts/netbird/templates/signal-grpc-route.yaml @@ -0,0 +1,32 @@ +{{- if .Values.signal.enabled -}} +{{- if .Values.signal.grpcRoute.enabled -}} +{{- $fullName := printf "%s-signal" (include "netbird.fullname" .) -}} +{{- $svcPort := .Values.signal.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: GRPCRoute +metadata: + name: {{ $fullName }}-grpc-route + namespace: {{ include "netbird.namespace" . }} + labels: + {{- include "netbird.signal.labels" . | nindent 4 }} +spec: + {{- with .Values.signal.grpcRoute.parentRefs }} + parentRefs: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.signal.grpcRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + matches: + - headers: + - name: Content-Type + value: application/grpc + method: + service: signalexchange.SignalExchange +{{- end }} +{{- end }} diff --git a/charts/netbird/values.yaml b/charts/netbird/values.yaml index bf8d019..a5334b2 100644 --- a/charts/netbird/values.yaml +++ b/charts/netbird/values.yaml @@ -203,6 +203,22 @@ management: # hosts: # - chart-example.local + httpRoute: + ## @param management.httpRoute.enabled Enable or disable Gateway API for the management component. + ## + enabled: false + + ## @param management.httpRoute.parentRefs Parent references for the Gateway API resource. + ## + parentRefs: [] + # - name: external + # namespace: gateway + + ## @param management.httpRoute.hostnames Hostnames for the Gateway API resource. + ## + hostnames: [] + # - example.com + ingressGrpc: ## @param management.ingressGrpc.enabled Enable or disable GRPC ingress. ## @@ -232,6 +248,22 @@ management: ## tls: [] + grpcRoute: + ## @param management.grpcRoute.enabled Enable or disable Gateway API for the management GRPC component. + ## + enabled: false + + ## @param management.grpcRoute.parentRefs Parent references for the Gateway API GRPC resource. + ## + parentRefs: [] + # - name: external + # namespace: gateway + + ## @param management.grpcRoute.hostnames Hostnames for the Gateway API GRPC resource. + ## + hostnames: [] + # - example.com + ## @param management.resources Resource requests and limits for the management pod. ## resources: {} @@ -434,6 +466,22 @@ signal: ## tls: [] + grpcRoute: + ## @param signal.grpcRoute.enabled Enable or disable Gateway API for the signal component. + ## + enabled: false + + ## @param signal.grpcRoute.parentRefs Parent references for the Gateway API resource. + ## + parentRefs: [] + # - name: external + # namespace: gateway + + ## @param signal.grpcRoute.hostnames Hostnames for the Gateway API resource. + ## + hostnames: [] + # - example.com + ## @ ## param signal.resources Resource requests and limits for the signal pod. @@ -627,6 +675,22 @@ relay: ## tls: [] + httpRoute: + ## @param relay.httpRoute.enabled Enable or disable Gateway API for the relay component. + ## + enabled: false + + ## @param relay.httpRoute.parentRefs Parent references for the Gateway API resource. + ## + parentRefs: [] + # - name: external + # namespace: gateway + + ## @param relay.httpRoute.hostnames Hostnames for the Gateway API resource. + ## + hostnames: [] + # - example.com + ## @param relay.resources Resource requests and limits for the relay pod. ## resources: {} @@ -790,6 +854,22 @@ dashboard: # hosts: # - chart-example.local + httpRoute: + ## @param dashboard.httpRoute.enabled Enable or disable Gateway API for the dashboard component. + ## + enabled: false + + ## @param dashboard.httpRoute.parentRefs Parent references for the Gateway API resource. + ## + parentRefs: [] + # - name: external + # namespace: gateway + + ## @param dashboard.httpRoute.hostnames Hostnames for the Gateway API resource. + ## + hostnames: [] + # - example.com + ## @param dashboard.resources resources: {} # limits: