Course
ai-dev-tools-zoomcamp
Question
Why does my Kubernetes deployment work locally with act but fail on GitHub Actions with "could not locate any control plane nodes for cluster named 'agent-relay'"?
Answer
A GitHub-hosted runner starts with a fresh environment and does not contain the local kind cluster that may already exist on your development machine.
This can cause the workflow to fail with:
ERROR: could not locate any control plane nodes for cluster named 'agent-relay'.
Before loading the Docker image into kind or deploying the Kubernetes manifests, make sure the cluster exists.
For example:
if ! kind get clusters | grep -qx "agent-relay"; then
kind create cluster --name agent-relay
fi
After the cluster is created, the workflow can continue with:
- Loading the Docker image into kind.
- Applying the Kubernetes manifests.
- Waiting for the deployment rollout.
- Verifying the deployed API.
This issue may not appear when testing locally with act if a kind cluster named "agent-relay" already exists on the local machine.
Checklist
Course
ai-dev-tools-zoomcamp
Question
Why does my Kubernetes deployment work locally with act but fail on GitHub Actions with "could not locate any control plane nodes for cluster named 'agent-relay'"?
Answer
A GitHub-hosted runner starts with a fresh environment and does not contain the local kind cluster that may already exist on your development machine.
This can cause the workflow to fail with:
ERROR: could not locate any control plane nodes for cluster named 'agent-relay'.
Before loading the Docker image into kind or deploying the Kubernetes manifests, make sure the cluster exists.
For example:
if ! kind get clusters | grep -qx "agent-relay"; then
kind create cluster --name agent-relay
fi
After the cluster is created, the workflow can continue with:
This issue may not appear when testing locally with act if a kind cluster named "agent-relay" already exists on the local machine.
Checklist