Commit Graph

9 Commits

Author SHA1 Message Date
iwilltry42
ab2c54ca1d add import-image command for importing single image 2019-07-01 11:31:35 +02:00
Andy Zhou
1080c0b157 Fix up kubeconfig.yaml with --api-port host 2019-06-03 17:51:55 -07:00
Andy Zhou
de6e845abd Support docker machine for kubeconfig.yaml
The kubeconfig.yaml generated by K3S uses local host as the host name by
default. It won't work when running with docker machine.

This patch detects if the docker environment is set up with docker
machine. If it is, then replace the host name to the IP address of
the docker machine.
2019-05-29 09:09:13 -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
9f276a68f3 Add getKubeConfig()
Move the logic of retrive per cluster kube config file into
cli/cluster.go. Simplify the CLI handling code.
2019-05-24 17:16:12 -07:00
Andy Zhou
cdcc5e1de6 Add createKubeconfigFile()
Refactoring. Make createKubeconfigFile() a stand along function, so we
don't have to recreate the file every time we look up the file name.
2019-05-24 17:16:12 -07:00
Andy Zhou
1eff974064 Add getClusterKubeConfigPath()
Minor refactor. Add getClusterKubeConfigOath() to make logic reusable
for later changes.
2019-05-24 17:16:12 -07:00
Andy Zhou
01931b5894 Make list command always show all clusters. Remove --all option
It feels more natural to have the list command show all clusters by
default.
2019-05-18 22:25:24 -07:00
Andy Zhou
10c6eeeea5 Rename cli/config.go to cli/cluster.go
Config.go mainly contains functions around the cluster data structure. Rename
the file to cluster.go
2019-05-16 20:07:09 -07:00