Update the nginx controller manifests to run in the kube-system namespace, be deployments and some general cleanup
This commit is contained in:
parent
567fa3b456
commit
4f3e5b77d3
3 changed files with 51 additions and 38 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# Deploying an Nginx Ingress controller
|
||||
# Deploying the Nginx Ingress controller
|
||||
|
||||
This example aims to demonstrate the deployment of an nginx ingress controller.
|
||||
|
||||
|
|
@ -7,16 +7,15 @@ This example aims to demonstrate the deployment of an nginx ingress controller.
|
|||
The default backend is a Service capable of handling all url paths and hosts the
|
||||
nginx controller doesn't understand. This most basic implementation just returns
|
||||
a 404 page:
|
||||
|
||||
```console
|
||||
$ kubectl create -f default-backend.yaml
|
||||
replicationcontroller "default-http-backend" created
|
||||
$ kubectl apply -f default-backend.yaml
|
||||
deployment "default-http-backend" created
|
||||
service "default-http-backend" created
|
||||
|
||||
$ kubectl expose rc default-http-backend --port=80 --target-port=8080 --name=default-http-backend
|
||||
service "default-http-backend" exposed
|
||||
|
||||
$ kubectl get po
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
default-http-backend-ppqdj 1/1 Running 0 1m
|
||||
$ kubectl -n kube-system get po
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
default-http-backend-2657704409-qgwdd 1/1 Running 0 28s
|
||||
```
|
||||
|
||||
## Controller
|
||||
|
|
@ -24,18 +23,18 @@ default-http-backend-ppqdj 1/1 Running 0 1m
|
|||
You can deploy the controller as follows:
|
||||
|
||||
```console
|
||||
$ kubectl create -f rc.yaml
|
||||
replicationcontroller "nginx-ingress-controller" created
|
||||
$ kubectl apply -f nginx-ingress-controller.yaml
|
||||
deployment "nginx-ingress-controller" created
|
||||
|
||||
$ kubectl get po
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
default-http-backend-ppqdj 1/1 Running 0 1m
|
||||
nginx-ingress-controller-vbgf9 0/1 ContainerCreating 0 2s
|
||||
$ kubectl -n kube-system get po
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
default-http-backend-2657704409-qgwdd 1/1 Running 0 2m
|
||||
nginx-ingress-controller-873061567-4n3k2 1/1 Running 0 42s
|
||||
```
|
||||
|
||||
Note the default settings of this controller:
|
||||
* serves a `/healthz` url on port 10254, as both a liveness and readiness probe
|
||||
* takes a `--default-backend-service` arg pointing to a Service, created above
|
||||
* takes a `--default-backend-service` argument pointing to the Service created above
|
||||
|
||||
## Running on a cloud provider
|
||||
|
||||
|
|
@ -44,6 +43,3 @@ the provider also has a native Ingress controller and set the annotation
|
|||
`kubernetes.io/ingress.class: nginx` in all Ingresses meant for this controller.
|
||||
You might also need to open a firewall-rule for ports 80/443 of the nodes the
|
||||
controller is running on.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue