<commit_before># Consul Helm Chart

## Prerequisites Details
* Kubernetes 1.3 with alpha APIs enabled
* PV support on the underlying infrastructure

## PetSet Details
* http://kubernetes.io/docs/user-guide/petset/

## PetSet Caveats
* http://kubernetes.io/docs/user-guide/petset/#alpha-limitations


## Chart Details
This chart will do the following:

* Implemented a dynamically scalable consul cluster using Kubernetes PetSets

## Installing the Chart

To install the chart with the release name `my-release`:

```bash
$ helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
$ helm install --name my-release incubator/consul
```

## Configuration

The following tables lists the configurable parameters of the consul chart and their default values.

| Parameter               | Description                           | Default                                                    |
| ----------------------- | ----------------------------------    | ---------------------------------------------------------- |
| `Name`                  | Consul petset name                    | `consul`                                                   |
| `Image`                 | Container image name                  | `consul`                                                   |
| `ImageTag`              | Container image tag                   | `v0.6.4`                                                   |
| `ImagePullPolicy`       | Container pull policy                 | `Always`                                                   |
| `Replicas`              | k8s petset replicas                   | `3`                                                        |
| `Component`             | k8s selector key                      | `consul`                                                   |
| `Cpu`                   | container requested cpu               | `100m`                                                     |
| `Memory`                | container requested memory            | `512Mi`                                                    |
| `Storage`               | Persistent volume size                | `1Gi`                                                      |
| `HttpPort`              | Consul http listening port            | `8500`                                                     |
| `RpcPort`               | Consul rpc listening port             | `8400`                                                     |
| `SerflanPort`           | Container serf lan listening port     | `8301`                                                     |
| `SerflanUdpPort`        | Container serf lan UDP listening port | `8301`                                                     |
| `SerfwanPort`           | Container serf wan listening port     | `8302`                                                     |
| `SerfwanUdpPort`        | Container serf wan UDP listening port | `8302`                                                     |
| `ServerPort`            | Container server listening port       | `8300`                                                     |
| `ConsulDnsPort`         | Container dns listening port          | `8600`                                                     |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```bash
$ helm install --name my-release -f values.yaml incubator/consul
```

> **Tip**: You can use the default [values.yaml](values.yaml)

## Testing

Execute test.sh. It will confirm that there are at least 3 consul servers present.

## Cluster Health<commit_msg>add cleanup step for PVs (#172)<commit_after># Consul Helm Chart

## Prerequisites Details
* Kubernetes 1.3 with alpha APIs enabled
* PV support on the underlying infrastructure

## PetSet Details
* http://kubernetes.io/docs/user-guide/petset/

## PetSet Caveats
* http://kubernetes.io/docs/user-guide/petset/#alpha-limitations


## Chart Details
This chart will do the following:

* Implemented a dynamically scalable consul cluster using Kubernetes PetSets

## Installing the Chart

To install the chart with the release name `my-release`:

```bash
$ helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
$ helm install --name my-release incubator/consul
```

## Configuration

The following tables lists the configurable parameters of the consul chart and their default values.

| Parameter               | Description                           | Default                                                    |
| ----------------------- | ----------------------------------    | ---------------------------------------------------------- |
| `Name`                  | Consul petset name                    | `consul`                                                   |
| `Image`                 | Container image name                  | `consul`                                                   |
| `ImageTag`              | Container image tag                   | `v0.6.4`                                                   |
| `ImagePullPolicy`       | Container pull policy                 | `Always`                                                   |
| `Replicas`              | k8s petset replicas                   | `3`                                                        |
| `Component`             | k8s selector key                      | `consul`                                                   |
| `Cpu`                   | container requested cpu               | `100m`                                                     |
| `Memory`                | container requested memory            | `512Mi`                                                    |
| `Storage`               | Persistent volume size                | `1Gi`                                                      |
| `HttpPort`              | Consul http listening port            | `8500`                                                     |
| `RpcPort`               | Consul rpc listening port             | `8400`                                                     |
| `SerflanPort`           | Container serf lan listening port     | `8301`                                                     |
| `SerflanUdpPort`        | Container serf lan UDP listening port | `8301`                                                     |
| `SerfwanPort`           | Container serf wan listening port     | `8302`                                                     |
| `SerfwanUdpPort`        | Container serf wan UDP listening port | `8302`                                                     |
| `ServerPort`            | Container server listening port       | `8300`                                                     |
| `ConsulDnsPort`         | Container dns listening port          | `8600`                                                     |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```bash
$ helm install --name my-release -f values.yaml incubator/consul
```

> **Tip**: You can use the default [values.yaml](values.yaml)

## Cleanup orphaned Persistent Volumes

Deleting a PetSet will not delete associated Persistent Volumes (Alpha limitation).

Do the following after deleting the chart release to clean up orphaned Persistent Volumes.

```bash
$ kubectl delete pvc -l component=${RELEASE-NAME}-consul
```

## Testing

Execute test.sh. It will confirm that there are at least 3 consul servers present.

## Cluster Health
{'fraction_non_alphanumeric': 0.10003872466761327, 'fraction_numerical': 0.012779140312378985, 'mean_word_length': 1.0161332292479834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 74, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5255658', 'n_tokens_mistral': 1660, 'n_tokens_neox': 1495, 'n_words': 529}