<commit_before># EnMasse on Kubernetes

This guide will walk through the process of setting up EnMasse on a Kubernetes
cluster together with clients for sending and receiving messages. Some of the concepts like
addresses and flavors are described in more detail [here](openshift.md). Currently, TLS is not
supported on Kubernetes.

## Preqrequisites

This guide assumes that you already have a Kubernetes cluster installed. If not, have a look at
[minikube](https://github.com/kubernetes/minikube), which is kind of kubernetes-in-a-box.

## Setting up EnMasse

### Creating project and importing template

Download one of the releases from https://github.com/EnMasseProject/enmasse/releases and unpack it.
Once unpacked, you can either deploy EnMasse using an automated script or follow the below steps.

#### Deploying EnMasse automatically

The deployment script simplifies the process of deploying the enmasse cluster. You
can invoke it with `-h` to get a list of options. To deploy:

    ./deploy-kubernetes.sh -m "https://localhost:8443" -n enmasse

This will create the deployments required for running EnMasse. Starting up EnMasse will take a while,
usually depending on how fast it is able to download the docker images for the various components.
In the meantime, you can start to create your address configuration.

#### Deploying EnMasse manually

Create service account for address controller:

    kubectl create sa enmasse-service-account -n enmasse

Deploy EnMasse to enmasse:

    kubectl apply -f kubernetes/enmasse.yaml -n enmasse

### Deploying external load balancers

If you're running EnMasse in your own Kubernetes instance on any of the cloud providers, and if you don't have or don't want to deploy an ingress controller, you can deploy the external load balancer services to expose EnMasse ports:

	kubectl apply -f kubernetes/addons/external-lb.yaml -n enmasse

### Configuring addresses using the console

The EnMasse console should be available at `http://$(minikube ip)/console`. You can create and
monitor queues and topics using the UI.

### Exposing messaging through Ingress resource

If you are using minikube, the IP addresses of the internal services will not be accessible from outside of the minikube VM. To open up for AMQP using minikube and the nginx ingress controller, follow [this](https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tcp) and [this](https://github.com/kubernetes/ingress/tree/master/controllers/nginx#exposing-tcp-services) guides, using the port `5672` and the service `default/messaging`.

### Sending and receiving messages

For sending and receiving messages, have a look at an example python [sender](http://qpid.apache.org/releases/qpid-proton-0.15.0/proton/python/examples/simple_send.py.html) and [receiver](http://qpid.apache.org/releases/qpid-proton-0.15.0/proton/python/examples/simple_recv.py.html).
<commit_msg>Add note on enabling ingress controller and fix console URL<commit_after># EnMasse on Kubernetes

This guide will walk through the process of setting up EnMasse on a Kubernetes
cluster together with clients for sending and receiving messages. Some of the concepts like
addresses and flavors are described in more detail [here](openshift.md). Currently, TLS is not
supported on Kubernetes.

## Preqrequisites

This guide assumes that you already have a Kubernetes cluster installed. If not, have a look at
[minikube](https://github.com/kubernetes/minikube), which is kind of kubernetes-in-a-box.

The address-controller and console is configured using ingress, so enable the ingress controller in
your minikube setup:

    minikube addons enable ingress

This will cause an nginx ingress controller to get launched.

## Setting up EnMasse

### Creating project and importing template

Download one of the releases from https://github.com/EnMasseProject/enmasse/releases and unpack it.
Once unpacked, you can either deploy EnMasse using an automated script or follow the below steps.

#### Deploying EnMasse automatically

The deployment script simplifies the process of deploying the enmasse cluster. You
can invoke it with `-h` to get a list of options. To deploy:

    ./deploy-kubernetes.sh -m "https://localhost:8443" -n enmasse

This will create the deployments required for running EnMasse. Starting up EnMasse will take a while,
usually depending on how fast it is able to download the docker images for the various components.
In the meantime, you can start to create your address configuration.

#### Deploying EnMasse manually

Create service account for address controller:

    kubectl create sa enmasse-service-account -n enmasse

Deploy EnMasse to enmasse:

    kubectl apply -f kubernetes/enmasse.yaml -n enmasse

### Deploying external load balancers

If you're running EnMasse in your own Kubernetes instance on any of the cloud providers, and if you don't have or don't want to deploy an ingress controller, you can deploy the external load balancer services to expose EnMasse ports:

	kubectl apply -f kubernetes/addons/external-lb.yaml -n enmasse

### Configuring addresses using the console

The EnMasse console should be available at `http://$(minikube ip)/`. You can create and
monitor queues and topics using the UI.

### Exposing messaging through Ingress resource

To open up for AMQP using minikube and the nginx ingress controller, follow [this](https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/tcp) and [this](https://github.com/kubernetes/ingress/tree/master/controllers/nginx#exposing-tcp-services) guides, using the port `5672` and the service `default/messaging`.

### Sending and receiving messages

For sending and receiving messages, have a look at an example python [sender](http://qpid.apache.org/releases/qpid-proton-0.15.0/proton/python/examples/simple_send.py.html) and [receiver](http://qpid.apache.org/releases/qpid-proton-0.15.0/proton/python/examples/simple_recv.py.html).

{'fraction_non_alphanumeric': 0.07066309444072337, 'fraction_numerical': 0.0053583389149363695, 'mean_word_length': 4.672364672364672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4615938', 'n_tokens_mistral': 1695, 'n_tokens_neox': 1600, 'n_words': 726}