plausible-hosting/k8s-manifests/README.org
2021-05-15 09:31:31 +12:00

2.3 KiB

Setup Plausible

Prelimiary requirements

  • Minikube
  • Postgres-Operator

Notes

  • Minikube can be switched out for Kind
  • Postgres manifests are also included, in case you don't want to deploy a highly available Postgres database locally (DATABASE_URL will need to be updated also)

Setup

  kubectl create ns plausible
  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
  kubectl -n plausible apply -f postgres.yaml
  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:plausible@postgres/plausible?ssl=false" \
    --from-literal=CLICKHOUSE_DATABASE_URL=http://plausible-events-db:8123/plausible
  kubectl -n plausible apply -f plausible-service.yaml
  kubectl -n plausible create configmap plausible \
    --from-literal=BASE_URL=http://$(minikube ip):$(kubectl -n plausible get svc plausible -o=jsonpath='{.spec.ports[0].nodePort}')
  kubectl -n plausible apply \
    -f event-data-persistentvolumeclaim.yaml \
    -f mail-deployment.yaml \
    -f plausible-deployment.yaml \
    -f plausible-events-db-deployment.yaml \
    -f plausible-events-db-service.yaml