Commit Graph

50 Commits

Author SHA1 Message Date
iwilltry42
11cc797922
overall/logging: new trace log level
- new root flag '--trace' with precedence over '--verbose'
- some new trace logs
- migrated some debug logs to trace logs to reduce debug verbosity
2020-10-07 08:58:03 +02:00
iwilltry42
ec3f10ec57
use server/agent instead of master/worker 2020-07-14 20:29:33 +02:00
iwilltry42
b02c783130
adjust toplevel pkg functions to new syntax 2020-07-14 15:02:51 +02:00
iwilltry42
76d90478f5
Go Module: use v3 for go module compatibility 2020-06-18 07:58:36 +02:00
iwilltry42
3cd1a05b91
Maintenance: move all labels to constants and fix log formatting issues 2020-06-12 19:00:01 +02:00
iwilltry42
2d0ec0a1d0
createNode: fix log output generating nil pointer...
... dereference in addNodeToCluster when cluster does not exist.
Fixes #277
2020-06-12 12:39:36 +02:00
iwilltry42
42ee62e552
createNode: add --wait and --timeout flags
- new struct: createNodeOpts for wait and timeout values
- new commands for creating/adding multiple nodes which then wait for
all nodes to be up, if specified
- tests/e2e: new test for adding a master node
2020-06-03 14:55:50 +02:00
iwilltry42
ee8b34d9f6
createNode: do not copy '--cluster-init' when creating a new master node, as this will break the node 2020-06-03 13:40:13 +02:00
iwilltry42
f0d3389a1f
removeNode: update loadbalancer if master
- use idempotent UpdateKubeconfig which takes a fresh list of master
nodes and uses it to update the loadbalancer
- removeNode: use aforementioned function to update the loadbalancer
config when removing a master node
2020-06-02 20:03:42 +02:00
iwilltry42
477fe8b395
Merge branch 'master' of github.com:rancher/k3d into enhancement/use-context 2020-06-02 19:26:20 +02:00
iwilltry42
cf2c839b27
createNode: use default role label and cmd...
...if existing node does not match target role
Fixes #254
2020-05-29 14:03:51 +02:00
iwilltry42
4710f65b85
Merge branch 'master' of github.com:rancher/k3d into enhancement/use-context 2020-05-29 11:42:47 +02:00
iwilltry42
99f5a6884a
getNodeLogs: accept time.Time parameter
- fixes startCluster's --wait/--timeout functionality
--> now doesn't check all the logs (e.g. from previous run)
----> no more false positives when checking for a specifc log message
only in the current run
2020-05-29 11:21:12 +02:00
iwilltry42
ba431c6235
Merge branch 'master' of github.com:rancher/k3d into enhancement/use-context 2020-05-26 14:49:45 +02:00
iwilltry42
434cf8e91d
overall: pass context from top to bottom 2020-05-26 14:47:21 +02:00
iwilltry42
21fd427d8a
maintenance: cleanup debug logs 2020-05-26 14:14:55 +02:00
iwilltry42
639daef7fb
Reorder parameters
- runtimes.Runtime should at max. the second function parameter (right
after context.Context)
2020-05-26 12:58:43 +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
fe21c27a32
createNode: add failover solution to get K3S_URL value 2020-05-11 11:32:30 +02:00
iwilltry42
ee8fe0bb35
createNode: add failover solution to get K3S_URL value 2020-05-11 11:32:00 +02:00
iwilltry42
4bfac51c7c
createCluster/createNode: use K3S_URL instead of --server 2020-05-11 09:17:48 +02:00
iwilltry42
c061104b53
createNode: copy as many details as possible from existing
- we now use the full containerJSON details when getting a node
- we now use as many details as possible to copy k3d settings from an
existing node when adding a new node to a running cluster
2020-05-11 08:42:44 +02:00
iwilltry42
da8adf5469
createNode: update nginx masterlb with new master node
- if --role=master, update nginx config and reload it
2020-05-09 15:11:06 +02:00
iwilltry42
b7b8f6a5a6
createNode: use any node as blueprint
- if no node with the target role exists in the cluster, just choose any
other (non-proxy) node instead
- to make this work, we also need to add the k3s url label to every node
2020-05-09 14:12:29 +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
5c15dcbeca
add wait 2020-04-15 12:10:14 +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
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
b8ac954d69
implement --wait asynchronously 2020-01-28 10:28:30 +01:00
iwilltry42
bc49f197d9
cleanup and prepare for push to rancher/k3d 2020-01-05 21:16:31 +01:00
iwilltry42
644b369b60
switch from K3S_CLUSTER_SECRET to K3S_TOKEN and use exact matching to get node containers by name and make --cluster flag required when creating a new node 2019-12-19 11:50:25 +01:00
iwilltry42
fd4b803681 start fixing createNode 2019-12-12 19:14:26 +01:00
iwilltry42
60659c74c8 cleanup delete node command and add --all flag 2019-12-03 19:17:10 +01:00
iwilltry42
189e430f90 fix port collisions due to default exposed port on master nodes 2019-11-22 18:46:52 +01:00
iwilltry42
536b543cc2 implement get nodes 2019-11-13 14:58:59 +01:00
iwilltry42
4adb695b47 add tls san for non-default host name 2019-10-25 11:16:48 +02:00
iwilltry42
116dd5dad8 fix api-port 2019-10-25 11:09:26 +02:00
iwilltry42
7063d62508 initial implementation of 'get clusters' 2019-10-15 18:57:54 +02:00
iwilltry42
544480e010 add cluster secret 2019-10-10 16:39:13 +02:00
iwilltry42
84cdfac7cb introduce node roles 2019-10-10 15:02:56 +02:00
iwilltry42
cd72e22dce patch specs with node role specific settings 2019-09-30 13:54:48 +02:00
iwilltry42
7583340d23 create cluster 2019-09-30 13:18:42 +02:00
iwilltry42
43eb626b0c specify role, image and labels 2019-09-30 12:33:17 +02:00
iwilltry42
cd4223e4ed create multiple nodes at once 2019-09-30 09:28:00 +02:00
iwilltry42
8eb9832298 delete cluster 2019-09-27 16:34:49 +02:00
iwilltry42
ac43655396 update golangci-lint 2019-09-26 18:15:06 +02:00
iwilltry42
edc52c6ae6 delete node containerd 2019-09-25 15:07:17 +02:00
iwilltry42
5f5c516ba2 adapt new way of choosing runtime 2019-09-25 10:04:40 +02:00
iwilltry42
24ba46fc2a initial test to create container 2019-09-24 21:19:03 +02:00
iwilltry42
a4f5f80286 add utils and function skeletons 2019-09-03 17:29:57 +02:00