mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 13:54:37 +03:00
[ingress-nginx] expose custom tcp and udp ports in ingress-nginx-controller (#11850)
This commit is contained in:
@@ -125,6 +125,26 @@ spec:
|
||||
{% if not ingress_nginx_host_network %}
|
||||
hostPort: {{ ingress_nginx_metrics_port }}
|
||||
{% endif %}
|
||||
{% if ingress_nginx_configmap_tcp_services %}
|
||||
{% for port in ingress_nginx_configmap_tcp_services.keys() %}
|
||||
- name: tcp-port-{{ port }}
|
||||
containerPort: "{{ port | int }}"
|
||||
protocol: TCP
|
||||
{% if not ingress_nginx_host_network %}
|
||||
hostPort: "{{ port | int }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if ingress_nginx_configmap_udp_services %}
|
||||
{% for port in ingress_nginx_configmap_udp_services.keys() %}
|
||||
- name: udp-port-{{ port }}
|
||||
containerPort: "{{ port | int }}"
|
||||
protocol: UDP
|
||||
{% if not ingress_nginx_host_network %}
|
||||
hostPort: "{{ port | int }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if ingress_nginx_webhook_enabled %}
|
||||
- name: webhook
|
||||
containerPort: 8443
|
||||
|
||||
@@ -27,6 +27,22 @@ spec:
|
||||
protocol: TCP
|
||||
{% if (ingress_nginx_service_type == 'NodePort' or ingress_nginx_service_type == 'LoadBalancer') and ingress_nginx_service_nodeport_https %}
|
||||
nodePort: {{ingress_nginx_service_nodeport_https | int}}
|
||||
{% endif %}
|
||||
{% if ingress_nginx_configmap_tcp_services %}
|
||||
{% for port in ingress_nginx_configmap_tcp_services.keys() %}
|
||||
- name: tcp-port-{{ port }}
|
||||
port: "{{ port | int }}"
|
||||
targetPort: "{{ port | int }}"
|
||||
protocol: TCP
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if ingress_nginx_configmap_udp_services %}
|
||||
{% for port in ingress_nginx_configmap_udp_services.keys() %}
|
||||
- name: udp-port-{{ port }}
|
||||
port: "{{ port | int }}"
|
||||
targetPort: "{{ port | int }}"
|
||||
protocol: UDP
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
selector:
|
||||
app.kubernetes.io/name: ingress-nginx
|
||||
|
||||
Reference in New Issue
Block a user