Skip to content

Commit

Permalink
Merge pull request #703 from jcmoraisjr/jm-haproxy-configmap
Browse files Browse the repository at this point in the history
HAProxy deployment doc improvements
  • Loading branch information
aledbf authored May 11, 2017
2 parents 335c473 + 4c753fc commit 186615d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
43 changes: 30 additions & 13 deletions examples/deployment/haproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,8 @@ they will fight for Ingresses. This includes any cloudprovider controller.

This document has also the following prerequisites:

* Deploy a [web app](/examples/PREREQUISITES.md#test-http-service) for testing
* Create a [TLS secret](/examples/PREREQUISITES.md#tls-certificates) named `tls-secret` to be used as default TLS certificate

The web app can be created as follow:

```console
$ kubectl run http-svc \
--image=gcr.io/google_containers/echoserver:1.3 \
--port=8080 \
--replicas=2 \
--expose
```
* Optional: deploy a [web app](/examples/PREREQUISITES.md#test-http-service) for testing

Creating the TLS secret:

Expand All @@ -35,6 +25,16 @@ $ kubectl create secret tls tls-secret --cert=tls.crt --key=tls.key
$ rm -v tls.crt tls.key
```

The optional web app can be created as follow:

```console
$ kubectl run http-svc \
--image=gcr.io/google_containers/echoserver:1.3 \
--port=8080 \
--replicas=1 \
--expose
```

## Default backend

Deploy a default backend used to serve `404 Not Found` pages:
Expand All @@ -55,6 +55,21 @@ NAME READY STATUS RESTARTS AGE
ingress-default-backend-1110790216-gqr61 1/1 Running 0 10s
```

## Configmap

Create a configmap named `haproxy-ingress`:

```console
$ kubectl create configmap haproxy-ingress
configmap "haproxy-ingress" created
```

A configmap is used to provide global or default configuration like
timeouts, SSL/TLS settings, a syslog service endpoint and so on. The
configmap can be edited or replaced later in order to apply new
configuration on a running ingress controller. All supported options
are [here](https://github.com/jcmoraisjr/haproxy-ingress#configmap).

## Controller

Deploy HAProxy Ingress:
Expand All @@ -73,7 +88,9 @@ ingress-default-backend-1110790216-gqr61 1/1 Running 0 3m
^C
```

Deploy the ingress resource of our already deployed web app:
## Testing

From now the optional web app should be deployed. Deploy an ingress resource to expose this app:

```console
$ kubectl create -f - <<EOF
Expand All @@ -93,7 +110,7 @@ spec:
EOF
```

Exposing the controller as a `type=NodePort` service:
Expose the Ingress controller as a `type=NodePort` service:

```console
$ kubectl expose deploy/haproxy-ingress --type=NodePort
Expand Down
1 change: 1 addition & 0 deletions examples/deployment/haproxy/haproxy-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
args:
- --default-backend-service=default/ingress-default-backend
- --default-ssl-certificate=default/tls-secret
- --configmap=default/haproxy-ingress
ports:
- name: http
containerPort: 80
Expand Down

0 comments on commit 186615d

Please sign in to comment.