Kubernetes Containers Command args ignored in v1.5
See original GitHub issueJenkins version: 2.121.3 Plugin version: 1.5 OS: RHEL
I am using K8’s to provision slaves for Jenkins and I define my slaves in JCasC. An example config is below:
- kubernetes:
addMasterProxyEnvVars: true
containerCapStr: "100"
...
templates:
- containers:
- alwaysPullImage: true
args: "${computer.jnlpmac} ${computer.name}"
command: ""
I set command to be an empty String because otherwise it is defaulted to something like /bin/sh cat and that results in my agents dying.
In version 1.4, the above config works perfectly fine but when I upgrade to 1.5, the empty string for command is ignored and /bin/sh is set and thus my agents all fail.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Kubernetes command arguments being ignored
During the Initialization values process, during the container start, those properties seem to have they default values e.g. db_name: "ads". At ...
Read more >Define a Command and Arguments for a Container - Kubernetes
This page shows how to define commands and arguments when you run a container in a Pod. Before you begin You need to...
Read more >Troubleshooting Applications | Kubernetes
This page shows how to investigate problems related to the execution of Init Containers. The example command lines below refer to the Pod...
Read more >Handling retriable and non-retriable pod failures with Pod ...
Using Pod failure policy to ignore Pod disruptions ; Run this command to check the nodeName the Pod is scheduled to: nodeName ;...
Read more >Init Containers | Kubernetes
Here are some ideas for how to use init containers: Wait for a Service to be created, using a shell one-line command like:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, this should work if you just change the string from
args: "${computer.jnlpmac} ${computer.name}"
toargs: "^${computer.jnlpmac} ^${computer.name}"
if what you want is the literal value for the kubernetes plugin to expand when it spins up agents.This
args: "^${computer.jnlpmac} ^${computer.name}"
will evalute to the literalargs: "${computer.jnlpmac} ${computer.name}"
inside JCasC.Whereas without the
^
it will properly evaluate toargs: " "
inside JCasCThanks @casz Found in docs here for a decent example: https://github.com/jenkinsci/configuration-as-code-plugin#handling-secrets