forked from wardviaene/kubernetes-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update nginx ingress to latest version
- Loading branch information
1 parent
79ffd07
commit 3f81e2f
Showing
1 changed file
with
206 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,215 @@ | ||
apiVersion: v1 | ||
kind: ReplicationController | ||
# updated this file with the latest ingress-controller from https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml | ||
apiVersion: extensions/v1beta1 | ||
kind: DaemonSet | ||
metadata: | ||
name: nginx-ingress-controller | ||
labels: | ||
k8s-app: nginx-ingress-lb | ||
spec: | ||
replicas: 1 | ||
selector: | ||
k8s-app: nginx-ingress-lb | ||
matchLabels: | ||
app: ingress-nginx | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: nginx-ingress-lb | ||
name: nginx-ingress-lb | ||
app: ingress-nginx | ||
spec: | ||
terminationGracePeriodSeconds: 60 | ||
serviceAccountName: nginx-ingress-serviceaccount | ||
containers: | ||
- image: gcr.io/google_containers/nginx-ingress-controller:0.8.3 | ||
name: nginx-ingress-lb | ||
imagePullPolicy: Always | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 10254 | ||
scheme: HTTP | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 10254 | ||
scheme: HTTP | ||
initialDelaySeconds: 10 | ||
timeoutSeconds: 1 | ||
# use downward API | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
ports: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
- containerPort: 443 | ||
hostPort: 443 | ||
args: | ||
- /nginx-ingress-controller | ||
- --default-backend-service=$(POD_NAMESPACE)/echoheaders-default | ||
- name: nginx-ingress-controller | ||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.17.1 | ||
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 | ||
securityContext: | ||
capabilities: | ||
drop: | ||
- ALL | ||
add: | ||
- NET_BIND_SERVICE | ||
# www-data -> 33 | ||
runAsUser: 33 | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
hostPort: 80 | ||
- name: https | ||
containerPort: 443 | ||
hostPort: 443 | ||
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 | ||
--- | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-configuration | ||
labels: | ||
app: ingress-nginx | ||
--- | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: tcp-services | ||
--- | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: udp-services | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: nginx-ingress-serviceaccount | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
name: nginx-ingress-clusterrole | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- endpoints | ||
- nodes | ||
- pods | ||
- secrets | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "extensions" | ||
resources: | ||
- ingresses | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
- apiGroups: | ||
- "extensions" | ||
resources: | ||
- ingresses/status | ||
verbs: | ||
- update | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: Role | ||
metadata: | ||
name: nginx-ingress-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- pods | ||
- secrets | ||
- namespaces | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
resourceNames: | ||
# Defaults to "<election-id>-<ingress-class>" | ||
# Here: "<ingress-controller-leader>-<nginx>" | ||
# This has to be adapted if you change either parameter | ||
# when launching the nginx-ingress-controller. | ||
- "ingress-controller-leader-nginx" | ||
verbs: | ||
- get | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- endpoints | ||
verbs: | ||
- get | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
name: nginx-ingress-role-nisa-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: nginx-ingress-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: nginx-ingress-serviceaccount | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: nginx-ingress-clusterrole-nisa-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: nginx-ingress-clusterrole | ||
subjects: | ||
- kind: ServiceAccount | ||
name: nginx-ingress-serviceaccount | ||
namespace: default | ||
--- | ||
|