Skip to content

Commit

Permalink
feat: Gateway supports the configuration of forwarding tcp/udp traffi…
Browse files Browse the repository at this point in the history
…c. (kubesphere#5445)

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
  • Loading branch information
hongzhouzi authored and wanjunlei committed Aug 11, 2023
1 parent 046e5ad commit a6ee523
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
8 changes: 8 additions & 0 deletions config/crds/gateway.kubesphere.io_gateways.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion config/gateway/templates/nginx-ingress.yaml
Expand Up @@ -266,7 +266,22 @@ spec:
imagePullSecrets: []
# - name: secretName


# TCP service key:value pairs
# Ref: https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/exposing-tcp-udp-services.md
##
{{- if .Values.controller.tcp }}
tcp: {{ toYaml .Values.controller.tcp | nindent 4 }}
{{- end }}
# 8080: "default/example-tcp-svc:9000"


# UDP service key:value pairs
# Ref: https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/exposing-tcp-udp-services.md
##
{{- if .Values.controller.udp }}
udp: {{ toYaml .Values.controller.udp | nindent 4 }}
{{- end }}
# 53: "kube-system/kube-dns:53"



3 changes: 3 additions & 0 deletions config/gateway/values.yaml
Expand Up @@ -15,6 +15,9 @@ controller:
tag: "v1.1.0"
pullPolicy: IfNotPresent
digest: ""
# add configuration of forwarding tcp/udp traffic
tcp: {}
udp: {}


service:
Expand Down
Expand Up @@ -38,6 +38,10 @@ type ControllerSpec struct {
Config map[string]string `json:"config,omitempty"`
// +optional
Scope Scope `json:"scope,omitempty"`
// +optional
TCP map[string]string `json:"tcp,omitempty"`
// +optional
UDP map[string]string `json:"udp,omitempty"`
}

type ServiceSpec struct {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a6ee523

Please sign in to comment.