docker-machine and kubernetes

3/7/2019

I've been using Docker for some time now, but I'm new to Kubernetes. One tool that I have always relied on is docker-machine, which was particularly useful to me when I wanted to create a new node in aws to be integrated in my swarm, e.g.

docker-machine create --driver amazonec2 --amazonec2-open-port 8000 --amazonec2-instance-type <instance-type> --amazonec2-region <region> --amazonec2-zone <zone>  --amazonec2-subnet-id <subnet> --amazonec2-vpc-id <vpc-id> --amazonec2-userdata <setup.sh> --amazonec2-use-private-address=true <node_name>

this command creates a new node yielding a Docker installation and other Docker-related utilities.

I am trying to do the same for Kubernetes but the above-mentioned command does not install Kubernetes tools. I suppose that I can still this command and include Kubernetes installation commands in a script given as argument under the --amazonec2-userdata, but still I wonder if there is a "docker-machine equivalent" for Kubernetes? In line with this, another question is whether docker-machine is appropriate at all to create a Kubernetes cluster on aws?

If no is the answer to both questions, then what is the appropriate approach to achieve the same goal?

Thank you

-- João Matos
amazon-web-services
docker
docker-machine
kubernetes

1 Answer

3/7/2019

Maybe what you want is here in this link: how to add an node to my kops cluster? (node in here is my external instance)

In K8s we have the config file where you set some vars like region, subnets, image, etc, since you have all set up you can just adjust the desire values and apply it the new config to your cluster.

-- cassio.moreto
Source: StackOverflow