diff --git a/ingress/nginx-ingress-controller.yml b/ingress/nginx-ingress-controller.yml index ae78e20..4f290f8 100644 --- a/ingress/nginx-ingress-controller.yml +++ b/ingress/nginx-ingress-controller.yml @@ -15,23 +15,28 @@ spec: serviceAccountName: nginx-ingress-serviceaccount containers: - name: nginx-ingress-controller - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.17.1 + image: k8s.gcr.io/ingress-nginx/controller:v1.1.0@sha256:f766669fdcf3dc26347ed273a55e754b427eb4411ee075a53f30718b4499076a + lifecycle: + preStop: + exec: + command: + - /wait-shutdown args: - /nginx-ingress-controller - - --default-backend-service=$(POD_NAMESPACE)/echoheaders-default - - --configmap=$(POD_NAMESPACE)/nginx-configuration - - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services - - --udp-services-configmap=$(POD_NAMESPACE)/udp-services - - --publish-service=$(POD_NAMESPACE)/ingress-nginx - - --annotations-prefix=nginx.ingress.kubernetes.io + - --election-id=ingress-controller-leader + - --controller-class=k8s.io/ingress-nginx + - --configmap=$(POD_NAMESPACE)/ingress-nginx-controller + - --validating-webhook=:8443 + - --validating-webhook-certificate=/usr/local/certificates/cert + - --validating-webhook-key=/usr/local/certificates/key securityContext: capabilities: - drop: + drop: - ALL - add: + add: - NET_BIND_SERVICE - # www-data -> 33 - runAsUser: 33 + # www-data -> 101 + runAsUser: 101 env: - name: POD_NAME valueFrom: @@ -49,7 +54,7 @@ spec: containerPort: 443 hostPort: 443 livenessProbe: - failureThreshold: 3 + failureThreshold: 5 httpGet: path: /healthz port: 10254 @@ -64,6 +69,7 @@ spec: path: /healthz port: 10254 scheme: HTTP + initialDelaySeconds: 10 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 @@ -92,7 +98,7 @@ metadata: --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: nginx-ingress-clusterrole @@ -124,6 +130,7 @@ rules: - watch - apiGroups: - "extensions" + - "networking.k8s.io" resources: - ingresses verbs: @@ -139,14 +146,35 @@ rules: - patch - apiGroups: - "extensions" + - "networking.k8s.io" resources: - ingresses/status verbs: - update - + - apiGroups: + - '' + resources: + - configmaps + resourceNames: + - ingress-controller-leader + verbs: + - get + - update + - apiGroups: + - '' + resources: + - configmaps + verbs: + - create + - apiGroups: + - '' + resources: + - events + verbs: + - create + - patch --- - -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: nginx-ingress-role @@ -186,7 +214,7 @@ rules: verbs: - get --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: nginx-ingress-role-nisa-binding @@ -199,7 +227,7 @@ subjects: name: nginx-ingress-serviceaccount --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: nginx-ingress-clusterrole-nisa-binding @@ -212,4 +240,51 @@ subjects: name: nginx-ingress-serviceaccount namespace: default --- - +# Source: ingress-nginx/templates/controller-service-webhook.yaml +apiVersion: v1 +kind: Service +metadata: + labels: + helm.sh/chart: ingress-nginx-3.10.1 + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/version: 0.41.2 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: controller + name: ingress-nginx-controller-admission +spec: + type: ClusterIP + ports: + - name: https-webhook + port: 443 + targetPort: webhook + selector: + app: ingress-nginx +--- +# Source: ingress-nginx/templates/controller-service.yaml +apiVersion: v1 +kind: Service +metadata: + annotations: + labels: + helm.sh/chart: ingress-nginx-3.10.1 + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/version: 0.41.2 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: controller + name: ingress-nginx +spec: + type: NodePort + ports: + - name: http + port: 80 + protocol: TCP + targetPort: http + - name: https + port: 443 + protocol: TCP + targetPort: https + selector: + app: ingress-nginx +---