This document assumes that you already have a running kubernetes cluster. If you don't please refer to the kubernetes documentation. If you would like to test AuthMachine on kubernetes locally the recommended way is to get minikube running.
Overview of components
The minimal AuthMachine cluster consists of:
- AuthMachine app server
- PostgreSQL database
- Redis server
Note, that the latter two components require persistent storage volume.
Running PostgreSQL and Redis
Download the following example configuration files:
You might want to adjust amount of storage for persistent volumes in postgresql-pv.yaml and redis-pv.yaml files.
NB: For the sake of simplicity, we specified PostgreSQL password in plain text form in the postgresql.yaml file. Consider using Kubernetes Secret instead for greater security.
After you finished editing configuration files, run the following commands to create deployments and services:
$ kubectl create -f postgresql-pv.yaml $ kubectl create -f postgresql.yaml $ kubectl create -f redis-pv.yaml $ kubectl create -f redis.yaml
Then verify that everything has been created successfully by running
$ kubectl get pods,svc,deployment --all
This should list newly created deployments and services.
Running AuthMachine app server
Download authmachine.yaml file. Edit it and change the following variables as per need:
- AUTHMACHINE_SECRET_KEY (should be a unique per installation random string)
- AUTHMACHINE_SECRET_TOKEN (should be a unique per installation random string)
Then create a deployment by running the following command:
$ kubectl create -f authmachine.yaml
Adding Nginx frontend web server