Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document config #74

Merged
merged 3 commits into from
Jul 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 77 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,80 @@

# Installation Guide

## Create Cluster Config
Before you can install Kubed, you need a cluster config for Kubed. Cluster config is defined in YAML format. You find an example config in [./hack/deploy/config.yaml](./hack/deploy/config.yaml).

```yaml
$ cat ./hack/deploy/config.yaml

apiServer:
address: :8080
enableReverseIndex: true
enableSearchIndex: true
enableConfigSyncer: true
eventForwarder:
ingressAdded:
handle: true
nodeAdded:
handle: true
receiver:
notifier: mailgun
to:
- ops@example.com
storageAdded:
handle: true
warningEvents:
handle: true
namespaces:
- kube-system
janitors:
- elasticsearch:
endpoint: http://elasticsearch-logging.kube-system:9200
logIndexPrefix: logstash-
kind: Elasticsearch
ttl: 2160h0m0s
- influxdb:
endpoint: https://monitoring-influxdb.kube-system:8086
kind: InfluxDB
ttl: 2160h0m0s
notifierSecretName: kubed-notifier
recycleBin:
handleUpdates: false
path: /tmp/kubed/trash
receiver:
notifier: mailgun
to:
- ops@example.com
ttl: 168h0m0s
snapshotter:
Storage:
gcs:
bucket: restic
prefix: minikube
storageSecretName: snap-secret
sanitize: true
schedule: '@every 6h'
```

To understand the various configuration options, check Kubed [tutorials](/docs/tutorials/README.md). Once you are satisfied with the configuration, create a Secret with the Kubed cluster config under `config.yaml` key.

You may have to create another [Secret for notifiers](/docs/tutorials/notifiers.md). If you are [storing cluster snapshots](/docs/tutorials/cluster-snapshot.md) in cloud storage, you have to create a Secret appropriately.

### Generate Config using script
If you are familiar with GO, you can use the [./hack/config/main.go](./hack/config/main.go) script to generate a cluster config. Open this file in your favorite editor, update the config returned from `#CreateClusterConfig()` method. Then run the script to generate updated config [./hack/deploy/config.yaml](./hack/deploy/config.yaml).

```console
go run ./hack/config/main.go
```

### Verifying Cluster Config
Kubed includes a check command to verify a cluster config. Download the pre-built binary from [appscode/kubed Github releases](https://github.com/appscode/kubed/releases) and put the binary to some directory in your `PATH`.

```console
$ kubed check --clusterconfig=./hack/deploy/config.yaml
Cluster config was parsed successfully.
```

## Using YAML
Kubed can be installed using YAML files includes in the [/hack/deploy](/hack/deploy) folder.

Expand Down Expand Up @@ -32,4 +106,6 @@ $ kubectl get pods --all-namespaces -l app=kubed --watch

Once the operator pods are running, you can cancel the above command by typing `Ctrl+C`.

Now, you are ready to [start managing your cluster](/docs/tutorials/README.md) using Kubed.

## Update Cluster Config
If you would like to update cluster config, update the `kubed-config` Secret and restart Kubed operator pod(s).