CLI command shared-pod-template is returning always an empty list

Issue

After running the shared-pod-template CLI command as described in Export Kubernetes (shared) pod template definitions from CloudBees CI Operations Center and masters, the output is always an empty list.

$ java -jar jenkins-cli.jar -s https://cloudbees-core-url:port-number/cjoc/ shared-pod-template
{"version":"1","data":[]}

Environment

Resolution

The problem behind this is that in version 2.190.0.2 of Operations Center Kubernetes Cloud Plugin (released as part of CloudBees CI on modern cloud platform 2.190.3.2), the name of the default kubernetes shared cloud changed from kubernetes shared cloud to kubernetes-shared-cloud.

However the shared-pod-template CLI command was not updated to read the new location and is still looking for the old name (kubernetes shared cloud).

If the first installation of your cluster is based on CloudBees CI on modern cloud platform 2.190.3.2 or a higher version, the default kubernetes shared cloud will be named as kubernetes-shared-cloud, so the shared-pod-template CLI command won’t be able to read the shared pod templates.

The fix for the shared-pod-template CLI command was already done but it wasn’t released yet. Hopefully, upcoming version of Operations Center Kubernetes Cloud Plugin should include the fix.

Workaround

In the meantime, the issue can be worked around by renaming the $JENKINS_HOME/kubernetes-shared-cloud directory to $JENKINS_HOME/kubernetes shared cloud and restarting the Operation Center.

Have more questions?

0 Comments

Please sign in to leave a comment.