Skip to content

Commit

Permalink
deployment nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmarceleza committed Nov 25, 2021
1 parent 76ed0c1 commit 1f2c114
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
33 changes: 33 additions & 0 deletions haproxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# HAProxy

# Use HAProxy with Docker

## Using your own image

Create a Dockerfile:
```
FROM haproxy:2.3
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
```
Build the container:
```
$ docker build -t my-haproxy .
```
Test the configuration file
```
$ docker run -it --rm --name haproxy-syntax-check my-haproxy haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
```
Run the container:
```
$ docker run -d --name my-running-haproxy --sysctl net.ipv4.ip_unprivileged_port_start=0 my-haproxy
```

## Directly via bind mount

```
$ docker run -d --name my-running-haproxy -v /path/to/etc/haproxy:/usr/local/etc/haproxy:ro --sysctl net.ipv4.ip_unprivileged_port_start=0 haproxy:2.3
```
Reloading config:
```
$ docker kill -s HUP my-running-haproxy
```
20 changes: 20 additions & 0 deletions kubernetes/deployment/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: app1
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:alpine
name: nginx

0 comments on commit 1f2c114

Please sign in to comment.