File tree 2 files changed +88
-0
lines changed
examples/scaling-deployment/nginx
2 files changed +88
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Deploying multi Nginx Ingress Controllers
2
+
3
+ This example aims to demonstrate the Deployment of multi nginx ingress controllers.
4
+
5
+ ## Default Backend
6
+
7
+ The default backend is a service of handling all url paths and hosts the nginx controller doesn't understand. Deploy the default-http-backend as follow:
8
+
9
+ ``` console
10
+ $ kubectl apply -f ../../deployment/nginx/default-backend.yaml
11
+ deployment "default-http-backend" configured
12
+ service "default-http-backend" configured
13
+
14
+ $ kubectl -n kube-system get svc
15
+ NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
16
+ default-http-backend 192.168.3.52 <none> 80/TCP 6m
17
+
18
+ $ kubectl -n kube-system get po
19
+ NAME READY STATUS RESTARTS AGE
20
+ default-http-backend-2657704409-wz6o3 1/1 Running 0 6m
21
+ ```
22
+
23
+ ## Ingress Deployment
24
+
25
+ Deploy the Deployment of multi controllers as follows:
26
+
27
+ ``` console
28
+ $ kubectl apply -f nginx-ingress-deployment.yaml
29
+ deployment "nginx-ingress-controller" created
30
+
31
+ $ kubectl -n kube-system get deployment
32
+ NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
33
+ default-http-backend 1 1 1 1 16m
34
+ nginx-ingress-controller 2 2 2 2 24s
35
+
36
+ $ kubectl -n kube-system get po
37
+ NAME READY STATUS RESTARTS AGE
38
+ default-http-backend-2657704409-wz6o3 1/1 Running 0 16m
39
+ nginx-ingress-controller-3752011415-0qbi6 1/1 Running 0 39s
40
+ nginx-ingress-controller-3752011415-vi8fq 1/1 Running 0 39s
41
+ ```
Original file line number Diff line number Diff line change
1
+ apiVersion : extensions/v1beta1
2
+ kind : Deployment
3
+ metadata :
4
+ name : nginx-ingress-controller
5
+ labels :
6
+ k8s-app : nginx-ingress-controller
7
+ namespace : kube-system
8
+ spec :
9
+ replicas : 2
10
+ template :
11
+ metadata :
12
+ labels :
13
+ k8s-app : nginx-ingress-controller
14
+ spec :
15
+ terminationGracePeriodSeconds : 60
16
+ containers :
17
+ - image : gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.2
18
+ name : nginx-ingress-controller
19
+ readinessProbe :
20
+ httpGet :
21
+ path : /healthz
22
+ port : 10254
23
+ scheme : HTTP
24
+ livenessProbe :
25
+ httpGet :
26
+ path : /healthz
27
+ port : 10254
28
+ scheme : HTTP
29
+ initialDelaySeconds : 10
30
+ timeoutSeconds : 1
31
+ ports :
32
+ - containerPort : 80
33
+ hostPort : 80
34
+ - containerPort : 443
35
+ hostPort : 443
36
+ env :
37
+ - name : POD_NAME
38
+ valueFrom :
39
+ fieldRef :
40
+ fieldPath : metadata.name
41
+ - name : POD_NAMESPACE
42
+ valueFrom :
43
+ fieldRef :
44
+ fieldPath : metadata.namespace
45
+ args :
46
+ - /nginx-ingress-controller
47
+ - --default-backend-service=$(POD_NAMESPACE)/default-http-backend
You can’t perform that action at this time.
0 commit comments