108 Commits

Author SHA1 Message Date
Thorsten Klein
f8f17caf78
[Cleanup] Types, ready-log-messages & closing connections (#818)
- new special internal role `initServer` used only to determine the correct ready-log-message
- ready-log-messages now looked up by role and new `Intent` type (cluster-create/cluster-start/node-create/node-start), as especially for the init server there are different log messages indicating that we can proceed with the next step
- moving types around:
	- K3s env vars now under .../types/k3s/env.go
	- defaults now under .../types/defaults.go
	- ...
- improved waiting for log messages
	- not checking the whole log again and again in a loop
	- follow log with a single reader (and retry in case we see a fatal error, meaning that the K3s container will restart -> backoff after 10 tries)
	- BREAKING: new `*runtimeTypes.NodeLogsOpts` parameter in GetNodeLogs
2021-10-27 12:56:04 +02:00
Thorsten Klein
67d8c8c84f
[Enhancement/Fix] Properly use env/runtime info and inject dns accordingly (#758)
- make use of environment and runtime info
- DfD: use host.docker.internal
- All other cases: use Docker network Gateway
- k3d-tools: based on alpine to have `getent` present
2021-09-23 12:41:30 +02:00
Thorsten Klein
3b9d8373e1
[Docs] v5 update (#740) 2021-09-17 20:41:57 +02:00
iwilltry42
7073a8fad7 migrate to module rancher/k3d/v5 2021-09-07 08:58:57 +02:00
iwilltry42
630788f1e7 clusterCreate: add --lb-config-override flag
- allow overriding k3d-proxy settings (workerProcesses,
defaultProxyTimeout)
- add new field to loadbalancer config and SimpleConfig structs
2021-09-07 08:23:46 +02:00
Thorsten Klein
7ba71ad66c
[Feature] CreateNode: add token and network flags and allow remote cluster (#734)
- `--cluster` flag parsed for `https://` prefix and node creation treated differently accordingly
- new `--network` string array flag to add the node to multiple networks (primary network when adding to a remote cluster)
- new `--token` flag to provide the cluster token
2021-09-07 07:31:18 +02:00
Thorsten Klein
b4158a1dc1
[Enhancement] Network Magic (#721)
- before starting the cluster, gather environment info via tools node
- use hostIP/gatewayIP for DNS (iptables + resolv.conf updated in entrypoint script)
- revamp of custom entrypoint scripts
2021-08-30 14:59:12 +02:00
Thorsten Klein
212979d0bb
[Enhancement] DNS Injection (#718)
- remove`--no-hostip` flag and the related `disableHostIPInjection` config option
- inject host IP on every cluster startup (except when hostnetwork is chosen)(/etc/hosts + CoreDNS)
- inject host entries for every cluster network member container into the CoreDNS configmap
2021-08-24 10:18:53 +02:00
Mateusz Urbanek
917c19eae5
feat(logging): using new package containing logrus.Logger instead of global scope logrus (closes #583) (#699, @Shanduur) 2021-08-18 12:22:44 +02:00
iwilltry42
8fef6aee09
fix usage of the new loadbalancer type and ordering when cluster is created 2021-07-09 10:48:28 +02:00
iwilltry42
91db3f647c
changes when creating clusters + new nodefilter syntax
- generate node names when transforming from simple to cluster config
  - ClusterCreate(clusterconfig) should have a ready made config and not
  generate variables
- ClusterCreate() only prep LB if not already present (to be removed)
- cluster struct: serverloadbalancer is now of type LoadBalancer (Node +
Config)
- use new nodefilter syntax with 'id:index:suffix' instead of
'id[index]' everywhere
  - use suffix when creating the LB
2021-07-09 10:48:26 +02:00
iwilltry42
8e29ad4f1a
add some more portmapping work 2021-07-09 10:48:26 +02:00
iwilltry42
44a79c4670
types/node: add nodehooks to node struct to have them around at any stage (TO-DO: use this everywhere -> breaking change) 2021-07-09 10:46:19 +02:00
iwilltry42
ff76512e63
move defaults for images to new file 2021-07-09 10:46:18 +02:00
iwilltry42
a3dd47029d
generate new config file for lb and add helper functions to get images from env if needed 2021-07-09 10:46:18 +02:00
iwilltry42
21244172c9
move loadbalancer creation to separate function 2021-07-09 10:46:17 +02:00
iwilltry42
de401c6db3
add debug functionality to get current loadbalancer config 2021-07-09 10:46:17 +02:00
ejose19
bfead49c46
[Enhancement] Refactoring: normalize label flags (k3s node & runtime) (#598, @ejose19) 2021-07-09 10:46:16 +02:00
Thorsten Klein
261ac0faf4
[BREAKING] Config File Enhancements: v1alpha3, migrations, generic k3s-args (#605)
Excerpt:
- new version v1alpha3 with k3s extraArgs using node filters
  - reflected in CLI via --k3s-arg
- new migration option to migrate (internally and via cli) from v1alpha2
to v1alpha3
- enhancements to how config files are being read
- e2e tests for config file migration
2021-07-09 10:46:12 +02:00
iwilltry42
296f24c9b7
Revert 'Revert "add --node-label flag for node create command (#584, @developer-guy, @ejose, @dentrax)"'
This reverts commit 70872648b345af93380653a357cc5c215614fb7c.
2021-07-09 10:45:30 +02:00
Thorsten Klein
c5f7884f78
[ENHANCEMENT] imageImport: start existing tools node before using it and add option to keep it around (#672) 2021-07-09 08:22:05 +02:00
iwilltry42
6c94d7db3d
overall/license: update to year range -2021 2021-05-21 13:07:59 +02:00
iwilltry42
70872648b3
Revert "add --node-label flag for node create command (#584, @developer-guy, @ejose, @dentrax)"
This reverts commit 5fe8a3c6c741f1720796c11b09efec26107cb72d.
2021-05-14 13:53:47 +02:00
Batuhan Apaydın
5fe8a3c6c7
add --node-label flag for node create command (#584, @developer-guy, @ejose, @dentrax) 2021-05-10 16:58:01 +02:00
Thorsten Klein
0b7de65ebd
fix/workaround: add workaround for cgroupv2 until fixed in k3s (#579)
special thanks to @AkihiroSuda for the support on this!
2021-04-29 09:17:49 +02:00
Thorsten Klein
24cf263c73
[FEATURE] IPAM via subnet flag (#560) 2021-04-20 07:39:51 +02:00
Konrad Malik
e495fe83a8
[FEATURE] Memory Limits (#494, @konradmalik) 2021-03-29 17:52:15 +02:00
iwilltry42
601bef45d7
general: properly use variable default object labels 2021-02-09 14:57:29 +01:00
iwilltry42
58d37bea94
general: add k3d version to default object labels 2021-02-08 15:50:17 +01:00
iwilltry42
746cbcd131
node: add start time field and use it when waiting for log messages 2021-02-04 19:07:38 +01:00
iwilltry42
1c61130fdf
clusterStart: sequential and ordered node starts & nodeCreate: do not copy status 2021-02-04 19:07:36 +01:00
iwilltry42
e7c43df434
properly handle initNode and normalize waiting for log messages to determine successful node starts 2021-01-28 08:32:48 +01:00
iwilltry42
7b8506b1d9
fix: proper handling of registries and networks when deleting clusters/nodes 2021-01-19 18:53:32 +01:00
iwilltry42
7a3edd9d7e
NodeSpec: transform network string to list of strings to allow checking out node networks 2021-01-19 18:03:57 +01:00
iwilltry42
a37b01c5b9
NodeDelete: add NodeDeleteOpts 2021-01-19 14:50:34 +01:00
Thorsten Klein
c809767448
[Fix] registry: adjustments on how the registry is perceived (#454)
- LocalRegistryHostingConfigMap
  - use localhost or docker-machine as external host IP
  - fromContainerRuntime: user container-name + internal port
- registries.yaml: set up mirrors for both external and internal address
2021-01-19 08:49:42 +01:00
iwilltry42
7343c3dbe2
init merging registry config 2021-01-18 08:46:14 +01:00
Thorsten Klein
4dfb62ebff
[Feature] add LocalRegistryHostingV1 from KEP-1755 (#441) 2021-01-12 09:05:58 +01:00
iwilltry42
3fcc50b205
Merge branch 'main' into main-v4 2021-01-05 08:42:53 +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
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