We have an Kubernetes deployment and we would like to add a insecure commnand/flag in below manifest using something like below command
kubectl patch deploy xxxx --type='json' -p='[{"op": "add", "value":"nginx"}]'
Please help how to achieve this?
Current manifest
spec:
.
.
template:
.
.
spec:
.
.
containers:
- command:
- argocd-server
New Manifest
spec:
.
.
template:
.
.
spec:
.
.
containers:
- command:
- argocd-server
- --insecure
CodePudding user response:
Try this
kubectl patch deployment xxxx --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/command", "value": ["argocd-server", "--insecure"]}]'
and verify the command
kubectl get deployment xxxx -o=json | jq '.spec.template.spec.containers[0].command'
output
[
"argocd-server",
"--insecure"
]