-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: kubernetes-plugin
Scenario 0:
I have a custom pod defined on my shared-library that I usualy use for some pipelines.
pipeline{
  agent {
    kubernetes {
      yaml libraryResource("kubernetes/pod/custom-pod.yaml")
      defaultContainer 'jnlp'
    }
 }
Result: custom-pod runs as expected.
Scenario 1:
There is a pipeline where I need to define a ephemeral-storage request. I didn't want to create another custom pod, so I wanted to resuse the custom-pod and merged the changes I needed using the inheritFrom attribute from kubernetes-plugin.
pipeline{
  agent {
    kubernetes {
      inheritFrom libraryResource("kubernetes/pod/custom-pod.yaml")
      yaml '''
        spec:
         containers:
          - name: jnlp
           resources:
            requests:
             ephemeral-storage: "16Gi"
        '''
      defaultContainer 'jnlp'
    }
 }
Result: inheritFrom is ignored. instead the kubernetes default template is merged with the yaml defined.