Skip to content

Commit b3d985a

Browse files
committed
Updated documentation
1 parent 57918f6 commit b3d985a

File tree

6 files changed

+73
-51
lines changed

6 files changed

+73
-51
lines changed

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ This repo provides implementations of an Ingress controller for NGINX and NGINX
44

55
## What is Ingress?
66

7-
An Ingress is a Kubernetes resource that lets you configure an HTTP load balancer for your Kubernetes services. Such a load balancer usually exposes your services to the clients outside of your Kubernetes cluster. An Ingress resource supports:
7+
An Ingress is a Kubernetes resource that lets you configure an HTTP load balancer for your Kubernetes services. Such a load balancer usually exposes your services to clients outside of your Kubernetes cluster. An Ingress resource supports:
88
* Exposing services:
99
* Via custom URLs (for example, service A at the URL `/serviceA` and service B at the URL `/serviceB`).
1010
* Via multiple host names (for example, `foo.example.com` for one group of services and `bar.example.com` for another group).
11-
* Configuring SSL termination per each exposed host name.
11+
* Configuring SSL termination for each exposed host name.
1212

1313
See the [Ingress User Guide](http://kubernetes.io/docs/user-guide/ingress/) to learn more.
1414

@@ -25,41 +25,49 @@ We provide Ingress controllers for NGINX and NGINX Plus that support the followi
2525
* Path-based rules
2626
* Multiple host names
2727

28-
Additionally, we provide a mechanism to customize the NGINX configuration.
28+
We provide the following extensions to our Ingress controllers:
29+
* [Websocket](examples/websocket), which allows you to load balance Websocket applications.
30+
* [SSL Services](examples/ssl-services), which allows you to load balance HTTPS applications.
31+
* [Rewrites](examples/rewrites), which allows you to rewrite the URI of a request before sending it to the application.
32+
* [Session Persistence](examples/session-persistence) (NGINX Plus only), which guarantees that all the requests from the same client are always passed to the same backend container.
2933

30-
Refer to the [examples folder](examples) to find out how to [deploy](examples/complete-example) NGINX Ingress Controllers and [customize](examples/customization) the NGINX configuration.
34+
Additionally, we provide a mechanism to customize the NGINX configuration. Refer to the [examples folder](examples) to find out how to [deploy](examples/complete-example) NGINX Ingress controllers and [customize](examples/customization) the NGINX configuration.
3135

32-
## Difference between NGINX and NGINX Plus controllers
36+
## Difference between NGINX and NGINX Plus Controllers
3337

3438
[NGINX Plus](https://www.nginx.com/products/) is a commercial version of NGINX that comes with advanced features and support.
3539

36-
Deployment of the NGINX Plus Ingress Controller requires you to do one extra step: build your own [Docker image](nginx-plus-controller) using the certificate and key of your license.
40+
Deployment of the NGINX Plus Ingress controller requires you to do one extra step: build your own [Docker image](nginx-plus-controller) using the certificate and key for your subscription.
3741
The Docker image of the NGINX Ingress controller is [available on Docker Hub](https://hub.docker.com/r/nginxdemos/nginx-ingress/).
3842

39-
The NGINX Plus Ingress Controller leverages the advanced features of NGINX Plus, which gives you the following additional benefits:
43+
The NGINX Plus Ingress controller leverages the advanced features of NGINX Plus, which gives you the following additional benefits:
4044

41-
* **Reduced Number of Configuration Reloads**
42-
Every time the number of pods of services you expose via Ingress changes, the Ingress controller updates the configuration of NGINX to reflect those changes. For open source NGINX software, the configuration file must be changed followed by the configuration reload. For NGINX Plus, we use the [on-the-fly reconfiguration](https://www.nginx.com/products/on-the-fly-reconfiguration/) feature, which allows you to update NGINX Plus on-the-fly without reloading the configuration. This prevents a potential increase of memory usage and overall system overloading, which could occur with frequent configuration reloads.
43-
* **Real-time Statistics**
45+
* **Reduced number of configuration reloads**
46+
Every time the number of pods of services you expose via Ingress changes, the Ingress controller updates the configuration of NGINX to reflect those changes. For the open source NGINX software, the configuration file must be changed and the configuration reloaded. For NGINX Plus, the [on-the-fly reconfiguration](https://www.nginx.com/products/on-the-fly-reconfiguration/) feature is utilized, which allows NGINX Plus to be updated on-the-fly without reloading the configuration. This prevents a potential increase of memory usage and overall system overloading, which could occur with too frequent configuration reloads.
47+
* **Real-time statistics**
4448
NGINX Plus provides you with [advanced statistics](https://www.nginx.com/products/live-activity-monitoring/), which you can access either through the API or via the built-in dashboard. This can give you insights into how NGINX Plus and your applications are performing.
45-
* **Session Persistence** When enabled, NGINX Plus makes sure that all the requests from the same client are always passed to the same backend container using the *sticky cookie* method. Refer to the [session persistence examples](examples/session-persistence) to find out how to configure it.
49+
* **Session persistence** When enabled, NGINX Plus makes sure that all the requests from the same client are always passed to the same backend container using the *sticky cookie* method. Refer to the [session persistence examples](examples/session-persistence) to find out how to configure it.
4650

4751
## Using Multiple Ingress Controllers
4852

4953
You can run multiple Ingress controllers at the same time. For example, if your Kubernetes cluster is deployed in cloud, you can run the NGINX controller and the corresponding cloud HTTP load balancing controller. Refer to the [example](examples/multiple-ingress-controllers) to learn more.
5054

51-
## Advanced load balancing (beyond Ingress)
55+
## Advanced Load Balancing (Beyond Ingress)
5256

5357
When your requirements go beyond what Ingress offers, you can use NGINX and
5458
NGINX Plus without the Ingress Controller.
5559

5660
NGINX Plus comes with a [DNS-based dynamic reconfiguration feature](https://www.nginx.com/blog/dns-service-discovery-nginx-plus/), which lets you keep the list of the endpoints of your services in sync with NGINX Plus. Read more about how to setup NGINX Plus this way in [Load Balancing Kubernetes Services with NGINX Plus](https://www.nginx.com/blog/load-balancing-kubernetes-services-nginx-plus/).
5761

58-
## Production status
62+
## Production Status
5963

60-
The status of the NGINX Ingress controllers is currently experimental.
64+
This is the preview version of the Ingress controllers.
65+
66+
## Support
67+
68+
Support from the [NGINX Professional Services Team](https://www.nginx.com/services/) is available when using the NGINX Plus Ingress controller.
6169

6270
## Contacts
6371

64-
We’d like to hear your feedback! If you have any suggestions or experience issues with our Ingress Controllers, please create an issue or send a pull request on Github.
65-
You can contact us directly via [[email protected]](mailto:[email protected]). Commercial support is available.
72+
We’d like to hear your feedback! If you have any suggestions or experience issues with our Ingress controllers, please create an issue or send a pull request on Github.
73+
You can contact us directly via [[email protected]](mailto:[email protected]).

examples/complete-example/README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,29 @@
22

33
## Prerequisites
44

5-
* Kubernetes 1.2 (TLS support for Ingress has been added in 1.2)
5+
* Kubernetes 1.2 and later (TLS support for Ingress has been added in 1.2)
66
* For NGINX Plus:
7-
* Build and make available in your cluster the [NGINX Plus](../../nginx-plus-controller) Controller image
7+
* Build and make available in your cluster the [NGINX Plus](../../nginx-plus-controller) controller image
88
* Update the container image field in the ```nginx-plus-ingress-rc.yaml``` file accordingly.
99

10-
## Running the example
10+
## Running the Example
11+
12+
## 1. Deploy the Ingress Controller
13+
14+
1. Create either an NGINX or an NGINX Plus Ingress controller:
15+
```
16+
$ kubectl create -f nginx-ingress-rc.yaml
17+
```
18+
or
19+
```
20+
$ kubectl create -f nginx-plus-ingress-rc.yaml
21+
```
22+
23+
1. The controller container exposes ports 80, 443 (and 8080 for NGINX Plus )
24+
on the host it is running on. Make sure to add a firewall rule to allow incoming traffic
25+
though these ports.
26+
27+
## 2. Deploy the Cafe Application
1128

1229
1. Create the coffee and the tea services and replication controllers:
1330

@@ -17,6 +34,9 @@
1734
$ kubectl create -f coffee-rc.yaml
1835
$ kubectl create -f coffee-svc.yaml
1936
```
37+
38+
## 3. Configure Load Balancing
39+
2040
1. Create a secret with an SSL certificate and a key:
2141
```
2242
$ kubectl create -f cafe-secret.yaml
@@ -27,18 +47,7 @@
2747
$ kubectl create -f cafe-ingress.yaml
2848
```
2949

30-
1. Create either an NGINX or an NGINX Plus Ingress Controller:
31-
```
32-
$ kubectl create -f nginx-ingress-rc.yaml
33-
```
34-
or
35-
```
36-
$ kubectl create -f nginx-plus-ingress-rc.yaml
37-
```
38-
39-
1. The Controller container exposes ports 80, 443 (and 8080 for NGINX Plus )
40-
on the host it is running on. Make sure to add a firewall rule to allow incoming traffic
41-
though these ports.
50+
## 4. Test the Application
4251

4352
1. Find out the external IP address of the node where the controller is running:
4453
```

examples/customization/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NGINX directives:
1010

1111
## Using ConfigMaps
1212

13-
1. Make sure that you specify the configmaps resource to use when you start an Ingress Controller.
13+
1. Make sure that you specify the configmaps resource to use when you start an Ingress controller.
1414
For example, `-nginx-configmaps=default/nginx-config`, where we specify
1515
the config map to use with the following format: `<namespace>/<name>`. See [nginx-ingress-rc.yaml](../complete-example/nginx-ingress-rc.yaml) or
1616
[nginx-plus-ingress-rc.yaml](../complete-example/nginx-plus-ingress-rc.yaml) files.

examples/rewrites/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Rewrites Support
22

3-
To load balance an application that requires rewrites with NGINX Ingress controllers, you need to add the **nginx.org/rewrites** annotation to your Ingress resource definition. The annotation specifies which services need rewrites. The annotation syntax is as follows:
3+
You can configure NGINX to rewrite the URI of a request before sending it to the application. For example, `/tea/green` can be rewritten to `/green`.
4+
5+
## Syntax
6+
7+
To configure URI rewriting you need to add the **nginx.org/rewrites** annotation to your Ingress resource definition. The annotation syntax is as follows:
48
```
5-
nginx.org/rewrites: "serviceName=service1 rewrite=/rewrite1/[;serviceName=service2 rewrite=/rewrite2/;...]"
9+
nginx.org/rewrites: "serviceName=service1 rewrite=rewrite1[;serviceName=service2 rewrite=rewrite2;...]"
610
```
711

8-
In the following example we load balance two applications, which require rewrites:
12+
## Example
13+
14+
In the following example we load balance two applications that require URI rewriting:
915
```yaml
1016
apiVersion: extensions/v1beta1
1117
kind: Ingress
@@ -28,14 +34,11 @@ spec:
2834
servicePort: 80
2935
```
3036
31-
Requests to the tea service are rewritten as follows:
32-
33-
* /tea -> gets redirected to /tea/ first
34-
* /tea/ -> /
35-
* /tea/abc -> /abc
37+
Below are the examples of how the URI of requests to the *tea-svc* are rewritten (Note that the `/tea` requests are redirected to `/tea/`).
38+
* `/tea/` -> `/`
39+
* `/tea/abc` -> `/abc`
3640

37-
Requests to the coffee service are rewritten as follows:
41+
Below are the examples of how the URI of requests to the *coffee-svc* are rewritten (Note that the `/coffee` requests are redirected to `/coffee/`).
3842

39-
* /coffee -> gets redirected to /coffee/ first
40-
* /coffee/ -> /beans/
41-
* /coffee/abc -> /beans/abc
43+
* `/coffee/` -> `/beans/`
44+
* `/coffee/abc` -> `/beans/abc`

nginx-controller/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ We build the image using the make utility. The **Makefile** we provide has the f
2727

2828
The **Makefile** contains the following main variables, which you should customize (either by changing the Makefile or by overriding the variables in the make command):
2929
* **PREFIX** -- the name of the image. For example, `nginx-ingress`
30-
* **TAG** -- the tag added to the image. For example, `0.3`
31-
* **PUSH_TO_GCR** . If you’re running your Kubernetes in GCE and using Google Container Registry, make sure that `PUSH_TO_GCR = 1`. This means using the `gcloud docker push` command to push the image, which is convenient when pushing images to GCR. By default, the variable is unset and the regular `docker push` command is used to push the image to the registry.
30+
* **VERSION** -- the current version of the controller.
31+
* **TAG** -- the tag added to the image. It's set to the value of the `VERSION` variable by default.
32+
* **PUSH_TO_GCR**. If you’re running your Kubernetes in GCE and using Google Container Registry, make sure that `PUSH_TO_GCR = 1`. This means using the `gcloud docker push` command to push the image, which is convenient when pushing images to GCR. By default, the variable is unset and the regular `docker push` command is used to push the image to the registry.
3233

3334
Let’s create the controller binary, build an image and push the image to the private registry. Make sure to run the `docker login` command first to login to the registry. If you’re using Google Container Registry, as we are in our example here, you don’t need to use the docker command to login. However, make sure you’re logged into the gcloud tool (using the `gcloud auth login` command).
3435

3536
In this folder we run the following commands in the shell:
3637
```
3738
$ make clean
38-
$ make PREFIX=gcr.io/my-k8s-project/nginx-ingress TAG=0.3 PUSH_TO_GCR=1
39+
$ make PREFIX=gcr.io/my-k8s-project/nginx-ingress TAG=latest PUSH_TO_GCR=1
3940
```
4041

41-
Where **my-k8s-project** is the name of the GCE project where we run our Kubernetes cluster. As the result, the image -- **gcr.io/my-k8s-project/nginx-ingress:0.3** -- is built and pushed to the registry.
42+
Where **my-k8s-project** is the name of the GCE project where we run our Kubernetes cluster. As the result, the image -- **gcr.io/my-k8s-project/nginx-ingress:latest** -- is built and pushed to the registry.
4243

4344
By default, to compile the controller we use the [golang](https://hub.docker.com/_/golang/) container that we run as part of the building process. If you want to compile the controller using your local golang environment, specify `BUILD_IN_CONTAINER=0` when you run the make command.

nginx-plus-controller/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ We build the image using the make utility. The **Makefile** we provide has the f
2525

2626
The **Makefile** contains the following main variables, which you should customize (either by changing the Makefile or by overriding the variables in the make command):
2727
* **PREFIX** -- the name of the image. For example, `nginx-plus-ingress`
28-
* **TAG** -- the tag added to the image. For example, `0.3`
28+
* **VERSION** -- the current version of the controller.
29+
* **TAG** -- the tag added to the image. It's set to the value of the `VERSION` variable by default.
2930
* **PUSH_TO_GCR** . If you’re running your Kubernetes in GCE and using Google Container Registry, make sure that `PUSH_TO_GCR = 1`. This means using the `gcloud docker push` command to push the image, which is convenient when pushing images to GCR. By default, the variable is unset and the regular `docker push` command is used to push the image to the registry.
3031

3132
Let’s create the controller binary, build an image and push the image to the private registry. Make sure to run the `docker login` command first to login to the registry. If you’re using Google Container Registry, as we are in our example here, you don’t need to use the docker command to login. However, make sure you’re logged into the gcloud tool (using the `gcloud auth login` command).
3233

3334
In this folder we run the following commands in the shell:
3435
```
3536
$ make clean
36-
$ make PREFIX=gcr.io/my-k8s-project/nginx-plus-ingress TAG=0.3 PUSH_TO_GCR=1
37+
$ make PREFIX=gcr.io/my-k8s-project/nginx-plus-ingress TAG=latest PUSH_TO_GCR=1
3738
```
3839

39-
Where **my-k8s-project** is the name of the GCE project where we run our Kubernetes cluster. As the result, the image -- **gcr.io/my-k8s-project/nginx-plus-ingress:0.3** -- is built and pushed to the registry.
40+
Where **my-k8s-project** is the name of the GCE project where we run our Kubernetes cluster. As the result, the image -- **gcr.io/my-k8s-project/nginx-plus-ingress:latest** -- is built and pushed to the registry.
4041

4142
By default, to compile the controller we use the [golang](https://hub.docker.com/_/golang/) container that we run as part of the building process. If you want to compile the controller using your local golang environment, specify `BUILD_IN_CONTAINER=0` when you run the make command.

0 commit comments

Comments
 (0)