Kubernetes Local Development ☸️
This guide explains how to set up and use the local Kubernetes development environment for the Activity Challenge Bot using Talos Linux in Docker and OpenTofu/Terraform.
Prerequisites
Ensure you have the following installed:
- Docker
- Bun
- talosctl
- OpenTofu (or Terraform)
- kubectl
Quick Start
1. Set Up the Cluster
This will create a single-node Talos cluster in Docker and set up a local registry.
bun run cluster:setup2. Deploy the Bot
Builds the image, pushes it to the local registry, and deploys using OpenTofu.
bun run cluster:deploy3. Monitor Logs
bun run cluster:logsTroubleshooting
br_netfilter Error
Note: When running Kubernetes with Flannel inside Docker, you may encounter this error:
Failed to check br_netfilter: stat /proc/sys/net/bridge/bridge-nf-call-iptables: no such file or directoryThis happens because the host Linux kernel does not have the
br_netfiltermodule enabled. To resolve this, load the module by running:bashsudo modprobe br_netfilter
Registry Connection Issues
If the registry cannot be connected to the cluster network, ensure Docker has permissions and the talos-registry container is not conflicting with an old instance. You can run bun run cluster:destroy to wipe the state.
Docker Permission Denied
If you encounter a permission denied error when connecting to the Docker API (e.g., when running bun run cluster:setup), ensure your user is in the docker group.
If you've recently added yourself to the group, you can apply the changes in your current shell without logging out by running:
newgrp dockerAvailable Commands
bun run cluster:setup: Create the cluster and local registry.bun run cluster:deploy: Build, push, and deploy/update the bot.bun run cluster:logs: Tail the bot logs.bun run cluster:shell: Open a shell inside the bot container.bun run cluster:destroy: Tear down the cluster and clean up all resources.