Prerequisites
Before building custom TinySystems modules, ensure you have the following tools installed and configured.
Required Software
Go 1.21+
TinySystems modules are written in Go. Install the latest version:
bash
# macOS (Homebrew)
brew install go
# Linux (apt)
sudo apt update && sudo apt install golang-go
# Verify installation
go version
# go version go1.21.0 linux/amd64Kubernetes Cluster
You need a Kubernetes cluster for testing. Options:
Local Development (Recommended for getting started):
bash
# kind (Kubernetes in Docker)
brew install kind
kind create cluster --name tinysystems-dev
# or minikube
brew install minikube
minikube startCloud Providers:
- Google Kubernetes Engine (GKE)
- Amazon EKS
- Azure AKS
- DigitalOcean Kubernetes
kubectl
The Kubernetes command-line tool:
bash
# macOS
brew install kubectl
# Linux
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
# Verify
kubectl version --clientDocker
Required for building and pushing module images:
bash
# macOS
brew install --cask docker
# Linux
curl -fsSL https://get.docker.com | sh
# Verify
docker --versionOptional Tools
Helm
For deploying modules to Kubernetes:
bash
brew install helm
# or
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bashIDE
Recommended editors with Go support:
- VS Code with Go extension
- GoLand (JetBrains)
- Neovim with gopls
Verify Your Setup
Run this script to verify all prerequisites:
bash
#!/bin/bash
echo "Checking prerequisites..."
# Go
if command -v go &> /dev/null; then
echo "✓ Go: $(go version)"
else
echo "✗ Go not installed"
fi
# kubectl
if command -v kubectl &> /dev/null; then
echo "✓ kubectl: $(kubectl version --client --short 2>/dev/null)"
else
echo "✗ kubectl not installed"
fi
# Docker
if command -v docker &> /dev/null; then
echo "✓ Docker: $(docker --version)"
else
echo "✗ Docker not installed"
fi
# Kubernetes cluster
if kubectl cluster-info &> /dev/null; then
echo "✓ Kubernetes cluster accessible"
else
echo "✗ No Kubernetes cluster accessible"
fi
# Helm (optional)
if command -v helm &> /dev/null; then
echo "✓ Helm: $(helm version --short)"
else
echo "○ Helm not installed (optional)"
fiCluster Setup for Development
If using a local cluster, install the TinySystems CRDs:
bash
# Add the Helm repository
helm repo add tinysystems https://tiny-systems.github.io/module/
helm repo update
# Install CRDs only (for development)
kubectl apply -f https://raw.githubusercontent.com/tiny-systems/module/main/config/crd/bases/operator.tinysystems.io_tinynodes.yaml
kubectl apply -f https://raw.githubusercontent.com/tiny-systems/module/main/config/crd/bases/operator.tinysystems.io_tinymodules.yaml
kubectl apply -f https://raw.githubusercontent.com/tiny-systems/module/main/config/crd/bases/operator.tinysystems.io_tinysignals.yamlProject Structure Overview
A typical module project looks like:
my-module/
├── cmd/
│ └── main.go # Entry point
├── components/
│ └── mycomponent/
│ └── component.go # Component implementation
├── go.mod
├── go.sum
├── Dockerfile
└── README.mdNext Steps
- SDK Installation - Install the TinySystems SDK
- Hello World Component - Build your first component