# Initial configuration

This example demonstrates how initial configuration works with the Habitat operator. With the manifest file we deploy a Redis Habitat service.
NOTE: Adding secret configuration to the `default.toml` is discouraged, as it will be uploaded as a docker image. Instead use the initial configuration `user.toml` file.

## Workflow

After the Habitat operator is up and running, execute the following command from the root of this repository:

`kubectl create -f examples/config/habitat.yml`

This will create a [Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret/) with the configurations and a Redis database.

By default, Redis listens on port 6379, but we change this to 6999 by mounting a
Secret as a file under `/hab/user/redis/config/user.toml` inside the Pod.

The web app is listening on port `30001`. When running on minikube, its IP can
be retrieved with `minikube ip`.

## Deletion

The Habitat operator does not delete the Secret on Habitat deletion, as it is not managed by the Habitat operator.
To manually delete the Secret simply run:

```
kubectl delete service user-toml-secret
```

# Initial configuration

This example demonstrates how initial configuration works with the Habitat operator. With the manifest file we deploy a Redis Habitat service.
NOTE: Adding secret configuration to the `default.toml` is discouraged, as it will be uploaded as a docker image. Instead use the initial configuration `user.toml` file.

## Workflow

After the Habitat operator is up and running, execute the following command from the root of this repository:

`kubectl create -f examples/config/habitat.yml`

This will create a [Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret/) with the configurations and a Redis database.

By default, Redis listens on port 6379, but we change this to 6999 by mounting a
Secret as a file under `/hab/user/redis/config/user.toml` inside the Pod.

You can see this is the case by accessing the web app on port `30001`. When
running on minikube, its IP can be retrieved with `minikube ip`.

## Deletion

The Habitat operator does not delete the Secret on Habitat deletion, as it is not managed by the Habitat operator.
To manually delete the Secret simply run:

```
kubectl delete service user-toml-secret
```

Change section in `config` example READMe
Change section in `config` example READMe

It wasn't clear how the user could see that redis is running on the
custom port.

Signed-off-by: Lorenzo Manacorda <86995a091f8a1385082bd10715048b52ee386a6a@kinvolk.io>
