feat(bot): ✨ Finish migrating to k8s.
This commit is contained in:
@@ -8,12 +8,9 @@ Payphone is deployed using Kubernetes + Docker. To set up a local kubernetes clu
|
||||
This section will guide you step by step to create a multi-node cluster or a local development
|
||||
cluster and start up Payphone. Make sure to have:
|
||||
|
||||
1. A Docker Hub account with a slot for a private image. By default all free accounts allow 1
|
||||
private image, so if you haven't uploaded any private images to your account, you do have an
|
||||
available slot.
|
||||
2. The Discord bot's token, either for development or production depending on what you're setting
|
||||
1. The Discord bot's token, either for development or production depending on what you're setting
|
||||
up the cluster for.
|
||||
3. You'll probably need at least 5 CPU cores (6 recommended) across all of your machines + 1 core
|
||||
2. You'll probably need at least 5 CPU cores (6 recommended) across all of your machines + 1 core
|
||||
per shard, 8 GB of ram + 512Mb of RAM per shard, and 30Gb of disk space available. It'll still
|
||||
run with less, but it'll be way slower. In multi-node environment, these specifications are
|
||||
cluster-wide, meaning that if you have 3 nodes with 3 cores, that makes it 9 cores in total and
|
||||
@@ -192,13 +189,19 @@ kubectl exec citus-0 -- psql -U payphone payphone -c "SELECT * FROM citus_get_ac
|
||||
|
||||
#### Setting Up Payphone
|
||||
|
||||
Finally, you need to start the bot's instance.
|
||||
Finally, you need to start the bot's instance. First, log into your `git.nyeki.dev` account from
|
||||
`kubectl` with the following command:
|
||||
|
||||
```sh
|
||||
kubectl create secret docker-registry regcred --docker-server=https://git.nyeki.dev/v1/ --docker-username=<your-username> --docker-password=<your-password>
|
||||
```
|
||||
|
||||
After that command is ran, the next step is to update the amount of shards. To set the amount,
|
||||
open `k8s/bot.yml` and set the total number of shards in both `spec.replicas` and
|
||||
`spec.template.spec.containers.bot.env.TOTAL_SHARDS.value`.
|
||||
|
||||
Once it's done, you can save and close the file and run the final command.
|
||||
|
||||
```sh
|
||||
# Steps before running this command:
|
||||
# 1. Update the image name in `bot.yml` to your own image name (the one that you have in your
|
||||
# private docker hub registry)
|
||||
# 2. Set the total number of shards in both `spec.replicas` and
|
||||
# `spec.template.spec.containers.bot.env.TOTAL_SHARDS.value`.
|
||||
kubectl apply -f k8s/bot.yml
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user