by developer2 · 9y ago · 0 comments
The majority of information out there, including tutorials and blog articles about others' successful deployments, comes in the form of very high-level overviews. Everything I've found is an introduction to getting a basic docker instance running. There is very little useful information out there as to how to run a proper multi-host cluster.
There is core Docker. Tack on docker-machine, docker-compose, Swarm, and the dozens of 3rd-party cluster management abstractions such as Rancher - and the intensity of the headache never stops growing.
It sounds wonderful, but there is so much to learn to be able to tackle a full production stack. It's one thing to successfully launch a working cluster after hours of manual tinkering. It's a separate beast altogether to fully automate setting up a new cluster by issuing a single command, taking into account consistent configuration of: secure networking, persistent volumes with backups, deployment of container configuration and VCS codebases (ex: nginx vhosts and your code itself), etc.
My goal is to set up an entire project in such a way that there is a single suite of automation that can deploy all environments: development VM, staging, and production.
If you need any help, you are free to ping me with any queries at the email in my profile. My authority on the subject: having written a book [1] and a Udemy course [2]
[1]: https://www.packtpub.com/virtualization-and-cloud/orchestrat... [2]: https://www.udemy.com/mastering-docker/
I recently migrated a whole microservice stack of a half dozen services to OpenID connect and Kubernetes in two weeks. This is with about a year of casual familiarity and playing with Kubernetes, and the same migration to OpenID connect would have easily taken me 5 or 6 weeks to do in Amazon ECS, which is what we currently use in production.
Not to mention I can run a cluster on my three computers at home at no extra charge beyond electricity and play around for free. (See, dear, I'm not a hoarder!)
Setting up a cluster is even simpler now with tools like kops and kubeadm. Or just get one provisioned for you by Google or Red Hat with GKE or OpenShift.
I would highly recommend at the very least making it one of the solutions you try.
Yes, at least for development, setting up the entire environment must be a one-command execution. Every new developer to a team will obviously need to progressively learn the entire stack, but they should be up and running after a single VCS checkout and installation command.
I expect staging and production to be a perfect replica of the same environment developers use. As to how realistic it is to "launch the entire production cluster with a single command", with remote server provisioning, IP allocations, multiple hosts for various load-balanced pools, etc... I'll have to see when that time comes.
Terraform is designed for something close to one-command execution. You're going to have to swap in variables (e.g. AWS access keys for a particular account, domain names, IP addresses, etc.), but Terraform is designed for that. I would advise looking into Terraform Modules[0], which encapsulate this kind of work nicely.
[0]: https://www.hashicorp.com/blog/terraform-custom-providers.ht...
Beside that I want to get around HashiCorp tools, especially Vault for storing and Consul for service discovery.