kubectl config set: please add some examples

Created on 4 Apr 2018  路  8Comments  路  Source: kubernetes/kubectl

kubectl v1.10
/kind documentation
/sig cli

This command's --help message is not useful at all. Can we please have some commonly used tasks listed in EXAMPLES section of the --help message?

$ kubectl config set --help
Sets an individual value in a kubeconfig file

PROPERTY _NAME is a dot delimited name where each token represents either an attribute name or a map key.  Map keys may
not contain dots.

PROPERTY _VALUE is the new value you wish to set. Binary fields such as 'certificate-authority-data' expect a base64
encoded string unless the --set-raw-bytes flag is used.

Options:
      --set-raw-bytes=false: When writing a []byte PROPERTY_VALUE, write the given string directly without base64
decoding.

Usage:
  kubectl config set PROPERTY_NAME PROPERTY_VALUE [options]

Use "kubectl options" for a list of global command-line options (applies to all commands).
arekubectl help wanted kindocumentation prioritP1 sicli

Most helpful comment

It would also be nice if there was an option to kubectl config view that would show the property names in a format that was compatible with config set.

All 8 comments

It would also be nice if there was an option to kubectl config view that would show the property names in a format that was compatible with config set.

+1 agree that examples would be very helpful.

I do have one example that will work, but I have not determined the total syntax for "maps"

 kubectl config set clusters.cluster.certificate-authority-data $(echo "cert_data_here" | base64 -i -)

/area kubectl
/priority P1

I'd like to pick this up if no one has yet

hi, @amerghazal do you still working on this? if not, can i take this?

cc @seans3 @soltysh can i work on this?

@ahmadnurus i got started on this and then sidetracked. i鈥檓 ok either way. sorry for the delay!

Was this page helpful?
0 / 5 - 0 ratings