# Getting Started

Note: EMQX Operator Controller requires Kubernetes v1.20.0 and up.

# Background

This article was deployed using minikube v1.20.0

# Deployment Operator Controller

This project can be run inside a kubernetes cluster

# Prepare

We using cert manager (opens new window) for provisioning the certificates for the webhook server. You can follow the cert manager documentation (opens new window) to install it.

# Default static install

You don’t require any tweaking of the EMQX Operator Controller install parameters.

The default static configuration can be installed as follows:

$ curl -f -L "https://github.com/emqx/emqx-operator/releases/download/1.1.6/emqx-operator-controller.yaml" | kubectl apply -f -
1

# Installing with Helm

  1. Add the EMQX Helm repository:
$ helm repo add emqx https://repos.emqx.io/charts
$ helm repo update
1
2
  1. Install EMQX Operator Controller by helm
    $ helm install emqx-operator emqx/emqx-operator \
       --set installCRDs=true \
       --namespace emqx-operator-system \
       --create-namespace
    
    1
    2
    3
    4

# Check EMQX Operator Controller status

$ kubectl get pods -l "control-plane=controller-manager" -n emqx-operator-system
NAME                                                READY   STATUS    RESTARTS   AGE
emqx-operator-controller-manager-68b866c8bf-kd4g6   1/1     Running   0          15s
1
2
3

# Deploy the EMQX Broker

  1. Deploy EMQX Custom Resource

    cat << "EOF" | kubectl apply -f -
    apiVersion: apps.emqx.io/v1beta2
    kind: EmqxBroker
    metadata:
      name: emqx
    spec:
      image: emqx/emqx:4.4.0
    EOF
    
    1
    2
    3
    4
    5
    6
    7
    8
  2. Check EMQX status

    $ kubectl get pods
    NAME              READY   STATUS    RESTARTS   AGE
    emqx-0   1/1     Running   0          22m
    emqx-1   1/1     Running   0          22m
    emqx-2   1/1     Running   0          22m
    
    $ kubectl exec -it emqx-0 -- emqx_ctl status
    Node 'emqx@emqx-0.emqx.default.svc.cluster.local' 4.3.11 is started
    
    $ kubectl exec -it emqx-0 -- emqx_ctl cluster status
    Cluster status: #{running_nodes =>
                          ['emqx@emqx-0.emqx.default.svc.cluster.local',
                           'emqx@emqx-1.emqx.default.svc.cluster.local',
                           'emqx@emqx-2.emqx.default.svc.cluster.local'],
                      stopped_nodes => []}
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15