Commit Graph

46 Commits

Author SHA1 Message Date
Andy Zhou
d63f7d4bf2 Rename bash command to shell
@iwilltry42 suggested to group all shell support under and single
subcommand -- shell.
2019-05-27 17:14:43 -07:00
Andy Zhou
2971dd6845 Add the ability to execute commands directly with the bash subcommand
In addition to provide an interactive shell, this patch adds the
'--command' and '-c' options to allow user to issue a command in the
context of a cluster.

For example:

$ k3d bash -c 'kubectl cluster-info'
2019-05-24 17:16:12 -07:00
Andy Zhou
4ef6710e22 Add basic bashShell() function
Add the basic frame work for supporting spawning a bash shell by cli
command.

With this change, we can spawn a bash shell in the context of a cluster

$ k3d create -n my-cluster
$ k3d bash -n my-cluster
[my-cluster] $>

// execute commands with KUBECONFIG already set up
[my-cluster] $> kubectl get pods
2019-05-24 17:16:12 -07:00
Andy Zhou
6dfb1e054b
Merge pull request #61 from andyz-dev/always-on
[Feature] Implement --always-on flag for the create command
2019-05-21 10:46:00 -07:00
Andy Zhou
b9713c4ac4 Add --auto-restart flag for the create command
When creating clusters with the --auto-restart flag, any running cluster
will remain "running" up on docker daemon restart.

By default, without this flag, a "running" cluster becomes "stopped"
after docker daemon restart.

Clusters stopped with 'k3d stop' command will remain stopped after
docker daemon restart regardless the settings of this flag.
2019-05-21 09:31:45 -07:00
Andy Zhou
3683eeb181 Deprecate the --timeout option
Use --wait <timeout> instead
2019-05-20 14:07:12 -07:00
Andy Zhou
c3c8f0d6f8 Golang format clean up
Changes made by 'make fmt'.
2019-05-16 00:02:10 -07:00
Andy Zhou
a0eb69b73e Allow the volume argument to be specified multiple times
Most k3d arguments are using in "stringSlice" style, allowing the
argument to supplied multiple times. Currently "volume" is an exception
to this style, require multiple arguments to be supplied in a single
argument, separated by comma.

This commit improve the k3d usability by improve the consistency of its
argument style.
2019-05-15 09:35:07 -07:00
iwilltry42
464d2e23c5 Offset multiplication 2019-05-14 13:13:56 +02:00
iwilltry42
107700dc98 update log messages 2019-05-14 13:12:10 +02:00
iwilltry42
a0c0c3ff9d add --api-port and --port-auto-offset 2019-05-13 09:08:32 +02:00
iwilltry42
7d6ae201e9 make node-specifier mandatory 2019-05-13 08:12:09 +02:00
Andy Zhou
32cc70b599
Merge pull request #32 from andyz-dev/publish
[Feature] Add --publish/--add-port flag for port mappings
2019-05-09 01:09:40 -07:00
Andy Zhou
4ebf34218b Consolidate the default cluster name into as single definition
To ensure all reference of the default cluster name are the same.
Not having to check for typos will make it easier to maintain.
2019-05-08 11:30:56 -07:00
iwilltry42
15b1326456 [bugfix] default name without underscore 2019-05-08 18:28:38 +02:00
Andy Zhou
f70a8b42f7 Add support for the --publish option for create subcommand
Inspired by the docker CLI, --publish take same input as docker CLI and
provides similar functions. For the k3s cluster server node, it behaves
the same as docker cli; it exports the k3d server ports to the host
ports.

Handling for worker nodes will be added in the subsequent patches.

This option can be used mutiple times for exposing more ports.

--add-port is an alias to this option.
2019-05-08 01:45:16 -07:00
iwilltry42
40fb583160 better image and version flags 2019-05-07 09:09:05 +02:00
iwilltry42
e78a548da2 [Feature] add --image/-i flag to specify custom k3s image 2019-05-06 08:13:11 +02:00
iwilltry42
942e667b24 add some comments 2019-04-29 08:19:01 +02:00
iwilltry42
6fdc1e4a70 automatically get latest k3s version tag at build time 2019-04-23 11:12:42 +02:00
iwilltry42
a26aa65782 make k3s v0.4.0 default version 2019-04-17 09:45:42 +02:00
iwilltry42
7eec5b061b use docker sdk wherever possible 2019-04-15 15:48:43 +02:00
iwilltry42
866b98c429 rename and add authors 2019-04-12 07:36:59 +02:00
iwilltry42
65b5f06bfc add server-arg and env flags 2019-04-11 14:31:46 +02:00
iwilltry42
4e477d3262 rename to k3d 2019-04-10 20:10:36 +02:00
Rishabh Gupta
29fced4ef7 Added version tags, separated command implementaitons, added wait and timeout
Signed-off-by: Rishabh Gupta <r.g.gupta@outlook.com>
2019-04-09 13:47:47 +05:30
iwilltry42
476e3de625 improve cluster handling via struct and add --all flag to commands 2019-04-09 09:16:09 +02:00
iwilltry42
845339e9da add install script 2019-04-09 07:59:30 +02:00
Darren Shepherd
68c38a104f Add ls and l alias to list
I find myself typing ls often by accident.
2019-04-09 07:59:30 +02:00
iwilltry42
fae59d652a update readme and bump version 2019-04-09 07:59:30 +02:00
iwilltry42
58a32b3003 add --all flag to every command where it makes sense 2019-04-04 09:46:03 +02:00
Thorsten Klein
a35051001a
Merge pull request #1 from ibuildthecloud/master
Improve logging of command and add help text for users
2019-04-04 09:23:52 +02:00
iwilltry42
1f417ce948 enhanced list 2019-04-04 09:19:26 +02:00
iwilltry42
8758d5b48d cleanup and add travis 2019-04-04 08:08:09 +02:00
iwilltry42
a1cdcc26c7 general purpose getClusters 2019-04-03 21:48:07 +02:00
Darren Shepherd
9bb89374ce Make get-kubeconfig scriptable and add more info at cluster create
After cluster create just print a simple command line to the screen to
help the user along.
2019-04-03 10:47:46 -07:00
Darren Shepherd
ecc6a375e2 Consolidate calls to exec.Command
Besides creating a helper method to run exec this also pipe stdout/err
from each call to the screen so that the user gets better feedback on
what is happening and why it might have failed.
2019-04-03 10:46:21 -07:00
iwilltry42
bb42d26f26 version up 2019-04-03 11:02:17 +02:00
iwilltry42
45fd9eeb6b comments, readme, default version 2019-04-03 11:01:28 +02:00
iwilltry42
5bfb3ff109 print kubeconfig path to stdout for exports 2019-04-03 10:50:06 +02:00
iwilltry42
85f2a1fa9f whoops... use functions 2019-04-03 10:38:32 +02:00
iwilltry42
609be6c84c add state and fix issues 2019-04-03 09:13:09 +02:00
iwilltry42
2f4c128545 fix extraArgs 2019-04-03 07:32:33 +02:00
iwilltry42
44479eb1da foce delete as fallback only 2019-04-03 07:30:23 +02:00
iwilltry42
d390c16dd1 create/start/stop/delete, no state yet 2019-04-02 21:45:43 +02:00
iwilltry42
3d79811839 initial version 2019-04-02 14:36:13 +02:00