0

I have a deployment of 3 containers in OCP. In one of them there is a configuration file which I want to mount to the container via configMap. I created a configMap and tried to mount it to the container but it didn't work.

I use 'csanchez jenkins kubernetes' plugin, so the deployment is configured in a yml file and written in xml format. I found this in the docs of the csanchez plugin, tried to add the necessary field to the container field, but it did not worked.

I want to connect it to a single container and not to the pod, because the path of the config file is the same in another one, but the config file differs.

I tried to add to the container field:

<volumeMounts>
  <org.csanchez.jenkins.plugins.kubernetes.volumes.configMapVolume>
    <mountPath>/opt/selenium/config.json</mountPath>
    <configMapName>selenium-config-map</configMapName>
  </org.csanchez.jenkins.plugins.kubernetes.volumes.configMapVolume>
</volumeMounts>

I tried to switch volumeMounts with volumes and it also didn't work.

DlekaShelHaHaim
  • 115
  • 1
  • 8
  • 1
    What is the goal/benefit from converting a yaml to a XML file? The whole CNCF world works mainly with YAML, so my suggestion is to stick to that. – Mike Jan 19 '23 at 09:09
  • 1
    @Mike Hey Mike, unfortunately it is a decision which is not up to me, and I wish I could use yaml like in every other k8s. It is because of a plugin that lets you deploy jenkins deployment in k8s cluster and use pods as salves. – DlekaShelHaHaim Jan 19 '23 at 09:45
  • 1
    Please share deployment and configmap definition which are being used. also the error which you are facing – Nataraj Medayhal Jan 19 '23 at 13:01

0 Answers0