Commit Graph

177 Commits

Author SHA1 Message Date
Antoine
8f35992cff
K3S_SECRET env variable to K3S_CLUSTER_SECRET
According to this https://github.com/rancher/k3s/blob/master/README.md#L55
K3S cluster secret variable is K3S_CLUSTER_SECRET.
2020-03-28 20:37:59 +01:00
Thorsten Klein
bb7b6e3605
Merge pull request #197 from sunny0826/master
[Enhancement] judgment/error-message when specifying non-existent cluster name in start/stop/delete (thanks @sunny0826)
2020-03-19 14:05:18 +01:00
Alvaro Saurin
fb47728ddc
Option for using the local k3d registry as a proxy for the Docker Hub
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-03-13 11:18:57 +01:00
Alvaro Saurin
5b7ec7e29d
Options for using a specific volume in the registry
New --registry-volume option for using an specific volume in
the registry.

Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-03-02 13:04:48 +01:00
guoxudong
da2d541a5c add judgment for stop and start cmd 2020-02-26 15:54:07 +08:00
iwilltry42
0ec51e1318
more intuitive error message when kubeconfig couldn't be copied from container 2020-01-31 16:01:40 +01:00
iwilltry42
fdefd62687
Merge branch 'master' of https://github.com/rancher/k3d 2020-01-31 12:49:13 +01:00
iwilltry42
0b7e118046
start registry when starting/creating a cluster 2020-01-31 12:49:05 +01:00
Alvaro Saurin
2ec3efd877
New --prune option for delete
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-01-30 10:01:29 +01:00
Alvaro Saurin
840a61a47d
Do not print the /etc/hosts message if the registra name can be resolved
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-01-26 20:59:21 +01:00
Alvaro Saurin
5111fab6f9
Argument for customizing the global registries file
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-01-21 19:47:53 +01:00
Alvaro Saurin
49ff9cb0fd
Fix: do not try to write the registries.yaml if --enable-registry has not been provided
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-01-21 17:53:14 +01:00
iwilltry42
4d8876f649
add --overwrite flag for get-kubeconfig 2020-01-21 11:36:00 +01:00
Alvaro Saurin
4aff326f89
Fix the Registry detection
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-01-20 21:22:41 +01:00
Alvaro Saurin
284db4d74b
New option for starting a local registry.
A new option, --enable-registry, has been added for starting a local, private registry.
This registry will be shared between all the k3d clusters created with --enable-registry.
The registry container will be removed when the last of them is removed.

Two extra options, --registry-name and --registry-port, have been included for specifying
the hostname and port where the registry will be available.

Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
2020-01-17 20:41:10 +01:00
Thorsten Klein
7ed52c687d
Merge pull request #163 from lionelnicolas/feature/docker-labels-support
[Feature] add ability to set docker labels on worker nodes (thanks @lionelnicolas )
2020-01-17 20:18:46 +01:00
iwilltry42
7275929907
improve help text and default for --wait flag 2020-01-17 12:39:48 +01:00
Lionel Nicolas
739486e382 add support for node specifier in labels 2020-01-16 00:46:36 -05:00
Lionel Nicolas
5c5c4c54c6 fix missing "agents" node-specifier for publish ports 2020-01-16 00:43:25 -05:00
Lionel Nicolas
59224236b9 add ability to set docker labels on worker nodes 2020-01-14 08:28:52 -05:00
iwilltry42
dc4c29361f
return error if no image was specified for import 2020-01-03 15:51:28 +01:00
iwilltry42
6e05342812
Merge branch 'master' of https://github.com/rancher/k3d into feature/add-node-command 2020-01-02 14:42:12 +01:00
iwilltry42
122ea4637a
wait for kubeconfig to be written when --wait is set 2020-01-02 14:37:27 +01:00
iwilltry42
469b56c253 replace 'default' with clustername in kubeconfig 2019-11-11 11:53:22 +01:00
iwilltry42
fbe93eb039 add more verbose error messages for getKubeconfig and Delete if no flag was set 2019-11-07 15:39:31 +01:00
iwilltry42
10179f8555 add warning for when agent arg is supplied without agents being created 2019-11-07 15:28:14 +01:00
Andy Zhou
3fd1061e8c
Merge pull request #137 from M3t0r/fix-127-0-0-1-not-replaced
Fix kubeconfig not pointing to correct host when using docker-machine
2019-11-04 11:56:14 -08:00
Simon Lutz Brüggen
2205264a11 Fix kubeconfig not pointing to correct host
The kubeconfig generated by docker.io/rancher/k3s:v0.10.2 or earlier
sets the cluster.server address to 127.0.0.1. Previously this seems to
have been localhost. And we only replace localhost with the correct
address for our local kubeconfig.

The error this can lead to:
```
$ k3d --version
k3d version v1.3.4
$ docker-machine --version
docker-machine version 0.16.1, build cce350d7
$ docker --version
Docker version 19.03.1, build 74b1e89
$ k3d create
INFO[0000] Created cluster network with ID 649d6f34b84a4df16d2524f0ea0ce69cd4f964a79ae56e2a07bb1ee11d1fce50
INFO[0001] Add TLS SAN for 192.168.99.100
INFO[0001] Created docker volume  k3d-k3s-default-images
INFO[0001] Creating cluster [k3s-default]
INFO[0001] Creating server using docker.io/rancher/k3s:v0.10.2...
INFO[0001] Pulling image docker.io/rancher/k3s:v0.10.2...
INFO[0018] SUCCESS: created cluster [k3s-default]
INFO[0018] You can now use the cluster with:

export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')"
kubectl cluster-info
$ export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')"
$ kubectl cluster-info

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server 127.0.0.1:6443 was refused - did you specify the right host or port?
```
2019-11-04 17:29:39 +01:00
iwilltry42
e79c3a98d8 add init to worker as well (thanks for the hint @cbandy) 2019-11-04 09:49:22 +01:00
iwilltry42
b9ea408d49 Merge branch 'master' of https://github.com/rancher/k3d into feature/add-node-command 2019-10-21 08:12:48 +02:00
iwilltry42
6d771a20fa error exit if no clusters found 2019-10-21 07:35:07 +02:00
Thorsten Klein
1631a7b91a
Merge pull request #129 from ibuildthecloud/init
Launch containers with init (thanks @ibuildthecloud)
2019-10-19 09:21:25 +02:00
Darren Shepherd
b485682448 Launch containers with init
k3s is not a child subreaper so running k3s as PID 1 will result
in zombie processes.  Using `docker run --init` works around this
issue.
2019-10-18 22:10:44 -07:00
Darren Shepherd
645a5163d4 Only ignore get-kubeconfig error when !all
If you are writing a script to launch k3s clusters checking the exit
code of `get-kubeconfig` is an easy way to tell if the kubeconfig is
available for use.
2019-10-18 22:08:09 -07:00
Thorsten Klein
5c00056118
Merge pull request #121 from tw3n/get-kubeconfig-option-all
Enable --all flag of get-kubeconfig (thanks to @tw3n )
2019-10-10 10:49:01 +02:00
Xavier Hurst
836201611b Enable --all for get-kubeconfig 2019-10-09 21:43:51 +02:00
Cedric Kring
33c3f7cbda Use group values instead of keys for lookup 2019-10-09 19:51:24 +02:00
Cedric Kring
9b888c8216 Added support for group based node volume binds + refactoring 2019-10-09 19:35:13 +02:00
Cedric Kring
1e0aac19f6 Replace loop with simple append & spread 2019-10-05 12:30:08 +02:00
Cedric Kring
418c1887fe Allow volume binds to specific nodes with --volume src:dest@node-name 2019-10-05 11:44:45 +02:00
iwilltry42
9aa5af8d5d improve log level usage 2019-10-02 19:06:36 +02:00
Nicolas Lamirault
b5c4204303
Fix: use warningf
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
2019-10-01 14:42:28 +02:00
Nicolas Lamirault
44d6fef28c
Update: use log level instead of errorf
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
2019-10-01 10:15:24 +02:00
Nicolas Lamirault
61107ca5bf
Update: use log level
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
2019-09-28 19:58:05 +02:00
iwilltry42
95c62650fa remove unused constants 2019-09-26 08:49:26 +02:00
iwilltry42
80f5aa7d58 add todo 2019-09-26 08:40:16 +02:00
iwilltry42
1fabe118fa only allow adding worker nodes for now 2019-09-26 08:24:15 +02:00
Nicolas Lamirault
3631e65570
Update: replace log with logrus
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
2019-09-25 22:41:00 +02:00
iwilltry42
0317cc395b add --volume flag to add-node command 2019-09-06 12:12:32 +02:00
iwilltry42
f33fa2d4cc move global constants to types.go 2019-09-06 11:55:22 +02:00