plausible-hosting/k8s-manifests/README.org

52 lines
1.8 KiB
Org Mode
Raw Normal View History

2020-10-08 04:07:58 -05:00
#+TITLE: Setup Plausible
* Setup
#+NAME: create namespace
#+begin_src shell :results silent
kubectl create ns plausible
#+end_src
#+NAME: create the database secrets
#+begin_src shell :results silent
kubectl -n plausible create secret generic postgres-configuration \
--from-literal=POSTGRES_DB=plausible \
--from-literal=POSTGRES_USER=plausible \
--from-literal=POSTGRES_PASSWORD=plausible \
--from-literal=PGUSER=plausible \
--from-literal=PGPASSWORD=plausible \
--from-literal=PGDATABASE=plausible
#+end_src
#+NAME: install Postgres
#+begin_src shell :pwd ./ :results silent
kubectl -n plausible apply -f postgresql.yaml
#+end_src
#+NAME: create secrets
#+begin_src shell :results silent
DATABASE_PWD="$(kubectl -n plausible get secret plausible.plausible-db.credentials.postgresql.acid.zalan.do -o=jsonpath='{.data.password}' | base64 --decode)"
kubectl -n plausible create secret generic plausible \
--from-literal=ADMIN_USER_EMAIL=myemail@example.com \
--from-literal=ADMIN_USER_NAME="Example User" \
--from-literal=ADMIN_USER_PWD="password" \
--from-literal=SECRET_KEY_BASE="$(openssl rand -base64 64)" \
--from-literal=DATABASE_URL="postgres://plausible:$DATABASE_PWD@plausible-db-pooler/plausible?ssl=true" \
--from-literal=CLICKHOUSE_DATABASE_URL=http://plausible-events-db:8123/plausible
#+end_src
#+NAME: create configuration
#+begin_src shell :results silent
kubectl -n plausible create configmap plausible \
--from-literal=BASE_URL=http://192.168.39.97:31943
#+end_src
#+NAME: install Plausible
#+begin_src shell :results silent
kubectl -n plausible apply -f .
#+end_src
* Notes and references
- https://docs.plausible.io/self-hosting-configuration/
- https://github.com/plausible/hosting/blob/c5146231aa0bf8d7a0da11370845e11a4973373e/docker-compose.yml