204 Commits

Author SHA1 Message Date
Thorsten Klein
185ffcd34f
[Enhancement] clusterDelete: proper node and network handling (#437)
This comes with several fixes/improvements

- only consider containers that have the default object label (app=k3d)
- handle network deletion
  - check if there are other k3d containers connected
  - if there are only registries, disconnect them
  - if there are non-registry nodes, leave everything as it is
  - if there are any containers connected, that are not automatically
  disconnected, log a warning and continue
2021-01-07 11:32:30 +01:00
iwilltry42
3fcc50b205
Merge branch 'main' into main-v4 2021-01-05 08:42:53 +01:00
iwilltry42
b36c49aac2
import image: add additional exception handling to avoid nil pointer exceptions 2021-01-05 08:35:20 +01:00
Josh Soref
e7802d2def
docs: spell checking (#434, @jsoref) 2021-01-05 08:15:36 +01:00
iwilltry42
418275565c
disable hostname validation for registry to allow dotted names like registry.localhost 2021-01-05 07:29:22 +01:00
iwilltry42
eafae0073a
registry: allow creating new and using existing registries 2021-01-04 09:40:36 +01:00
Alvaro
5dedac8cbb
Print the creation time for containers (#431)
* Added a new `created` field that exports the creation time
for all the containers in the cluster.

Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-12-30 18:47:37 +01:00
Thorsten Klein
c44c576d69
[Refactoring/Preparation] use real port structs as prep for registries (#427) 2020-12-11 16:36:10 +01:00
iwilltry42
d042c79df2
unify the registry type 2020-12-11 08:56:26 +01:00
iwilltry42
621640c901
rename ExposedPort 2020-12-10 14:41:31 +01:00
iwilltry42
0c32c36d99
rename Registry field from name to host 2020-12-10 14:36:51 +01:00
iwilltry42
a58785f442
rename externalRegistry field from name to host 2020-12-10 14:34:52 +01:00
Thorsten Klein
ecc025b35e
[Feature] Registry for v4 & Restructure Cluster Creation (#334) 2020-12-09 15:59:20 +01:00
Thorsten Klein
778f80d8fd
[FEATURE] Config File (#351) 2020-12-04 16:02:37 +01:00
iwilltry42
d7b25ac6ab
v3 -> v4 2020-12-04 13:45:57 +01:00
Alvaro
a93932e5b6
[Feature] Options for formatted output of cluster list (#416, @inercia))
This adds a `--ouput` flag to `cluster list` for dumping the
list of clusters as a JSON or YAML document.

Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-12-03 13:34:33 +01:00
Fabrice Vergnenegre
2d8d60b005
FIX: #412 set Restart flag to true before creation (#413, thanks @fabricev) 2020-11-26 08:54:06 +01:00
iwilltry42
3c5690a507
cleanup docker-machine related logs 2020-11-13 07:38:15 +01:00
iwilltry42
aa3a54e3c9
do not use host.docker.internal IP for API on non-docker-machine setups of Docker for Desktop 2020-11-12 20:49:40 +01:00
Thorsten Klein
586b1c7eae
clusterCreate: use docker VM IP for API connection (#399)
Try
- `docker-machine ip`
- host lookup for `host.docker.internal`

Fixes #388
2020-11-04 15:44:46 +01:00
Thorsten Klein
d0158c97c6
clusterCreate: add docker's --gpus flag (#395) 2020-11-03 20:12:52 +01:00
iwilltry42
b5eeda74d6
execInNode: check if we have a response before trying to access the reader in case of error to avoid nil pointer exceptions 2020-10-26 13:39:29 +01:00
iwilltry42
a385241c77
clusterDelete: no error if no cluster was found (fixes #379) 2020-10-19 23:29:18 +02:00
iwilltry42
425b9b709e
execInNode: do not read logreader too early, because that clears it for other read processes 2020-10-19 14:36:49 +02:00
iwilltry42
b69b874098
clusterCreate/injectHostIP: use 'busybox xargs' directly instead of relying on 'xargs' link, which is missing in some images 2020-10-19 13:54:29 +02:00
iwilltry42
d097caf7d3
clusterCreate: move inject hostIP to separate func 2020-10-19 12:37:27 +02:00
iwilltry42
dcef0b1946
runtime/docker/node: logreader must not be nil
Check for nil when trying to return exec process log reader.
Fixes #377
2020-10-15 07:28:30 +02:00
iwilltry42
f0ad42ce8d
clusterCreate: simple change to serialize joining server nodes 2020-10-10 17:11:29 +02:00
iwilltry42
584bf71592
createCluster: wait for 'k3s is up and running' instead of 'Running kubelet' to ensure that the API-Server is up 2020-10-08 20:58:20 +02:00
iwilltry42
ca23c6d898
clusterCreate/network: only use the exact chosen network
Before, we just looked up the name of the docker network, causing docker
to do some sort of relaxed matching (prefix?) which could cause k3d to
choose the first matching network instead of the exact match.
Now we're enforcing exact Regex matching to prevent this.
Fixes #374
2020-10-08 09:31:59 +02:00
iwilltry42
bfbd2873d9
clusterCreate: add extra logs for host record injection 2020-10-07 12:03:26 +02:00
iwilltry42
c27410ea32
createCluster: Fix getHostIP edge cases
- sometimes, the exec process returns a non-zero exit code but still has
logs which are helpful for us
- sometimes everything fails and we should gracefully handle this
2020-10-07 11:02:46 +02:00
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
da0b23331f
clusterCreate: less breaking hostIP injection
- only print a warning, if hostIP couldn't be fetched
- even if the exec returns a non-zero exit code, still try to read the
logs
2020-10-07 08:29:09 +02:00
iwilltry42
d063482a32
clusterCreate: add --no-hostip flag to disable the automatic injection of the host.k3d.internal entry into /etc/hosts and CoreDNS 2020-10-05 15:19:00 +02:00
iwilltry42
60069f6f19
fix typo 2020-10-01 21:10:04 +02:00
iwilltry42
dc0ba9873b
patch CoreDNS configmap with host.k3d.internal 2020-10-01 21:09:12 +02:00
iwilltry42
972c004930
add entry for host.k3d.internal to /etc/hosts in the node containers 2020-09-29 15:20:43 +02:00
iwilltry42
b5a9d6397f
fix unittests 2020-09-20 17:53:41 +02:00
iwilltry42
5fbd42898e
clusterStart: also don't wait for serverlb if it's running already 2020-08-14 12:15:03 +02:00
iwilltry42
d5709b9a09
clusterStart: do not try to start node if it's already running to avoid waiting forever on a log message 2020-08-14 12:09:29 +02:00
Thorsten Klein
b029655c8b
Merge pull request #328 from rancher/feature/node-status
[Feature] Node Status
2020-08-13 19:04:40 +03:00
iwilltry42
d3c5cfb766
fix: allow allow port-ranges on the loadbalancer 2020-08-12 15:58:00 +02:00
iwilltry42
cc3fe46a23
clusterList: include node state 2020-08-12 11:24:15 +02:00
iwilltry42
1285fb90c4
overall: add node status field 2020-08-12 11:14:18 +02:00
kshelton
eaa7784625 Handle leading '/' in names for docker runtime 2020-08-06 18:03:49 +00:00
iwilltry42
e5d093d3ce
clusterList: add bool for loadbalancer 2020-07-15 09:10:47 +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
eac293a263
Overall: helper container images should always use same tag as CLI or fallback to latest 2020-06-18 09:01:04 +02:00