Skip to content

Commit

Permalink
Merge pull request #1536 from aledbf/update-docs
Browse files Browse the repository at this point in the history
Update documentation and examples [ci skip]
  • Loading branch information
aledbf authored Oct 16, 2017
2 parents e0525f7 + 32ca583 commit 9fc2836
Show file tree
Hide file tree
Showing 24 changed files with 192 additions and 661 deletions.
3 changes: 3 additions & 0 deletions deploy/with-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ spec:
metadata:
labels:
app: ingress-nginx
annotations:
prometheus.io/port: '10254'
prometheus.io/scrape: 'true'
spec:
serviceAccountName: nginx-ingress-serviceaccount
containers:
Expand Down
3 changes: 3 additions & 0 deletions deploy/without-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ spec:
metadata:
labels:
app: ingress-nginx
annotations:
prometheus.io/port: '10254'
prometheus.io/scrape: 'true'
spec:
containers:
- name: nginx-ingress-controller
Expand Down
7 changes: 3 additions & 4 deletions docs/examples/customization/custom-configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Using a [ConfigMap](https://kubernetes.io/docs/user-guide/configmap/) is possibl
For example, if we want to change the timeouts we need to create a ConfigMap:

```
$ cat nginx-load-balancer-conf.yaml
$ cat configmap.yaml
apiVersion: v1
data:
proxy-connect-timeout: "10"
Expand All @@ -16,9 +16,8 @@ metadata:
```

```
$ kubectl create -f nginx-load-balancer-conf.yaml
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/customization/cutom-configuration/configmap.yaml \
| kubectl apply -f -
```

Please check the example `nginx-custom-configuration.yaml`

If the Configmap it is updated, NGINX will be reloaded with the new configuration.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-custom-configuration
name: nginx-configuration
namespace: ingress-nginx
labels:
k8s-app: nginx-ingress-controller
namespace: kube-system
app: ingress-nginx
data:
proxy-connect-timeout: "10"
proxy-read-timeout: "120"
Expand Down

This file was deleted.

67 changes: 5 additions & 62 deletions docs/examples/customization/custom-headers/README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,16 @@
# Deploying the Nginx Ingress controller
# Custom configuration

This example aims to demonstrate the deployment of an nginx ingress controller and
use a ConfigMap to configure a custom list of headers to be passed to the upstream
server

## Default Backend

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 apply -f default-backend.yaml
deployment "default-http-backend" created
service "default-http-backend" created

$ kubectl -n kube-system get po
NAME READY STATUS RESTARTS AGE
default-http-backend-2657704409-qgwdd 1/1 Running 0 28s
```

## Custom configuration

```console
$ cat nginx-load-balancer-conf.yaml
apiVersion: v1
data:
proxy-set-headers: "default/custom-headers"
kind: ConfigMap
metadata:
name: nginx-load-balancer-conf
```

```console
$ kubectl create -f nginx-load-balancer-conf.yaml
```

## Custom headers

```console
$ cat custom-headers.yaml
apiVersion: v1
data:
X-Different-Name: "true"
X-Request-Start: t=${msec}
X-Using-Nginx-Controller: "true"
kind: ConfigMap
metadata:
name: proxy-headers
namespace: default
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/customization/custom-headers/configmap.yaml \
| kubectl apply -f -

```

```console
$ kubectl create -f custom-headers.yaml
```

## Controller

You can deploy the controller as follows:

```console
$ kubectl apply -f nginx-ingress-controller.yaml
deployment "nginx-ingress-controller" created
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/customization/custom-headers/custom-headers.yaml \
| kubectl apply -f -

$ 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
```

## Test
Expand Down
9 changes: 9 additions & 0 deletions docs/examples/customization/custom-headers/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
data:
proxy-set-headers: "ingress-nginx/custom-headers"
kind: ConfigMap
metadata:
name: nginx-configuration
namespace: ingress-nginx
labels:
app: ingress-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ data:
kind: ConfigMap
metadata:
name: custom-headers
namespace: kube-system
namespace: ingress-nginx
51 changes: 0 additions & 51 deletions docs/examples/customization/custom-headers/default-backend.yaml

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9fc2836

Please sign in to comment.