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: TCP
However, it seems that the controller.daemonset.hostPorts.tcp is only rendered IF controller.tcp is defined.
Goals
- For pure Gateway API
TCPRoute configuration, we don't want to define controller.tcp in values.yaml as 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 val
Made a quick test this morning and it's working fine with TCPRoute, I can do pull request if this proposal is approved.
Thank you.
Description
I am trying to setting up a Gitea SSH with Gateway API's
TCPRoute, my haproxy-ingress is running as daemonSet usinguseHostPort: trueoption. Here's myvalues.yaml:This should render the
_podtemplate.yamlwith extra TCP ports like this, which enable haproxy pod to listen at host port2222.However, it seems that the
controller.daemonset.hostPorts.tcpis only rendered IFcontroller.tcpis defined.Goals
TCPRouteconfiguration, we don't want to definecontroller.tcpinvalues.yamlas it is redundant.Proposed solution
Thinking of this new value
controller.daemonset.extraHostPortssimilar to existingcontroller.service.extraPorts:in
_podtemplate.yamlExpected working
values.yamlMade a quick test this morning and it's working fine with TCPRoute, I can do pull request if this proposal is approved.
Thank you.