I am unable to use Kubernetes agents from a traditional Client controller attached to CJOC.
The Client controller logs show something similar to:
2019-06-14 15:15:00.950+0000 [id=59] INFO o.c.j.p.k.KubernetesCloud#provision: Template for label my-kubernetes-agent-48223671-ee1c-4b8f-a640-048581019ce1: Kubernetes Pod Template 2019-06-14 15:15:00.951+0000 [id=59] WARNING o.c.j.p.k.KubernetesCloud#provision: Failed to connect to Kubernetes at : kubernetes.default.svc ...
my-kubernetes-agent is the agent you are trying to connect to.
The issue is that the Client controller is trying to provision a new Kubernetes agent, using the Cloud configured in CJOC, but, as the Client controller is not actually part of the cluster, it’s unable to connect to Kubernetes namespace (
at : kubernetes.default.svc).
The Operations Center and any Managed controllers are created within the Kubernetes namespace, so they are able to connect.
It looks to be mentioned (briefly) in the documentation:
Existing masters that are connected to Operations Center lack key benefits of Managed controllers like high availability and automatic agent management. Whenever possible, administrators should use a Managed controller with CloudBees Core rather than connecting an existing master.
- CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
- CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
- CloudBees CI (CloudBees Core) on traditional platforms - Client controller
- CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
Unfortunately, Client controllers cannot use the Kubernetes automatic agent management system.
You can utilize Kubernetes agents using either a Managed controller or Team controller (they will be running inside of the Kubernetes cluster).