Skip to content

Latest commit

 

History

History
86 lines (60 loc) · 2.46 KB

File metadata and controls

86 lines (60 loc) · 2.46 KB

Deploy to rbpi

k3s on rbpi (linux/arm64). make deploy-rbpi builds the image, imports it over SSH, and applies manifests with make deploy.

Prerequisites

  • kubectl and kubeconfig for the rbpi cluster
  • Docker
  • SSH Host rbpi (see below)
export KUBECONFIG=/path/to/alesrpi-lab-iac/kubeconfig.yaml
kubectl get nodes -o wide

~/.ssh/config:

Host rbpi
    HostName 192.168.1.67
    User alessandro
    IdentityFile /path/to/alesrpi-lab-iac/alesrpi

If the key is not in ssh config, pass it once:

make deploy-rbpi RBPI_SSH_KEY=$HOME/path/to/alesrpi-lab-iac/alesrpi

Deploy

export KUBECONFIG=/path/to/alesrpi-lab-iac/kubeconfig.yaml
make deploy-rbpi

This runs:

  1. docker build --platform linux/arm64 (tag defaults to k8s-redis-workload-scaler:manual-<timestamp>; override with RBPI_IMG=...)
  2. docker save | ssh rbpi sudo k3s ctr images import
  3. make deploy IMG=<that tag>
  4. kubectl get pods in k8s-redis-workload-scaler-system and the CRD

After deploy, revert the image pin if kustomization changed:

git checkout -- config/manager/kustomization.yaml

Undeploy

make undeploy

Scale test

Apply the sample CR and your worker Deployment (name must match scaleTargetRef in the CR, default worker-deployment):

kubectl apply -f config/samples/autoscaling_v1alpha1_redisstreamscaler.yaml

Redis must be reachable at the address in the CR (e.g. redis.default.svc.cluster.local:6379). Makefile targets exec into deploy/redis in default:

make scale-load          # XADD backlog on stream events / group workers
make scale-observe       # watch replicas + scaler status (Ctrl+C to stop)
make scale-load-clear    # XTRIM stream; scale-down waits for cooldownPeriod

Override defaults if needed: LOAD_NS, LOAD_REDIS_DEPLOY, LOAD_STREAM, LOAD_GROUP, LOAD_COUNT, LOAD_DEPLOY, LOAD_SCALER.

GitHub Actions

Push to main builds an arm64 image on GHCR and runs make deploy on rbpi via Tailscale. See .github/workflows/deploy.yaml.

Troubleshooting

Symptom Fix
Degraded / no such host for redis redis.<namespace>.svc.cluster.local:6379
Manager ImagePullBackOff Image must be arm64 and present on rbpi (local import or GHCR pull)
Worker ImagePullBackOff Fix your worker Deployment image
SSH import fails Check Host rbpi in ~/.ssh/config or set RBPI_SSH_KEY