-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Description
I am trying to setting up a Gitea SSH with Gateway API's TCPRoute, my haproxy-ingress is running as daemonSet using useHostPort: true option. Here's myvalues.yaml:
controller:
ingressClassResource:
enabled: true
kind: DaemonSet
daemonset:
useHostPort: true
hostPorts:
tcp:
- "2222"
service:
type: ClusterIP
config:
limit-connections: "10"
limit-rps: "50"This should render the _podtemplate.yaml with extra TCP ports like this, which enable haproxy pod to listen at host port 2222.
- containerPort: 2222
hostPort: 2222
name: gitea-ssh
protocol: TCPHowever, it seems that the controller.daemonset.hostPorts.tcp is only rendered IF controller.tcp is defined.
Goals
- For pure Gateway API
TCPRouteconfiguration, we don't want to definecontroller.tcpinvalues.yamlas it is redundant.
Proposed solution
Thinking of this new value controller.daemonset.extraHostPorts similar to existing controller.service.extraPorts:
in _podtemplate.yaml
{{- define "haproxy-ingress.controller.ports" }}
{{- /* existing codes */}}
{{- if $.Values.controller.daemonset.useHostPort }}
{{- range $row := .Values.controller.daemonset.extraHostPorts }}
- name: "extra-port-{{ $row.port }}"
containerPort: {{ $row.containerPort }}
hostPort: {{ $row.hostPort }}
{{- end }}
{{- end }}
{{- end }}
Expected working values.yaml
controller:
kind: DaemonSet
daemonset:
useHostPort: true
extraHostPorts:
- port: "2222"
containerPort: "2222"
hostPort: "2222"
service:
type: ClusterIP
## rest of valMade a quick test this morning and it's working fine with TCPRoute, I can do pull request if this proposal is approved.
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels