1
0
Fork 0

Merge branch 'master' into 4.4.0

This commit is contained in:
Joao Gilberto Magalhaes 2023-02-12 19:57:52 -06:00
commit aafa0bcae6
8 changed files with 160 additions and 67 deletions

View file

@ -5,6 +5,7 @@
[![GitHub source](https://img.shields.io/badge/Github-source-informational?logo=github)](https://github.com/byjg/docker-easy-haproxy/)
[![GitHub license](https://img.shields.io/github/license/byjg/docker-easy-haproxy.svg)](https://opensource.byjg.com/opensource/licensing.html)
[![GitHub release](https://img.shields.io/github/release/byjg/docker-easy-haproxy.svg)](https://github.com/byjg/docker-easy-haproxy/releases/)
[![Helm Version](https://img.shields.io/badge/dynamic/yaml?color=blue&label=Helm&query=%24.entries.easyhaproxy%5B0%5D.version&url=http%3A%2F%2Fopensource.byjg.com%2Fhelm%2Findex.yaml)](https://opensource.byjg.com/helm)
![EasyHAProxy](docs/easyhaproxy_logo.png)
@ -41,26 +42,35 @@ The steps are:
- Run the EasyHAProxy container;
- Add some labels to the containers you want to be parsed by EasyHAProxy (see detailed instructions below);
- EasyHAProxy will automatically detect the containers, set up, and reload the HAProxy configurations for you without downtime.
- EasyHAProxy will automatically detect the containers, set up, and reload the HAProxy configurations for you without downtime.
## Detailed Instructions
For detailed instructions on how to use EasyHAProxy, follow the instructions for the platform you want to use:
| [Kubernetes](docs/kubernetes.md) | [Docker Swarm](docs/swarm.md) | [Docker](docs/docker.md) | [Static](docs/static.md)
|:----------:|:------------:|:------:|:-------:
| ![Kubernetes](docs/easyhaproxy_kubernetes.png) | ![Docker Swarm](docs/easyhaproxy_swarm.png) | ![Docker](docs/easyhaproxy_docker.png) | ![Static](docs/easyhaproxy_static.png)
[![Kubernetes](docs/easyhaproxy_kubernetes.png)](docs/kubernetes.md)
[![Docker Swarm](docs/easyhaproxy_swarm.png)](docs/swarm.md)
[![Docker](docs/easyhaproxy_docker.png)](docs/docker.md)
[![Static](docs/easyhaproxy_static.png)](docs/static.md)
Or you can install using tools:
[![Helm](docs/easyhaproxy_helm.png)](docs/helm.md)
[![MicroK8s](docs/easyhaproxy_microk8s.png)](docs/microk8s.md)
[![Dokku](docs/easyhaproxy_dokku.png)](docs/dokku.md)
## See EasyHAProxy in action
Click on the image to see the videos (use HD for better visualization)
| | |
|:----------:|:------------:|
| [![Docker In Action](docs/video-docker.png)](https://youtu.be/ar8raFK0R1k) | [![Docker and Letsencrypt](docs/video-docker-ssl.png)](https://youtu.be/xwIdj9mc2mU) |
| [![K8s In Action](docs/video-kubernetes.png)](https://youtu.be/uq7TuLIijks) | [![K8s and Letsencrypt](docs/video-kubernetes-letsencrypt.png)](https://youtu.be/v9Q4M5Al7AQ) |
| [![Static Configuration](docs/video-static.png)](https://youtu.be/B_bYZnRTGJM) | [![TCP Mode](docs/video-tcp-mysql.png)](https://youtu.be/JHqcq9crbDI) |
[Here is the code](https://gist.github.com/byjg/e125e478a0562190176d69ea795fd3d4) applied in the examples above.
[![Docker In Action](docs/video-docker.png)](https://youtu.be/ar8raFK0R1k)
[![Docker and Letsencrypt](docs/video-docker-ssl.png)](https://youtu.be/xwIdj9mc2mU)
[![K8s In Action](docs/video-kubernetes.png)](https://youtu.be/uq7TuLIijks)
[![K8s and Letsencrypt](docs/video-kubernetes-letsencrypt.png)](https://youtu.be/v9Q4M5Al7AQ)
[![Static Configuration](docs/video-static.png)](https://youtu.be/B_bYZnRTGJM)
[![TCP Mode](docs/video-tcp-mysql.png)](https://youtu.be/JHqcq9crbDI)
[Here is the code](https://gist.github.com/byjg/e125e478a0562190176d69ea795fd3d4) applied in the examples above.
----
[Open source ByJG](http://opensource.byjg.com)

7
docs/dokku.md Normal file
View file

@ -0,0 +1,7 @@
# Dokku
Dokku is a Docker powered mini-Heroku in around 100 lines of Bash. It is the smallest PaaS implementation you've ever seen, weighing in at a little over 100 MB of memory usage and about 80 MB of disk space.
## Installing EasyHAProxy on Dokku
Please refer to the [official documentation](https://github.com/dokku/dokku/blob/master/docs/networking/proxies/haproxy.md).

BIN
docs/easyhaproxy_dokku.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
docs/easyhaproxy_helm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

79
docs/helm.md Normal file
View file

@ -0,0 +1,79 @@
# Helm 3
Helm is a package manager for Kubernetes. It allows you to install and manage applications on Kubernetes.
## Setup EasyHAProxy with Helm 3
### 1) Identify the node where your EasyHAProxy container will run
EasyHAProxy will be limited to a single node. To understand that see [limitations](limitations.md) page.
```bash
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
node-01 Ready <none> 561d v1.21.13-3
node-02 Ready <none> 561d v1.21.13-3
```
Add the EasyHAProxy label to the node.
```bash
kubectl label nodes node-01 "easyhaproxy/node=master"
```
### 2) Install EasyHAProxy
Minimal configuration
```bash
helm repo add byjg https://opensource.byjg.com/helm
helm repo update byjg
kubectl create namespace easyhaproxy
helm upgrade --install ingress byjg/easyhaproxy \
--namespace easyhaproxy \
--set resources.requests.cpu=100m \
--set resources.requests.memory=128Mi
```
Customizing Helm Values:
```yaml
easyhaproxy:
stats:
username: admin
password: password
refresh: "10"
customErrors: "true"
sslMode: loose
logLevel:
certbot: DEBUG
easyhaproxy: DEBUG
haproxy: DEBUG
letsencrypt:
email: ""
service:
create: false # If false, it will create a DaemonSet with hostPort. The easiest.
type: ClusterIP # or NodePort
annotations: {}
binding:
ports:
http: 80
https: 443
stats: 1936
additionalPorts: []
# Make sure to create this
masterNode:
label: easyhaproxy/node
values:
- master
```
For more parameters you can refer to the [Kubernetes](kubernetes.md) page.
----
[Open source ByJG](http://opensource.byjg.com)

View file

@ -12,7 +12,7 @@ There are three installation modes:
To install EasyHAProxy in your cluster, follow these steps:
### 1) Identify the node where your EasyHAProxy container will run.
### 1) Identify the node where your EasyHAProxy container will run
EasyHAProxy will be limited to a single node. To understand that see [limitations](limitations.md) page.
@ -30,11 +30,7 @@ Add the EasyHAProxy label to the node.
kubectl label nodes node-01 "easyhaproxy/node=master"
```
### 2) Install EasyHAProxy
You can install EasyHAProxy in a Kubernetes cluster using Kubernetes Manifest or Helm 3.
#### 2.1.) Using Kubernetes Manifest
### 2) Install EasyHAProxy with Kubernetes Manifest
```bash
kubectl create namespace easyhaproxy
@ -45,57 +41,6 @@ kubectl apply -f \
If necessary, you can configure environment variables. To get a list of the variables, please follow the [docker container environment](docker-environment.md)
#### 2.2) Using HELM 3
Minimal configuration
```bash
helm repo add byjg https://opensource.byjg.com/helm
helm repo update byjg
kubectl create namespace easyhaproxy
helm upgrade --install ingress byjg/easyhaproxy \
--namespace easyhaproxy \
--set resources.requests.cpu=100m \
--set resources.requests.memory=128Mi
```
Customizing Helm Values:
```yaml
easyhaproxy:
stats:
username: admin
password: password
refresh: "10"
customErrors: "true"
sslMode: loose
logLevel:
certbot: DEBUG
easyhaproxy: DEBUG
haproxy: DEBUG
letsencrypt:
email: ""
service:
create: false # If false, it will create a DaemonSet with hostPort. The easiest.
type: ClusterIP # or NodePort
annotations: {}
binding:
ports:
http: 80
https: 443
stats: 1936
additionalPorts: []
# Make sure to create this
masterNode:
label: easyhaproxy/node
values:
- master
```
## Running containers
Your container only requires creating an ingress with the annotation `kubernetes.io/ingress.class: easyhaproxy-ingress` pointing to your service.

52
docs/microk8s.md Normal file
View file

@ -0,0 +1,52 @@
# Microk8s Add-ons
Microk8s is a lightweight Kubernetes distribution that can run on a single machine. It is very easy to install and use.
You can add custom addons to your Microk8s installation.
Here are the steps to install EasyHAProxy on your Microk8s.
## Installing ByJG repository
Before install the addons, you need to add the ByJG repository to your Microk8s installation.
1. Access the microk8s host machine and run:
```shell
microk8s addons repo add byjg https://github.com/byjg/microk8s-addons.git
```
2. Check if it is installed:
```text
$ microk8s status
microk8s is running
...
addons:
...
disabled:
easyhaproxy # (byjg) EasyHAProxy can detect and configure HAProxy automatically based on ingress labels
....
```
## Installing EasyHAProxy addon
EasyHAProxy can detect and configure HAProxy automatically based on ingress labels.
Usage:
Install as a Daemonset
```shell
microk8s enable easyhaproxy
```
Install as a NodePort
```shell
microk8s enable easyhaproxy --nodeport
```
For more parameters you can refer to the [Kubernetes](kubernetes.md) page.
----
[Open source ByJG](http://opensource.byjg.com)