2018-02-13 01:08:44 +00:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: ingress-nginx-controller
|
|
|
|
namespace: {{ ingress_nginx_namespace }}
|
|
|
|
labels:
|
2018-09-02 04:19:38 +00:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2018-02-13 01:08:44 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2018-09-02 04:19:38 +00:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2018-02-13 01:08:44 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2018-09-02 04:19:38 +00:00
|
|
|
app.kubernetes.io/name: ingress-nginx
|
|
|
|
app.kubernetes.io/part-of: ingress-nginx
|
2018-03-20 05:47:36 +00:00
|
|
|
annotations:
|
2018-10-23 12:08:04 +00:00
|
|
|
prometheus.io/port: "10254"
|
|
|
|
prometheus.io/scrape: "true"
|
2018-02-13 01:08:44 +00:00
|
|
|
spec:
|
2018-06-07 09:25:25 +00:00
|
|
|
serviceAccountName: ingress-nginx
|
2018-03-19 09:59:38 +00:00
|
|
|
{% if ingress_nginx_host_network %}
|
2018-03-16 23:54:46 +00:00
|
|
|
hostNetwork: true
|
2019-06-05 10:17:56 +00:00
|
|
|
dnsPolicy: ClusterFirstWithHostNet
|
2018-03-16 23:54:46 +00:00
|
|
|
{% endif %}
|
2018-06-07 09:25:25 +00:00
|
|
|
{% if ingress_nginx_nodeselector %}
|
2018-03-16 23:54:46 +00:00
|
|
|
nodeSelector:
|
2020-09-30 14:23:26 +00:00
|
|
|
{{ ingress_nginx_nodeselector | to_nice_yaml | indent(width=8) }}
|
2018-06-07 09:25:25 +00:00
|
|
|
{%- endif %}
|
2018-11-27 11:30:16 +00:00
|
|
|
{% if ingress_nginx_tolerations %}
|
|
|
|
tolerations:
|
|
|
|
{{ ingress_nginx_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
|
2019-02-04 20:59:01 +00:00
|
|
|
{% endif %}
|
2018-09-25 14:50:22 +00:00
|
|
|
priorityClassName: {% if ingress_nginx_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
|
2018-02-13 01:08:44 +00:00
|
|
|
containers:
|
|
|
|
- name: ingress-nginx-controller
|
|
|
|
image: {{ ingress_nginx_controller_image_repo }}:{{ ingress_nginx_controller_image_tag }}
|
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2020-04-22 15:41:52 +00:00
|
|
|
lifecycle:
|
|
|
|
preStop:
|
|
|
|
exec:
|
|
|
|
command:
|
|
|
|
- /wait-shutdown
|
2018-02-13 01:08:44 +00:00
|
|
|
args:
|
|
|
|
- /nginx-ingress-controller
|
|
|
|
- --configmap=$(POD_NAMESPACE)/ingress-nginx
|
2018-06-07 09:25:25 +00:00
|
|
|
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
|
|
|
|
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services
|
2018-02-13 01:08:44 +00:00
|
|
|
- --annotations-prefix=nginx.ingress.kubernetes.io
|
2019-04-29 08:44:22 +00:00
|
|
|
{% if ingress_nginx_host_network %}
|
|
|
|
- --report-node-internal-ip-address
|
2019-08-07 02:24:50 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if ingress_publish_status_address != "" %}
|
|
|
|
- --publish-status-address={{ ingress_publish_status_address }}
|
2019-04-29 08:44:22 +00:00
|
|
|
{% endif %}
|
2019-11-11 11:51:41 +00:00
|
|
|
{% for extra_arg in ingress_nginx_extra_args %}
|
|
|
|
- {{ extra_arg }}
|
|
|
|
{% endfor %}
|
2018-06-07 09:25:25 +00:00
|
|
|
securityContext:
|
|
|
|
capabilities:
|
|
|
|
drop:
|
|
|
|
- ALL
|
|
|
|
add:
|
|
|
|
- NET_BIND_SERVICE
|
2020-02-07 10:07:44 +00:00
|
|
|
# www-data -> 101
|
|
|
|
runAsUser: 101
|
2020-06-09 09:45:18 +00:00
|
|
|
allowPrivilegeEscalation: true
|
2018-02-13 01:08:44 +00:00
|
|
|
env:
|
|
|
|
- name: POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: POD_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2020-10-06 12:10:21 +00:00
|
|
|
- name: LD_PRELOAD
|
|
|
|
value: /usr/local/lib/libmimalloc.so
|
2018-02-13 01:08:44 +00:00
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
containerPort: 80
|
|
|
|
hostPort: {{ ingress_nginx_insecure_port }}
|
|
|
|
- name: https
|
|
|
|
containerPort: 443
|
|
|
|
hostPort: {{ ingress_nginx_secure_port }}
|
2020-09-04 11:54:11 +00:00
|
|
|
- name: metrics
|
|
|
|
containerPort: 10254
|
|
|
|
{% if not ingress_nginx_host_network %}
|
|
|
|
hostPort: {{ ingress_nginx_metrics_port }}
|
|
|
|
{% endif %}
|
2018-02-13 01:08:44 +00:00
|
|
|
livenessProbe:
|
|
|
|
failureThreshold: 3
|
|
|
|
httpGet:
|
|
|
|
path: /healthz
|
|
|
|
port: 10254
|
|
|
|
scheme: HTTP
|
2020-04-22 15:41:52 +00:00
|
|
|
initialDelaySeconds: 10
|
|
|
|
periodSeconds: 10
|
2019-04-23 21:46:02 +00:00
|
|
|
timeoutSeconds: 5
|
2018-02-13 01:08:44 +00:00
|
|
|
successThreshold: 1
|
|
|
|
failureThreshold: 3
|
2020-04-22 15:41:52 +00:00
|
|
|
readinessProbe:
|
2018-02-13 01:08:44 +00:00
|
|
|
httpGet:
|
|
|
|
path: /healthz
|
|
|
|
port: 10254
|
|
|
|
scheme: HTTP
|
2020-04-22 15:41:52 +00:00
|
|
|
initialDelaySeconds: 10
|
|
|
|
periodSeconds: 10
|
2019-04-23 21:46:02 +00:00
|
|
|
timeoutSeconds: 5
|
2018-02-13 01:08:44 +00:00
|
|
|
successThreshold: 1
|
2020-04-22 15:41:52 +00:00
|
|
|
failureThreshold: 3
|