2024-02-19 18:47:36 +08:00
|
|
|
{% if not ingress_nginx_host_network %}
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: ingress-nginx
|
|
|
|
namespace: {{ ingress_nginx_namespace }}
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
|
|
|
spec:
|
|
|
|
type: {{ ingress_nginx_service_type }}
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
port: 80
|
|
|
|
targetPort: 80
|
|
|
|
protocol: TCP
|
2024-07-01 12:58:05 +08:00
|
|
|
{% if (ingress_nginx_service_type == 'NodePort' or ingress_nginx_service_type == 'LoadBalancer') and ingress_nginx_service_nodeport_http %}
|
|
|
|
nodePort: {{ingress_nginx_service_nodeport_http | int}}
|
|
|
|
{% endif %}
|
2024-02-19 18:47:36 +08:00
|
|
|
- name: https
|
|
|
|
port: 443
|
|
|
|
targetPort: 443
|
|
|
|
protocol: TCP
|
2024-07-01 12:58:05 +08:00
|
|
|
{% 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 %}
|
2024-02-19 18:47:36 +08:00
|
|
|
selector:
|
|
|
|
app.kubernetes.io/name: ingress-nginx
|
2024-03-11 18:07:37 +08:00
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2024-02-19 18:47:36 +08:00
|
|
|
{% endif %}
|