$ cd ..

The 2024 edition of How I deploy my Telegram bot

📅 2024-05-23

⌛ 62 days ago

🕑


It has been a good 600 days since I last wrote about deploying @SuperSeriousBot. There are now about 8,000 users.

Not a lot has changed since the last update regarding comittting the code and building it. I still use semantic-release to manage releases and Docker to build the project. However, I have migrated away from Nomad to k3s for deployment.

Building

Deploying

I now use k3s to deploy @SuperSeriousBot. It’s a stripped downn Kubernetes distribution that runs off of a single binary. I liked it enough to migrate most of my projects off of systemd and Nomad to k3s (I blame Katia). If you’re curious you can check out my k3s setup.

The manifest for @SuperSeriousBot can be found here.

What I like about k3s:

$ kubeseal --format=yaml < unsealed-secrets/superseriousbot.yaml > superseriousbot/base/secrets.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: superseriousbot
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  rules:
  - host: superseriousbot.superserio.us
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: superseriousbot
            port:
              number: 4242
  tls:
  - hosts:
    - superseriousbot.superserio.us
    secretName: superseriousbot-tls

…plus a few more goodies that I might put in a separate post.

What I miss from Nomad:

But all in all, I think I’m leaning a bit more towards k3s for now. Not enough to start a migration at work though ;)

Conclusion

Lately I’ve been tinkering more with deploying the bot rather than the bot itself. I need to trim the fat, remove unused commands, rip out some dependencies and profile the random delays that have been creeping in. But that’s a story for another day.

Wishlist