summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorzacanger <zac@zacanger.com>2019-10-07 12:20:03 -0600
committerzacanger <zac@zacanger.com>2019-10-07 19:00:38 -0600
commitab139995bd77effaa50289a68b0222cbf0c2c988 (patch)
treec1e1d55ed38bf565afc70eb9be53a518528c7a88 /README.md
parent753fa8829ebdb7807766ab97281dad7ffc22cdb2 (diff)
feat(ops): k8s
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 26 insertions, 1 deletions
diff --git a/README.md b/README.md
index 5e7d879c..afa345c1 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ Front Page|Post
- Open source, [AGPL License](/LICENSE).
- Self hostable, easy to deploy.
- - Comes with [Docker](#docker), [Ansible](#ansible).
+ - Comes with [Docker](#docker), [Ansible](#ansible), [Kubernetes](#kubernetes).
- Live-updating Comment threads.
- Full vote scores `(+/-)` like old reddit.
- Moderation abilities.
@@ -112,6 +112,31 @@ nano inventory # enter your server, domain, contact email
ansible-playbook lemmy.yml --become
```
+### Kubernetes
+
+You'll need to have an existing Kubernetes cluster and [storage class](https://kubernetes.io/docs/concepts/storage/storage-classes/).
+Setting this up will vary depending on your provider.
+To try it locally, you can use [MicroK8s](https://microk8s.io/) or [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/).
+
+Once you have a working cluster, edit the environment variables and volume sizes in `docker/k8s/*.yml`.
+You may also want to change the service types to use `LoadBalancer`s depending on where you're running your cluster (add `type: LoadBalancer` to `ports)`, or `NodePort`s.
+By default they will use `ClusterIP`s, which will allow access only within the cluster. See the [docs](https://kubernetes.io/docs/concepts/services-networking/service/) for more on networking in Kubernetes.
+
+**Important** Running a database in Kubernetes will work, but is generally not recommended.
+If you're deploying on any of the common cloud providers, you should consider using their managed database service instead (RDS, Cloud SQL, Azure Databse, etc.).
+
+Now you can deploy:
+
+```bash
+# Add `-n foo` if you want to deploy into a specific namespace `foo`;
+# otherwise your resources will be created in the `default` namespace.
+kubectl apply -f docker/k8s/db.yml
+kubectl apply -f docker/k8s/pictshare.yml
+kubectl apply -f docker/k8s/lemmy.yml
+```
+
+If you used a `LoadBalancer`, you should see it in your cloud provider's console.
+
## Develop
### Docker Development