Plural Agent for Kubernetes is an active in-cluster component for solving any Plural<->Kubernetes integration tasks.
It's implemented as two communicating pieces - Plural Agent (agentk) that is running in the cluster and Plural Agent Server (gitlab-kas) that is running on the Plural side. Please see the architecture document and other documents in the doc directory for more information. User-facing documentation is also available.
This section focuses on running and testing:
kas(server) and its HTTP/WS proxyagentk(in-cluster and out-of-cluster)api(backend-for-frontend API service)
using the provided Makefile, local kind cluster, and the dev Helm chart in hack/chart/kas.
For a deeper architecture and development guide, see:
- Linux or macOS
- Docker (or compatible container runtime) installed and running
kind,kubectl, andhelmon yourPATH- Go toolchain installed (for building binaries or running module-level
maketargets) - Port
443free on your host (used by ingress in the dev kind cluster)
Note: Root
Makefileuses its own kind kubeconfig (seehack/include/kind.mk). You do not need to point your globalKUBECONFIGat the dev cluster.
- Root
Makefile– orchestration entry point (build, test, kind + Helm, local compose)doc/– architecture and deeper development docshack/chart/kas– dev Helm chart used for local testing
modules/kas/– kas & agentk source, Dockerfiles, tests and toolingapi/– backend-for-frontend API servicecommon/,tools/– shared libraries and tooling
See doc/modules.md for a more detailed module overview.
The easiest way to get kas and the new proxy running is to use the root Makefile with kind and the Helm chart.
From the repo root:
make helmThis will:
- Ensure a local kind cluster exists (see
--ensure-kind-clusterinhack/include/kind.mk). - Ensure ingress-nginx is installed in the cluster.
- Build required Docker images via
docker compose(unlessNO_BUILD=true). - Load the built images into the kind cluster.
- Install/upgrade the dev
kasHelm chart fromhack/chart/kasinto thekasnamespace.
After this completes, ingress exposes the following endpoints on your host:
https://localhost/ext/kas– proxied Kubernetes Agent endpoint (port8180in-cluster) via the internal reverse proxy
Tip: You can rerun
make helmanytime to rebuild, reload, and redeploy.
For working specifically on kas and agentk you can use the modules/kas Makefile.
From the repo root:
cd modules/kas
make run # kas + agentk + dependencies via docker composeNotes:
- These targets expect a default kind cluster to be available (the same one you can create via
make helmat the root). make runwill prepare certificates and secrets under the directory configured bySECRET_DIRECTORY(seemodules/kas/build/include/config.mk).
To build the kas and agentk binaries without Docker:
cd modules/kas
make build # builds both kas and agentk into the .bin directory
# or
make build-kas
make build-agentkThe exact destination is controlled by KAS_DIST_DIR in modules/kas/build/include/config.mk. Binaries are typically placed under a build/dist-like directory.
When testing the new kas proxy, agentk must be started from outside the cluster, connecting over WebSocket(S) to the proxy endpoint that kind exposes on your host.
Assuming you have:
- A kind cluster with the dev Helm chart installed (
make helmalready ran) - An external kubeconfig pointing at that cluster (for example an "ext" kubeconfig with the right server address)
- A valid Plural deploy token for the agent (
PLRL_DEPLOY_TOKEN)
You can start agentk out-of-cluster from the repo root as follows:
cd modules/kas
# build the binary if you haven't already
make build-agentk
# then run agentk from outside the cluster, pointing it at the proxy
KUBECONFIG=<PATH_TO_EXT_KIND_KUBECONFIG> \
AGENTK_TOKEN=<PLRL_DEPLOY_TOKEN> \
POD_NAMESPACE=default \
POD_NAME=agentk \
./.bin/agentk \
--kas-insecure-skip-tls-verify \
--kas-address=wss://kas.local/ext/kasKey points:
-
KUBECONFIGshould reference a kubeconfig that can reach the kind cluster from your host. -
AGENTK_TOKENis the token for the Plural agent. -
POD_NAMESPACEandPOD_NAMEare used for leader election; ensurePOD_NAMESPACEexists in the cluster:kubectl --kubeconfig "$KUBECONFIG" create namespace "$POD_NAMESPACE" || true
-
--kas-insecure-skip-tls-verifyis typically needed in local dev because the ingress TLS is self-signed. -
--kas-addressmust match the proxy hostname and path configured by the Helm chart and kind ingress. In the default setup this iswss://kas.local/ext/kas.
For non-proxy (direct) development setups, see doc/developing.md for examples using grpc://127.0.0.1:8150 and a token.txt file instead of AGENTK_TOKEN.
The modules/api module provides a kas-backed API. You can develop and test it against your local kas deployment.
Typical workflow:
-
Ensure
kasand the proxy are running in your dev kind cluster (viamake helm). -
From the repo root, run API tests:
cd modules/api make test
-
For manual testing or local runs, see the
modules/api/Makefileand the package layout undermodules/api/pkg.
The root
make testwill run tests across all modules, includingkasandapi:make test
After make helm:
# Check kas components
kubectl --namespace kas get pods
# Inspect logs
kubectl --namespace kas logs deploy/kas
kubectl --namespace kas logs deploy/kas-proxyCommon issues:
- Port 443 already in use – stop whatever is listening on 443 before running
make helm. - Docker not running / permission errors – ensure Docker is started and your user can run
dockercommands. - GOPATH issues in modules/kas –
modules/kas/MakefilerequiresGOPATHto be set andGOPATH/binto be on yourPATHfor tool installation. - Old certs/secrets in
SECRET_DIRECTORY– usemake stop(modules/kas) or rerunmake helmfrom the root to regenerate.
See CONTRIBUTING.md.
Kubernetes is a registered trademark of The Linux Foundation.