kube-ecp-stack
by EMQX
A Helm chart stack for EMQX ECP
About this chart
kube-ecp-stack
This repository contains the Helm chart for deploying EMQX ECP on Kubernetes.
Prerequisites
Before you begin, ensure you have the following installed and set up:
- Kubernetes cluster
- Helm (v3.0+)
- kubectl CLI
- yq
Deployment
Here are the steps to deploy EMQX ECP using the Helm chart:
- Get the Helm chart:
$ helm repo add emqx https://repos.emqx.io/charts
$ helm repo update
$ helm pull emqx/kube-ecp-stack --untar
- Install / Upgrade the Helm chart:
-
If you can access the Internet, run the following command:
$ cd kube-ecp-stack $ helm upgrade --install ecp . --namespace emqx-ecp --create-namespace -
If you cannot access the Internet, and you already pushed all of the images to your owner registry, run the following command:
- Create a secret for pulling images from your registry:
$ kubectl create ns emqx-ecp $ kubectl create -n emqx-ecp secret docker-registry ${YOUR_SECRET_NAME} --docker-username=${YOUR_USERNAME} --docker-password=${YOUR_PASSWORD} --docker-server=${$YOUR_REGISTRY}- Modify the
values.yamlfile:
$ vim values.yaml ... global: image: registry: "${YOUR_REGISTRY}" repository: "${YOUR_REPOSITORY}" pullSecrets: &global-image-pullSecrets - name: "${YOUR_SECRET_NAME} ...- Install the Helm chart by private deploy script:
$ cd kube-ecp-stack $ chmod +x priv_deploy.sh $ kubectl apply -f crds $ helm template ecp . --namespace emqx-ecp | ./priv_deploy.sh
- Delete the Helm chart:
-
If you using the
helm upgrade --installcommand, run the following command:$ helm delete ecp --namespace emqx-ecp -
If you using the private deploy script, run the following command:
$ cd kube-ecp-stack $ helm template ecp . --namespace emqx-ecp | kubectl delete -f -
- Clean up
This will delete storage volumes, please be careful.
$ kubectl delete pvc -l "app.kubernetes.io/instance=ecp" -n emqx-ecp
How to quickly rePush images to your owner registry
-
Get the Helm chart:
$ helm repo add emqx https://repos.emqx.io/charts $ helm repo update $ helm pull emqx/kube-ecp-stack --untar
2. Modify the `values.yaml` file:
```
$ vim values.yaml
...
global:
image:
registry: "${YOUR_REGISTRY}"
repository: "${YOUR_REPOSITORY}"
...
```
3. Using `retag.sh`
```bash
$ cd kube-ecp-stack
$ chmod +x retag.sh
$ echo "${YOUR_PASSWORD}" | docker login ${YOUR_REGISTRY} -u ${YOUR_USERNAME} --password-stdin
$ ./retag.sh
```
If you need to install ElasticSearch service, please refer to: https://artifacthub.io/packages/helm/elastic/elasticsearch https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
or use OpenSearch Instead (telegraf ouputs.OpenSearch refer: https://github.com/influxdata/telegraf/tree/release-1.29/plugins/outputs/opensearch) https://opensearch.org/docs/latest/install-and-configure/install-opensearch/helm/
Deploy kube-ecp-stack with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kube-ecp-stack on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkube-ecp-stack is pinned at v2.5.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply