2018-02-13 09:08:44 +08: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 }}
|
|
|
|
annotations:
|
|
|
|
prometheus.io/port: '10254'
|
|
|
|
prometheus.io/scrape: 'true'
|
|
|
|
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 13:47:36 +08:00
|
|
|
annotations:
|
|
|
|
prometheus.io/port: '10254'
|
|
|
|
prometheus.io/scrape: 'true'
|
2018-02-13 09:08:44 +08:00
|
|
|
spec:
|
2018-03-19 17:59:38 +08:00
|
|
|
{% if ingress_nginx_host_network %}
|
2018-03-17 07:54:46 +08:00
|
|
|
hostNetwork: true
|
|
|
|
{% endif %}
|
|
|
|
nodeSelector:
|
|
|
|
node-role.kubernetes.io/ingress: "true"
|
|
|
|
terminationGracePeriodSeconds: 60
|
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
|
|
|
|
- --default-backend-service=$(POD_NAMESPACE)/ingress-nginx-default-backend
|
|
|
|
- --configmap=$(POD_NAMESPACE)/ingress-nginx
|
|
|
|
- --tcp-services-configmap=$(POD_NAMESPACE)/ingress-nginx-tcp-services
|
|
|
|
- --udp-services-configmap=$(POD_NAMESPACE)/ingress-nginx-udp-services
|
|
|
|
- --annotations-prefix=nginx.ingress.kubernetes.io
|
|
|
|
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-03-05 23:11:18 +08:00
|
|
|
{% if rbac_enabled %}
|
|
|
|
serviceAccountName: ingress-nginx
|
|
|
|
{% endif %}
|
2018-03-20 15:23:50 +08:00
|
|
|
|