| I can reproduce this or very similar problem with Jenkins 2.176.3, Kubernetes plugin 1.19.2 We configure the Kubernetes using JCasC and it generates config.xml without Kubernetes <namespace> element. However after making any change to the global configuration using the Jenkins web UI the empty elements <namespace></namespace>,<inheritFrom></inheritFrom> and <nodeSelector></nodeSelector> will appear in the config.xml. After this, Jenkins fails to launch Kubernetes slaves with following exception trace: INFO: Created Pod: default/my-jnlp-f0n0n Oct 31, 2019 8:17:36 PM hudson.slaves.NodeProvisioner$2 run INFO: Kubernetes Pod Template provisioning successfully completed. We have now 3 computer(s) Oct 31, 2019 8:17:36 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch WARNING: Error in provisioning; agent=KubernetesSlave name: my-jnlp-f0n0n, template=PodTemplate{inheritFrom='', name='my-jnlp', namesp ace='', label='my-jnlp', nodeSelector='', nodeUsageMode=EXCLUSIVE, workspaceVolume=org.csanchez.jenkins.plugins.kubernetes.volumes.works pace.DynamicPVCWorkspaceVolume@2d963013} io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://10.96.0.1/api/v1/namespaces/default/persistentvo lumeclaims. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. persistentvolumeclaims {{ is forbidden: User "system:serviceaccount:default:jenkins-master" cannot create resource "persistentvolumeclaims" in API group "" in the na}} mespace "default". {{ at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:510)}} {{ at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:447)}} {{ at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:413)}} {{ at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:372)}} {{ at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleCreate(OperationSupport.java:241)}} {{ at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(BaseOperation.java:813)}} {{ at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(BaseOperation.java:328)}} {{ at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(BaseOperation.java:324)}} {{ at org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.DynamicPVCWorkspaceVolume.createVolume(DynamicPVCWorkspaceVolume.java:9}} 4) {{ at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:130)}} {{ at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:294)}} {{ at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)}} {{ at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)}} {{ at java.util.concurrent.FutureTask.run(FutureTask.java:266)}} {{ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}} {{ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}} {{ at java.lang.Thread.run(Thread.java:748)}} Thus, it seems to me that the namespace='' is not equal to not having a namespace element at all in the config.xml |