2018-02-13 09:08:44 +08:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: ingress-nginx-controller
|
|
|
|
namespace: {{ ingress_nginx_namespace }}
|
|
|
|
labels:
|
2018-09-02 12:19:38 +08:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2018-02-13 09:08:44 +08:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2018-09-02 12:19:38 +08:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2018-02-13 09:08:44 +08:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2018-09-02 12:19:38 +08:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2018-03-20 13:47:36 +08:00
|
|
|
annotations:
|
2018-10-23 20:08:04 +08:00
|
|
|
prometheus.io/port: "10254"
|
|
|
|
prometheus.io/scrape: "true"
|
2018-02-13 09:08:44 +08:00
|
|
|
spec:
|
2018-06-07 17:25:25 +08:00
|
|
|
serviceAccountName: ingress-nginx
|
2018-03-19 17:59:38 +08:00
|
|
|
{% if ingress_nginx_host_network %}
|
2018-03-17 07:54:46 +08:00
|
|
|
hostNetwork: true
|
|
|
|
{% endif %}
|
2018-06-07 17:25:25 +08:00
|
|
|
{% if ingress_nginx_nodeselector %}
|
2018-03-17 07:54:46 +08:00
|
|
|
nodeSelector:
|
2018-06-07 17:25:25 +08:00
|
|
|
{{ ingress_nginx_nodeselector | to_nice_yaml }}
|
|
|
|
{%- endif %}
|
2018-11-27 19:30:16 +08:00
|
|
|
{% if ingress_nginx_tolerations %}
|
|
|
|
tolerations:
|
|
|
|
{{ ingress_nginx_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
|
2019-02-05 04:59:01 +08:00
|
|
|
{% endif %}
|
2018-10-17 06:33:30 +08:00
|
|
|
{% if kube_version is version('v1.11.1', '>=') %}
|
2018-09-25 22:50:22 +08:00
|
|
|
priorityClassName: {% if ingress_nginx_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
|
|
|
|
{% endif %}
|
2018-02-13 09:08:44 +08:00
|
|
|
containers:
|
|
|
|
- name: ingress-nginx-controller
|
|
|
|
image: {{ ingress_nginx_controller_image_repo }}:{{ ingress_nginx_controller_image_tag }}
|
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
|
|
|
args:
|
|
|
|
- /nginx-ingress-controller
|
|
|
|
- --configmap=$(POD_NAMESPACE)/ingress-nginx
|
2018-06-07 17:25:25 +08:00
|
|
|
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
|
|
|
|
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services
|
2018-02-13 09:08:44 +08:00
|
|
|
- --annotations-prefix=nginx.ingress.kubernetes.io
|
2019-04-29 16:44:22 +08:00
|
|
|
{% if ingress_nginx_host_network %}
|
|
|
|
- --report-node-internal-ip-address
|
|
|
|
{% endif %}
|
2018-06-07 17:25:25 +08:00
|
|
|
securityContext:
|
|
|
|
capabilities:
|
|
|
|
drop:
|
|
|
|
- ALL
|
|
|
|
add:
|
|
|
|
- NET_BIND_SERVICE
|
|
|
|
# www-data -> 33
|
|
|
|
runAsUser: 33
|
2018-02-13 09:08:44 +08:00
|
|
|
env:
|
|
|
|
- name: POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: POD_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
containerPort: 80
|
|
|
|
hostPort: {{ ingress_nginx_insecure_port }}
|
|
|
|
- name: https
|
|
|
|
containerPort: 443
|
|
|
|
hostPort: {{ ingress_nginx_secure_port }}
|
|
|
|
livenessProbe:
|
|
|
|
failureThreshold: 3
|
|
|
|
httpGet:
|
|
|
|
path: /healthz
|
|
|
|
port: 10254
|
|
|
|
scheme: HTTP
|
2019-04-24 05:46:02 +08:00
|
|
|
initialDelaySeconds: 5
|
|
|
|
timeoutSeconds: 5
|
2018-02-13 09:08:44 +08:00
|
|
|
successThreshold: 1
|
2019-04-24 05:46:02 +08:00
|
|
|
failureThreshold: 10
|
2018-02-13 09:08:44 +08:00
|
|
|
readinessProbe:
|
|
|
|
failureThreshold: 3
|
|
|
|
httpGet:
|
|
|
|
path: /healthz
|
|
|
|
port: 10254
|
|
|
|
scheme: HTTP
|
2019-04-24 05:46:02 +08:00
|
|
|
timeoutSeconds: 5
|
2018-02-13 09:08:44 +08:00
|
|
|
successThreshold: 1
|
2019-04-24 05:46:02 +08:00
|
|
|
failureThreshold: 10
|