Skip to content
Snippets Groups Projects
README.md 3.31 KiB
Newer Older
Varac's avatar
Varac committed
## Introduction

Varac's avatar
Varac committed
This directory describes the applications that are deployed to a new OpenAppStack
instance. The `helmfile.d` subdirectory contains information about which helm
charts need to be deployed. The `values` subdirectory contains values.yml overrides
Varac's avatar
Varac committed
for these charts.

Use [helmfile](https://github.com/roboll/helmfile) to install these applications
to a cluster.

## Usage

Varac's avatar
Varac committed
The data in this directory is typically used by the Ansible playbooks located
in the `ansible/` top level directory. Check the tasks tagged `helmfile` to
get more information.
Varac's avatar
Varac committed

Varac's avatar
Varac committed
If you have a cluster already, and do not want to use our OpenAppStack
installation script to install these applications, follow these steps:
Varac's avatar
Varac committed

### Prerequisites

Make sure you follow the installation instructions of
[helmfile](https://github.com/roboll/helmfile) before you try this! Also note
that helmfile requires `helm diff` to be installed. Install it by running
`helm plugin install https://github.com/databus23/helm-diff`

### Preparation

Do these three steps to prepare the installation process:

Varac's avatar
Varac committed
1. Get the local-storage chart locally
Varac's avatar
Varac committed

   ```bash
Varac's avatar
Varac committed
   $ git clone https://open.greenhost.net/openappstack/local-storage ../local-storage
Varac's avatar
Varac committed
   ```

Varac's avatar
Varac committed
1. You need to have a configuration file called `local.yaml` in the
   following directory relative to this directory:
Varac's avatar
Varac committed
   `../../../config/values/local.yaml`. Use our template at
   https://open.greenhost.net/openappstack/openappstack/blob/master/ansible/roles/configure_helmfile/templates/local.yaml.j2
Varac's avatar
Varac committed
   and fill in the variables.

1. You need to set some environment variables:
   - `$NEXTCLOUD_PASSWORD` to set the Nextcloud administrator password
   - `$NEXTCLOUD_MARIADB_ROOT_PASSWORD` for the MariaDB that NextCloud uses
   - `$GRAFANA_ADMIN_PASSWORD` for the admin password of grafana

1. OAS allows you to override the nginx configuration by setting variables in
Varac's avatar
Varac committed
   a file at `/oas/config/values/apps/nginx.yaml` on the cluster. You can
   leave this file empty, but it *has* to exist.
Varac's avatar
Varac committed

Varac's avatar
Varac committed
1. Certmanager will get installed, which uses some custom resource definitions.
Varac's avatar
Varac committed
   You need to add these resource definitions like so:

   ```
   kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.7/deploy/manifests/00-crds.yaml
   ```

### Installation

Install all the applications by running:

```
$ helmfile -e oas -f helmfile.d/ apply
```

Where:

- `-e oas` means that you are running this for the `oas` environment defined in
  the files
- `-f helmfile.d` means you want to use the description in files in the local
  `helmfile.d` directory
- `apply` syncs your kubernetes cluster state to the one desired by the files.

Varac's avatar
Varac committed
**NOTE:** If you have applied these helmfiles before, check if you still have
old `pvc`'s for mariadb lying around. They can mess up the installation process,
Varac's avatar
Varac committed
especially if you use different passwords than before.

For example:

```
$ kubectl get pvc
NAME                                 STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
data-oas-test-files-mariadb-0        Bound    pvc-2a0dfd8f-7176-11e9-8ea4-00160a765c00   512Mi      RWO            local          9m
```

The mariadb pvc can collide with your installation. Remove it (note, this also
removes all the data that was in that database!) by running:

```
kubectl delete pvc data-oas-test-files-mariadb-0
```