Commit Graph

18 Commits

Author SHA1 Message Date
justinsb 324117cc52 chore: generate kubeconfig on the fly
Some kOps actions require connecting to the cluster, but
we don't always have a kubeconfig available.

This commit adds a function to generate a client config on the fly
(including a certificate) when needed.
2024-12-27 16:37:59 -05:00
Ciprian Hacman 8d76b6e573 Use API internal name as TLS server name in kubeconfig 2023-06-02 14:13:01 +03:00
justinsb e3ed4bb483 kops auth-plugin: need to clear any existing password / key
Otherwise the password / key is used in preference to the auth plugin,
so these are used even if they have expired.
2021-12-10 08:48:23 -05:00
John Gardiner Myers f93ac8730a Include multiple CA certs in exported kubeconfigs 2021-06-21 07:36:33 -07:00
Alexander Block 6ae8d8cc9e Also set haveUserInfo=true in case --user was provided in "kops export kubecfg"
Without setting it to true, --user is completely ignored.
2021-06-16 09:36:47 +02:00
Justin Santa Barbara b60a45beba Only update kubeconfig user when we have user info
This preserves existing user configuration.

Issue #11537
2021-05-23 17:16:30 -04:00
Peter Rifel aebe742291
Remove unused bearer token field from kubeconfig builder
```
$ grep -r KubeBearerToken . | wc -l
0
```
2020-11-06 08:07:55 -06:00
Justin SB 8757a2ce2a kubeconfig generation: add tests for kops plugin
Also slightly simplify the tests and Kubecfg Builder signature by
passing in the ConfigAccess only when needed.
2020-08-30 15:17:36 -04:00
Justin SB 0cda0f5068 Support authentication helper for kubectl
We create a simple exec plugin command which can create and renew
short-lived admin credentials on the fly, essentially leveraging the
security of the underlying cloud credentials.

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-08-30 15:16:20 -04:00
Peter Rifel 4d9f0128a3
Upgrade to klog2
This splits up the kubernetes 1.19 PR to make it easier to keep up to date until we get it sorted out.
2020-08-16 20:56:48 -05:00
Ole Markus With 72fd007acf Don't export admin user by default. Allow specifying existing user when exporting context 2020-06-24 19:54:25 +02:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Justin SB 3e33ac7682
Change code from glog to klog
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog.  That
will happen when we update to k8s 1.13.
2019-05-06 12:54:51 -04:00
Adam Yang 14862af0f3 fixed method signature 2019-02-20 13:45:06 -05:00
Adam Yang 90013239fd initial implementation 2019-02-19 22:26:59 -05:00
mikeweiwei 027d324aaf If don't use formatted output,fix logging calls 2018-10-10 19:19:09 +08:00
chrislovecnm 3382b2d82f kops not Kops 2017-11-29 00:38:49 -07:00
Justin Santa Barbara 2817e49bd6 Refactor kubeconfig building 2017-03-28 10:10:14 -04:00