437 Commits

Author SHA1 Message Date
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
5b1e723fdd
createCluster: add more detailed description and info regarding api port 2020-04-23 14:51:10 +02:00
iwilltry42
091190447c
createCluster: fix final print after cluster creation on windows (different setting of env vars) v3.0.0-dev-20200423.3 2020-04-23 14:43:08 +02:00
iwilltry42
cec907e1f3
set current context if empty v3.0.0-dev-20200423.2 2020-04-23 12:01:20 +02:00
iwilltry42
813a8a98af
tests/e2e: add failure case for importing images v3.0.0-dev-20200423.1 2020-04-23 11:53:34 +02:00
iwilltry42
d7e71e07d2
fix/loadImage: extract labels from master/worker nodes only
- imageVolume couldn't be determined before in some cases, because it
tried to extract the name from labels on the masterlb which doesn't have
them.
- now we're only trying get the label from master/worker nodes and this
also adds a failover solution
- also, we ignore non-worker/master nodes upon image import
2020-04-23 11:40:13 +02:00
iwilltry42
986533de8d
Makefile: update golangci-lint version v3.0.0-dev-20200423.0 2020-04-23 08:06:27 +02:00
iwilltry42
5121ef80a5
create/start/stop cluster: fix how Master-LoadBalancer is treated
- always include the k3d.role label and use LoadBalancerRole for
masterlb
- start masterlb last when starting a stopped cluster so it won't fail
2020-04-22 13:18:26 +02:00
iwilltry42
60b051fb34
tests/e2e: Enable setting the log level for E2E tests in Makefile 2020-04-22 13:06:53 +02:00
iwilltry42
f9862be237
tests/e2e: Add a full lifecycle e2e test and restructure
- new full lifecycle test also tests stop/start functionality
- cleaned up a bit
2020-04-22 12:58:02 +02:00
Thorsten Klein
141109defc
Merge pull request #226 from rancher/feature/kubeconfig-modification
[Feature] v3: improved kubeconfig handling
2020-04-22 09:26:03 +02:00
iwilltry42
347fd1e78a
tests/e2e: adapt e2e tests to new kubeconfig logic 2020-04-22 09:14:55 +02:00
iwilltry42
48f8393a86
Merge branch 'master-v3' of ssh://github.com/rancher/k3d into feature/kubeconfig-modification 2020-04-22 08:14:20 +02:00
iwilltry42
9464651f1a
fix go.mod 2020-04-20 20:10:43 +02:00
Thorsten Klein
be59524e3a
Merge pull request #227 from jacobweinstock/master-v3
[Enhancement] v3: log to stdout or stderr depending on the log level (thanks @jacobweinstock)
2020-04-20 20:10:24 +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
Jacob Weinstock
3548642cb3
Merge branch 'master-v3' into master-v3 2020-04-19 09:36:17 -06:00
Jacob Weinstock
fdd5e5a57a log to stdout or stderr depending on the log level 2020-04-19 15:32:40 +00: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
c51ec003bd
createCluster/network: add basic support for hostnetwork mode in docker 2020-04-16 10:07:19 +02:00
iwilltry42
469d8ab62d
use default value for apiPort 2020-04-16 09:49:03 +02:00
Thorsten Klein
8c7314d18c
Merge pull request #224 from rancher/feature/wait-timeout
[Enhancement] v3: new --wait and --timeout flags
2020-04-15 12:11:05 +02:00
iwilltry42
5c15dcbeca
add wait 2020-04-15 12:10:14 +02:00
iwilltry42
0f9ec09796
adapt tests to new --timeout flag 2020-04-15 11:57:53 +02:00
iwilltry42
1b7f5c5f78
createCluster/timeout: use context to handle cancellation
With the updated cobra depencendy, we're now passing a context
from the cmd to the called functions.
When creating a cluster, one can pass a Duration to the --timeout
flag, which will create a new context with a timeout.
In the two blocking functions, where we're waiting for the master nodes
(initializing master nodes and "normal" master nodes), we're now
checking for the context cancellation as well, which may be caused
by the timeout.
2020-04-15 11:52:22 +02:00
iwilltry42
80d1c5c2de
initialize proper timeout flag 2020-04-15 10:43:53 +02:00
Thorsten Klein
d8eb206e44
Merge pull request #218 from rancher/feature/master-loadbalancer
[v3/Feature] Add cluster-loadbalancer
2020-04-15 07:34:39 +02:00
iwilltry42
77bddc4dd0
create/cluster: check if cluster with given name exists
To prevent accidental rollbacks of existing clusters with the same name,
we now check if a cluster with the chosen name exists first.
If it exists, we don't do anything at all and just error our
2020-04-14 19:58:21 +02:00
iwilltry42
f2c8e0cf03
docker/create/node: replace goto with for loop 2020-04-14 19:51:24 +02:00
iwilltry42
3cd4c0a8bc
create/cluster: remove unnecessary goto initNode 2020-04-14 19:37:13 +02:00
iwilltry42
b1d71dfa0f
create/node: default clusterName for --cluster flag 2020-04-14 19:28:07 +02:00
iwilltry42
4a582efcc8
Merge branch 'master-v3' of ssh://github.com/rancher/k3d into feature/master-loadbalancer 2020-04-14 17:31:06 +02:00
iwilltry42
dc1bbd6965
manage imageVolume lifecycle 2020-04-14 17:30:12 +02:00
iwilltry42
4561f90b5d
tests/e2e: fix --api-port flag syntax 2020-04-14 10:52:38 +02:00
iwilltry42
22cc76add1
Merge branch 'master-v3' of ssh://github.com/rancher/k3d into feature/master-loadbalancer 2020-04-14 10:51:57 +02:00
iwilltry42
9e59f6ed36
network: only filter for name when checking for existing networks and do not use aliases in endpointsconfig 2020-04-11 15:53:40 +02:00
iwilltry42
a54d05e9a5
fix sleep to prevent race conditions and add log output for loadbalancer creation 2020-04-08 18:03:50 +02:00
iwilltry42
3585161da0
Merge branch 'master-v3' of ssh://github.com/rancher/k3d into feature/master-loadbalancer 2020-04-08 17:53:03 +02:00
iwilltry42
33d54132ed
add arbitrary sleep to avoid master registering race conditions 2020-04-08 17:52:24 +02:00
iwilltry42
244732bb1c
add todo 2020-04-08 17:49:02 +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
cc8399ba63
Cleanup: Todos in cmd/ 2020-04-08 13:28:10 +02:00
iwilltry42
c79b8ed1ae
E2E-Tests: init test for multi-master setups 2020-04-08 13:08:24 +02:00
iwilltry42
164d850321
CLEANUP: clean TODOs in createCluster 2020-04-06 16:51:09 +02:00
iwilltry42
be8bba9c40
update used version of golangci-lint 2020-04-06 16:37:26 +02:00