diff --git a/README.md b/README.md index 92b158a..ac4d522 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/dokku.md b/docs/dokku.md new file mode 100644 index 0000000..a8c2e25 --- /dev/null +++ b/docs/dokku.md @@ -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). diff --git a/docs/easyhaproxy_dokku.png b/docs/easyhaproxy_dokku.png new file mode 100644 index 0000000..18ba6f3 Binary files /dev/null and b/docs/easyhaproxy_dokku.png differ diff --git a/docs/easyhaproxy_helm.png b/docs/easyhaproxy_helm.png new file mode 100644 index 0000000..d95b68b Binary files /dev/null and b/docs/easyhaproxy_helm.png differ diff --git a/docs/easyhaproxy_microk8s.png b/docs/easyhaproxy_microk8s.png new file mode 100644 index 0000000..ce9eb17 Binary files /dev/null and b/docs/easyhaproxy_microk8s.png differ diff --git a/docs/helm.md b/docs/helm.md new file mode 100644 index 0000000..376d5ff --- /dev/null +++ b/docs/helm.md @@ -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 561d v1.21.13-3 +node-02 Ready 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) diff --git a/docs/kubernetes.md b/docs/kubernetes.md index 337a459..24743f5 100644 --- a/docs/kubernetes.md +++ b/docs/kubernetes.md @@ -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. diff --git a/docs/microk8s.md b/docs/microk8s.md new file mode 100644 index 0000000..decbe36 --- /dev/null +++ b/docs/microk8s.md @@ -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)