How to delete the default 'kubernetes shared cloud'

Article ID:360025420531
1 minute readKnowledge base

Issue

  • I would like to delete the default "kubernetes shared cloud"

  • I would like to restrict the default "kubernetes shared cloud" to only certain controllers

Environment

Explanation

The Operations Center contains an auto-configured "kubernetes shared cloud" item at CJOC’s root which allows CJOC users to globally edit controller pod templates in Operations Center. This item is a Shared Cloud Configuration.

Shared Cloud Configuration items hold a Jenkins cloud configuration - in that case Kubernetes plugin configuration - that is automatically propagated down to the controllers. But this propagation is restricted to sibling controllers or controllers in sub-folders of the container where the shared cloud configuration item is defined. The Shared Cloud Configuration follow the same propagation model as Shared Agents. See an example in the Shared Agents documentation.

The automatically created "kubernetes shared cloud" is defined at root and therefore propagated to all controllers. It is also automatically created on startup of the CJOC if it does not exist.

Resolution

To delete the global "kubernetes shared cloud", delete the item and add the system property -Dcom.cloudbees.opscenter.clouds.kubernetes.KubernetesConfiguration.autoconfigure=false on CJOC startup (in the cloudbees-core.yaml) so that it is not recreated on every startup.