Client controller trying to connect to Kubernetes managed agents

Article ID:360030799731
1 minute readKnowledge base

Issue

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
...

Where 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 controllers 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 controller.

Resolution

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).