Commit Graph

24 Commits

Author SHA1 Message Date
iwilltry42
3cd1a05b91
Maintenance: move all labels to constants and fix log formatting issues 2020-06-12 19:00:01 +02:00
iwilltry42
bdb5a1f858
getKubeconfig: fix condition when no overwriting contexts
Reference: https://github.com/rancher/k3d/pull/268#issuecomment-639829646
2020-06-10 19:20:02 +02:00
iwilltry42
434cf8e91d
overall: pass context from top to bottom 2020-05-26 14:47:21 +02:00
iwilltry42
0d2c22455d
Overall: use context.Context in top-level exported functions
- package cluster: use context.Context as first function param in every
exported function
- package cmd: pass cmd.Context() to calls to package cluster exported
functions
2020-05-18 12:57:59 +02:00
iwilltry42
c6564801f3
getKubeconfig: always return output filepath 2020-05-04 18:26:59 +02:00
iwilltry42
edeea4540b
getKubeConfig: create output directory path if not exists 2020-05-04 07:32:52 +02:00
iwilltry42
2d68ef12e4
deleteCluster: remove cluster details from kubeconfig
- refactoring in pkg/cluster/kubeconfig
- new functions to delete a cluster from kubeconfig
- call RemoveClusterFromDefaultKubeConfig after deleting cluster
2020-04-24 14:44:21 +02:00
iwilltry42
5b637126d7
createCluster: add --update-kubeconfig flag
- enables wait-for-master
- calls GetAndWriteKubeConfig after successful cluster creation to
  update the default kubeconfig with the new cluster's details
- does NOT automatically switch the current-context
- outputs a different line saying, that you can switch context now
2020-04-24 14:02:38 +02:00
iwilltry42
6677f82d5b
getKubeConfig: consider the KUBECONFIG env var when updating default kubeconfig 2020-04-24 07:52:23 +02:00
iwilltry42
cec907e1f3
set current context if empty 2020-04-23 12:01:20 +02:00
iwilltry42
d9e0e0f914
getKubeConfig: update existing kubeconfigs 2020-04-20 19:16:00 +02:00
iwilltry42
407fcd4e1f
rename to UpdateKubeConfig 2020-04-20 17:22:56 +02:00
iwilltry42
fc1b858325
getKubeConfig: add functionality to update an existing KubeConfig 2020-04-20 10:35:43 +02:00
iwilltry42
df07358f47
getKubeconfig: fix: update context with new authInfo and cluster names 2020-04-16 12:35:37 +02:00
iwilltry42
2a76bba98b
getKubeconfig: modify kubeconfig as an object
Before this change, we simply did a search/replace on the
stringified kubeconfig blob.
Now we're parsing it into a kubeconfig struct and modify the fields
directly in a more controlled manner.
Here's what we change:
- server URL: based on the chosen APIHost and APIPort
- cluster name: default -> k3d-CLUSTERNAME
- user name: default -> admin@k3d-CLUSTERNAME
- context name: default -> admin@k3d-CLUSTERNAME
2020-04-16 11:42:57 +02:00
iwilltry42
a24d6f864e
Proxy: deploy a configurable nginx proxy in front of the cluster
Up to now, we exposed ports on single master nodes, which is quite
inconvenient on user side and troublesome on development side.
Now, we're creating a proxy container which exposes a single port
and proxies traffic to all master nodes.
Currently, this only works with 'k3d create cluster' and won't
update the proxy when using 'k3d create node --role master'.
2020-04-08 17:45:27 +02:00
iwilltry42
bc49f197d9
cleanup and prepare for push to rancher/k3d 2020-01-05 21:16:31 +01:00
iwilltry42
ef2907de41 replace 127.0.0.1:6443 in kubeconfig as well 2019-12-05 09:33:22 +01:00
iwilltry42
84234e7a98 add proper k3d config dir and kubeconfig output path 2019-12-05 09:08:10 +01:00
iwilltry42
400e85c3db replace 'default' in kubeconfig with cluster name 2019-11-11 11:49:16 +01:00
iwilltry42
116dd5dad8 fix api-port 2019-10-25 11:09:26 +02:00
iwilltry42
24a0bda247 init get kubeconfig 2019-10-24 14:57:15 +02:00
iwilltry42
8450604182 start implementing getkubeconfig 2019-10-17 07:59:56 +02:00
iwilltry42
acebc511ef start get kubeconfig 2019-10-16 16:52:46 +02:00