feat: Gateway supports the configuration of forwarding tcp/udp traffic. (#5445)
Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io> Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
8
config/crds/gateway.kubesphere.io_gateways.yaml
generated
8
config/crds/gateway.kubesphere.io_gateways.yaml
generated
@@ -56,6 +56,14 @@ spec:
|
||||
namespace:
|
||||
type: string
|
||||
type: object
|
||||
tcp:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
udp:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
deployment:
|
||||
properties:
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ controller:
|
||||
tag: "v1.1.0"
|
||||
pullPolicy: IfNotPresent
|
||||
digest: ""
|
||||
# add configuration of forwarding tcp/udp traffic
|
||||
tcp: {}
|
||||
udp: {}
|
||||
|
||||
|
||||
service:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -48,6 +48,20 @@ func (in *ControllerSpec) DeepCopyInto(out *ControllerSpec) {
|
||||
}
|
||||
}
|
||||
out.Scope = in.Scope
|
||||
if in.TCP != nil {
|
||||
in, out := &in.TCP, &out.TCP
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.UDP != nil {
|
||||
in, out := &in.UDP, &out.UDP
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerSpec.
|
||||
|
||||
Reference in New Issue
Block a user