This template creates a development environment for contributing to Kubernetes using Coder. It provides all the necessary tools and configurations to start developing Kubernetes core components.
- A Kubernetes cluster with Coder installed
kubectl
configured to access your cluster- Sufficient cluster resources (minimum recommended: 4 CPU cores, 8GB RAM, 50GB storage)
- Access to a Docker daemon (either local or remote)
- Go 1.21.0
- Git
- Docker CLI
- Build essentials (gcc, make, etc.)
- vim editor
- etcd v3.5.9
- Python 3 with PyYAML
- Network tools (ifconfig, netstat, etc.)
- rsync for file synchronization
- Timezone configuration with tzdata
- Proper user/group setup (UID 1000, root group access)
- Persistent workspace storage
- Configurable Docker daemon connection
- GOPATH configured at /home/coder
- Kubernetes repository cloned directly in home directory
cpu
: Number of CPU cores (default: 4)memory
: Memory in GB (default: 8)disk_size
: Disk size in GB (default: 50)namespace
: Kubernetes namespace for the workspace (default: coder-workspaces)docker_host
: Docker daemon address to connect to (default: "unix:///var/run/docker.sock")container_image
: Container image to use (default: "ghcr.io//kubernetes-coder-dev:latest")kubernetes_repo
: Git repository URL for Kubernetes (default: "https://github.com/kubernetes/kubernetes.git")kubernetes_branch
: Git branch to clone (default: "master")
- Create a new workspace using this template
- Configure the parameters as needed
- Wait for the initialization script to complete
- Connect to your workspace
- The Kubernetes source code will be available at
$HOME/kubernetes
- Make your changes in the Kubernetes repository
- Build Kubernetes using
make
- Run tests using
make test
- Submit your changes following the Kubernetes contribution guidelines
The template supports connecting to a Docker daemon in different ways:
- Local socket (default):
unix:///var/run/docker.sock
- TCP connection:
tcp://host:port
(e.g.,tcp://localhost:2375
) - Remote Docker host: Set the
docker_host
parameter to point to your Docker daemon
The development container includes:
- Ubuntu 22.04 base image
- All necessary development tools pre-installed
- Proper timezone configuration
- Network utilities
- Python with YAML support
- Development user setup with sudo access
The container image is automatically built and published to GitHub Container Registry with version tags.
You can customize this template by:
- Modifying the parameters when creating a workspace
- Using your own fork of Kubernetes
- Switching between different branches
- Using a different container image version
If you encounter any issues:
- Check the workspace logs for startup script output
- Ensure your cluster has sufficient resources
- Verify network connectivity to GitHub and other required services
- Check Docker daemon connectivity using
docker info
- Verify the container image is accessible
- Check that all required ports are accessible
- Ensure proper permissions for Docker socket if using local socket