edit kube-proxy configmap programmatically

424 views
Skip to first unread message

test...@gmail.com

unread,
Sep 26, 2017, 12:17:47 PM9/26/17
to Kubernetes user discussion and Q&A
hello. we are automating bootstrapping of k8's on on-prem setup. One of the step includes editing of kube-proxy configmap. we are using command "kubectl edit -n kube-system configmap/kube-proxy". to edit kube-proxy. When I run this command, it opens up the editor. I can modify it and save it. This looks good if I edit it manually. In our scenario - we are trying to automate this so that i code it in ansible playbook. I wanted to know - is there a way to edit kube-proxy programmatically so that we can automate it. Basically - we want to update "ip" and "port" in the kube-proxy. any pointers/solutions?

Rodrigo Campos

unread,
Sep 26, 2017, 4:34:39 PM9/26/17
to kubernet...@googlegroups.com
Instead of edit, you can run a get -o yaml, edit and apply -f <file>, for example.

Sorry if it is not clear in the doc now. Can you please point where you would like to find it? Open an issue, or even better, submit a PR? :-)


On Tuesday, September 26, 2017, <test...@gmail.com> wrote:
hello. we are automating bootstrapping of k8's on on-prem setup.  One of the step includes editing of kube-proxy configmap. we are using command "kubectl edit -n kube-system configmap/kube-proxy". to edit kube-proxy.  When I run this command, it opens up the editor. I can modify it and save it. This looks good if I edit it manually. In our scenario - we are trying to automate this so that i code it in ansible playbook. I wanted to know - is there a way to edit kube-proxy programmatically so that we can automate it.  Basically - we want to update "ip" and "port" in the kube-proxy. any pointers/solutions?

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

prakas...@gmail.com

unread,
Sep 27, 2017, 1:18:16 PM9/27/17
to Kubernetes user discussion and Q&A
thank you. the suggested solution worked for me.
I think it was my bad - I didn't explore "get -o yaml" option. I was looking at "patch" command. I think your docs look good.
Reply all
Reply to author
Forward
0 new messages