2018-02-13 01:08:44 +00:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: ingress-nginx-controller
|
|
|
|
namespace: {{ ingress_nginx_namespace }}
|
|
|
|
labels:
|
|
|
|
k8s-app: ingress-nginx
|
|
|
|
version: v{{ ingress_nginx_controller_image_tag }}
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: ingress-nginx
|
|
|
|
version: v{{ ingress_nginx_controller_image_tag }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: ingress-nginx
|
|
|
|
version: v{{ ingress_nginx_controller_image_tag }}
|
2018-03-20 05:47:36 +00:00
|
|
|
annotations:
|
|
|
|
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
|
|
|
{% if rbac_enabled %}
|
|
|
|
serviceAccountName: ingress-nginx
|
|
|
|
{% endif %}
|
2018-03-19 09:59:38 +00:00
|
|
|
{% if ingress_nginx_host_network %}
|
2018-03-16 23:54:46 +00:00
|
|
|
hostNetwork: true
|
|
|
|
{% endif %}
|
2018-06-07 09:25:25 +00:00
|
|
|
{% if ingress_nginx_nodeselector %}
|
2018-03-16 23:54:46 +00:00
|
|
|
nodeSelector:
|
2018-06-07 09:25:25 +00:00
|
|
|
{{ ingress_nginx_nodeselector | to_nice_yaml }}
|
|
|
|
{%- 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 }}
|
|
|
|
args:
|
|
|
|
- /nginx-ingress-controller
|
2018-06-07 09:25:25 +00:00
|
|
|
- --default-backend-service=$(POD_NAMESPACE)/default-backend
|
2018-02-13 01:08:44 +00:00
|
|
|
- --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
|
|
|
|
- --publish-service=$(POD_NAMESPACE)/ingress-nginx
|
2018-02-13 01:08:44 +00:00
|
|
|
- --annotations-prefix=nginx.ingress.kubernetes.io
|
2018-06-07 09:25:25 +00:00
|
|
|
securityContext:
|
|
|
|
capabilities:
|
|
|
|
drop:
|
|
|
|
- ALL
|
|
|
|
add:
|
|
|
|
- NET_BIND_SERVICE
|
|
|
|
# www-data -> 33
|
|
|
|
runAsUser: 33
|
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
|
|
|
|
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
|
|
|
|
initialDelaySeconds: 10
|
|
|
|
periodSeconds: 10
|
|
|
|
successThreshold: 1
|
|
|
|
timeoutSeconds: 1
|
|
|
|
readinessProbe:
|
|
|
|
failureThreshold: 3
|
|
|
|
httpGet:
|
|
|
|
path: /healthz
|
|
|
|
port: 10254
|
|
|
|
scheme: HTTP
|
|
|
|
periodSeconds: 10
|
|
|
|
successThreshold: 1
|
|
|
|
timeoutSeconds: 1
|
2018-06-07 08:58:31 +00:00
|
|
|
securityContext:
|
|
|
|
runAsNonRoot: false
|