11 ms·
Docker, Kubernetes, Terraform, and AWS crash course series
- BossingAround 4y agoKubernetes must probably be one of the most tutorialized pieces of SW out there. You want a "crash course" on the platform of your choice? You got it. You want it for the price of your choice? You got it. The docs are great [1] and offer even interactive parts [2]. There are a ton of good materials on youtube. There are Coursera and EdX courses, e.g. [3] from Google and [4] from Red Hat. There are a ton of Udemy courses, e.g. [5]. I'm not even going to mention sites like Pluralsight (which now owns CloudGuru and CloudAcademy). I'm not even mentioning books on advanced Kubernetes and service mesh topics. I wonder what drives someone to write a 101-level tutorial on K8s. In my mind, there's such an overload of information on the topic that it must get lost among the greats. [1] https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/ https://kubernetes.io/docs/concepts/overview/what-is-kuberne... [2] https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive/ https://kubernetes.io/docs/tutorials/kubernetes-basics/creat... [3] https://www.coursera.org/specializations/architecting-google-kubernetes-engine#courses https://www.coursera.org/specializations/architecting-google... [4] https://www.coursera.org/specializations/cloud-native-development-openshift-kubernetes https://www.coursera.org/specializations/cloud-native-develo... [5] https://www.udemy.com/course/learn-kubernetes/ https://www.udemy.com/course/learn-kubernetes/
- rawoke083600 4y agoTo be fair. Just last night i was googling kubernetes and k3s tutorials. All of them on page 1 of SERPS are super simple and brilliant and ONLY show you how to add nodes to clusters. Ok now what ?? Ive drank the k-Koolaid signup for the newsletters but how do i get value from this 'thing' ??? When i code a webapp how do setup/config the db ? How do I do a regular LAMP app ? Lol i never thought i say this but i need a kubernetes tutorial on 'best practices' for common patterns. No for google scale but how do i kubernetify my run of the mil lamp app with 100kpage views a month ?? There seems to be a gap between the beginner and advance (kubernetes all things) levels ? Maybe that is the answer ?? The fact that the middle-situations(lamp apps with low-med traffic) tutorials dont exists means i dont need it ??
- ancieque 4y agoI would recommend Bret Fisher tutorials https://www.bretfisher.com/ https://www.bretfisher.com/
- vbezhenar 4y agoAll you need exists on kubernetes.io. Start with https://kubernetes.io/docs/tutorials/hello-minikube/ https://kubernetes.io/docs/tutorials/hello-minikube/ and proceed. Read reference documentation on the same site whenever you need to dig somewhere. It's awesome. You don't need any other websites. I was able to build a kubernetes cluster and right now deploying multi-service application and I have had enough technical information on this website alone. As to answer your questions: You can start with DB as an ordinary container in a statefulset deployment. It's similar to docker. You configure it with environment variables. Advanced approach is operators, but you don't need those for simple start. Connection to DB is the same like docker. You use Kubernetes secrets instead of docker secrets and that's about it. My message assumes that you're proficient with docker. If you're not, I suggest to first learning docker. May be you don't need Kubernetes for your scale at all. And if you do, most docker concepts make sense in Kubernetes anyway.
- rawoke083600 4y agoCool thanks will have a look. Id be more interesting on where kubernetes (redundancy) fits into traditional redundancy ? Examples: 1. Do i still need gluster/ceph or do i use the longhorn thing ? 2. Db replication? Do i use the usual solutions of master-slaves and clusters or does multiple k-nodes take that over ? 3. Webserver LB with failover ? Do i use LB from hosting vendor, haproxy or does kubernetes have its own thing ?? From what I can tell as a kubernetes-noob the value is: 1) Reproducibility 2) Reliability via redundancy 3) AutoScaling. All of the abkve has to some degree a previous/current solution , so which do i give up/replace with kubernetes-tool ? Sorry yes Im a k-noob
- timhaak 4y ago1 It depends. For larger scale gluster or ceph. But quiet a bit more work. Longhorn you can get up and working quickly. Though if you are on a cloud provider just use their storage system. 2 K8 doesn't magically solve replication unfortunately. Though there are helm charts that will automatically set up a replicated setup for you. I still need to solve backups. Once again if you are on a cloud provide. Just use their Db offering. 3 K8 doesn't have a default out of the box. The repo shows you how to setup traefik to handle this. On cloud providers they have normally integrated it with their lb already. For me the large advantages are reproducibility and no vendor lock in. Also give redundancy and quiet a bit of automation once set up. Auto scaling is always tricky. Lastly if you have the skills it can be far cheaper to run your own in metal. If you don't the the time most likely would be better spent actually coding. Depending where you are in the world and the relevant pay scales.
- starkd 4y agoThis is no doubt a useful commment, since you provide other sources. However, it's not particularly a mark of courtesy to denigrate others' contribution to the space. If you had substantive criticism of the OP offered tutorial, it might be helpful. However, you offer none.
- BossingAround 4y agoI can see your point. Thanks for your comment, I'll try to restate my point next time.
- brikis98 4y agoAuthor here. I tried to answer your question in the first two paragraphs. But to add some context, given the nature of my work, I hear from developers on a nearly daily basis who are struggling to get started with the technologies mentioned in this blog post series, which include not only Kubernetes, but also Docker, AWS, and Terraform. In part, they are struggling because they are too scared to ask for help, and comments like yours only make that worse: you seem to be implying that the materials out there for Kubernetes are so good, that if you don't get it, there must be something wrong with you. And yet, there are thousands of devs who don't get it, so maybe for different people, there are different ways to learn? In discussions like this, I'm a fan of what Steve Yegge wrote about blogging [1]: > This is an important thing to keep in mind when you're blogging. Each person in your audience is on a different clock, and all of them are ahead of you in some ways and behind you in others. The point of blogging is that we all agree to share where we're at, and not poke fun at people who seem to be behind us, because they may know other things that we won't truly understand for years, if ever. That's why I write: to share what I know, from my particular perspective. Hopefully, that's useful to some people out there. If it's not useful to you, no problem! And for the record, I agree the Kubernetes docs are great, including those interactive tutorials: if you read the series, you'd see I actually recommend those exact docs at the end of the post [2]. [1] https://sites.google.com/site/steveyegge2/you-should-write-blogs https://sites.google.com/site/steveyegge2/you-should-write-b... [2] https://blog.gruntwork.io/a-crash-course-on-kubernetes-a96c3891ad82#8240 https://blog.gruntwork.io/a-crash-course-on-kubernetes-a96c3...
- waynesonfire 4y agoI just don't want to do that, no thanks. I've spent so much time learning about how an OS can solve these problems and these lessons have paid dividends many times over my career. Instead, I will continue to invest in the core foundation. I'm not interested in re-learning these abstractions reading [1]-[5] tutorials plus many more and studying an unrefined, new layer of complicated abstractions built on top of the OS--the OS is difficult enough. I'll only _use_ k8s when it's managed and supported by a team of 10+ engineers, which is what it requires. Plus, it's not just k8s; you have concourse, spinnaker, artifactory, some sort of cluster templating, kops? to template your k8s deployments across DCs and environments, (I don't know what the community uses, we built our own in-house tool). It's all so gross. My rejection of these systems has lead me to invest in FreeBSD. There was a learning curve and I'm certainly not as fluent in this system as I am with Linux but I'm in a place where I'm in control of the OS and have at my disposal solid, refined tools to help me masterfully construct the infrastructure to solve my problems. And, every time I solve a problem in this space my foundational understanding grows and these lessons will pay dividends into the future, or so I hope. I'm utilizing FreeBSD because docker / k8s and I'll add systemd to the list, are missing and thus the community solves problems in a different way that better aligns with my values. FreeBSD isn't easier, I've been stumped on problems countless numbers of times but when I find a solution, it scales. What I mean by that is I have a better understanding of a system that can solve a larger class of problems than if I was in the docker / k8s ecosystem. YMMV.
- BossingAround 4y agoThat sounds like a bit of an extreme reaction to what seems to be a "this technology is yucky and I don't like it" problem.
- waynesonfire 4y agoNo, you're way off. Maybe my reaction is extreme, but my problem isn't. What's yucky is that you're trying to convince people that reading five tutorials on k8s will make them productive. No, the problem, and I'll repeat it since you conveniently skipped over it, k8s requires 10+ engineers to maintain and manage, full time. _I_ don't have 10 engineers and thus it's the wrong tool for me and I've decided to not invest in it.
- TuringNYC 4y ago>> I wonder what drives someone to write a 101-level tutorial on K8s. When I was going thru k8s tutorials several years ago, one issue was how quickly the tutorials became outdated with changes in k8s. Then you'd spend only half your effort on the the tutorial, and the other half debugging why the tutorial wasnt working.
- throwaway894345 4y agoSadly last I checked there were relatively few tutorials for setting up on bare metal (or rather, they neglect important topics like setting up net worked volumes or other things that are very likely to be required by an application.
- krembanan 4y agoI think that for the average developer, these tools will soon be obsolete. For frontend applications, hosting services such as Vercel and Netlify gives a far superior DX. For backend, Vercel does the same, or other BaaS' like Supabase that gives you most you would need to create a fully fledged app with easy to use API's. The only downside I can tell, is the pricing, but compared to dev hours saved, it's probably a net benefit.
- chii 4y ago> The only downside I can tell, is the pricing, but compared to dev hours saved, it's probably a net benefit. dev hours is already paid - i say that a hosted service for an app is gonna cost even more than the dev in the long run.
- krembanan 4y agoYou pay a premium to let your devs work on what matters, the actual product, not tinker with devops tools for hours on end on something that has already been solved. Something to keep in mind is that infrastructure code has to be updated and maintained as well, with services that gets handled for you. It would be interesting to see how much of a difference in price it would make over eg. a year.
- chrisandchris 4y agoI can give you the answer: it depends. I'm hosting at a colocation for X bucks a month. Solely the RAM I have on my servers costs X bucks a month at AWS/Azure. Maintenance overhead is small, maybe a couple hours a month.
- eandre 4y agoThe difficult with backend is dealing with state. It's easy enough to provide a simple experience when dealing with stateless frontends, backends are a very different story. You're right that we need better tools. I'm the founder of Encore [1] which is all about bringing the simplicity of Vercel/Netlify to backend development. Not by substituting the backend for a BaaS but by building a developer experience hand-crafted for dealing with cloud infrastructure. [1] https://encore.dev https://encore.dev
- pdimitar 4y agoOr better phrased: "How to get inclined to slash your own wrists". Jokes aside, I'll give it a go, I do need some advanced Docker topics lately and I am sure Kubernetes can help me with some of my home-hosted services as well.
- k8sToGo 4y agoAs a Devops engineer I'm staying away from Kubernetes at home. It would require too much constant maintenance. I use docker only. I get to play with kubernetes enough at work.
- pdimitar 4y agoYeah, I tend to peak at Docker Compose and dare not tread further. I might actually learn systemd management of services and stop there. I've worked in orgs where k8s worked great but most of the time it just made everyone curse their lives.
- tootie 4y agoWhy use k8s and AWS instead of ECS?
- k8sToGo 4y agoBecause then your endpoint is the standardized kubernetes rather than ECS. Also I don't think you can use Kubernetes logic with ECS Finally I think with ECS you have quite the vendor lock in.
- tootie 4y agoHaving deployed Dockerized services to ECS and Azure App Service, doing it from scratch twice is still easier than figuring out k8s.
- k8sToGo 4y agoIf you don't know k8s, sure. But if you have someone who does, EKS makes more sense.
- bmcfeeley 4y agoSure, but -- if you're reading tutorials to learn yourself enough k8s to do damage, as provided in the link we're commenting on -- you don't know k8s. Parent is a reasonable question for this thread.
- roflyear 4y agoYou can host your kubernetes cluster anywhere. Or multiple places (as in you can host both at azure and AWS or your own data center and Google etc). I'm not a fanboy of kubernetes, I think it makes some really trivial things stupidly complex, but avoiding vender lock in is huge. It can be massively better but oh well.
- crowquill 4y agoI like and use ECS, but it lacks the tooling and ecosystem around Kubernetes.
- varispeed 4y agoHow do you deal with cloud anxiety? I've been always using bare metal servers, because I am afraid that when I set something up wrong on AWS I'll become bankrupt. When I had a few services running on AWS I often would wake up at night having a nightmare that my keys got stolen and someone run thousands on my account. After a few weeks like that I deleted everything from AWS. I have an account on GCP as I had to learn few things for my work assignment and I forgot to delete the setup - anyway a few months later I got an email that Google can't bill my account. I almost got a heart attack and then I noticed they couldn't bill $0 and my card simply expired - imagine the relief. When I wrote this I can see that maybe sounds stupid, but I have genuine fear of running anything on AWS, GCP or Azure etc. Another fear I have is that if I put a website online, someone could run a script to fetch content forever and make me pay huge bandwidth costs. When I last checked, there is no way to put any sort of caps e.g. when bandwidth cost exceeds certain amount it would deactivate the buckets etc. So what would you do? Nowadays very much every job lists knowledge of AWS as a requirement, but I can't get myself past the fear.
- jiggawatts 4y agoFor training purposes, Azure has cost-limited subscriptions. Frustratingly, the other clouds have dragged their feet and largely refused to implement their own equivalents. This comes up here semi-regularly as one of the #1 complaints about the public cloud, and it's always hand-waved away by some Silicon Valley FAANG employee making half a million a year and using their parent company cloud account. I know of several ways it would be possible for a malicious actor to deliberately bankrupt a solo dev limited to a normal credit card budget. And as you've said, it's very fiddly and complicated to implement custom "stop" scripts, and this is futile anyway because the billing metrics in all clouds have huge delays on them. My $0.02 is try to learn using Azure first because there's a true safety net, and then use customer accounts to continue upskilling.
- user432678 4y agoCan completely relate to your situation. Basically, that’s the main reason I run everything on bare metal server, running in my basement. And use cloud providers only if my clients ready to pay for it or take risks.
- lakomen 4y agoOh boy... Guys and gals, learn the basics. You don't need Docker, just a version control system (e.g. git). You don't need overpriced cloud offerings in the first place. First of all, pick the right language. For me, that's Go, because it has lots of performance for little resource usage. Docker is written in Go. Why would I put a Go proxy in front of my Go program to have nothing but what's essentially a zip file with some startup script and then have to fight the Go proxy, Docker, and its configuration. Learn about systemd. It's the defacto standard init system for most popular Linix distros nowadays. Terraform? Ansible if you must. If you're managing more than 1 host maybe you do, but it's likely you don't. Or pick something like NixOS if you just have to define your machine state. AWS (and GCP, etc)? A, one, dedicated server where you can host all the projects your heart desires for a fixed price with low costs for bandwidth/traffic. Kubernetes, you do not need it. Go can handle about 500 million visitors a month on 12 year old hardware per 1 server. You will almost certainly not reach these numbers. So you don't need much to live a stress free and cheap but efficient life. What this article tries to teach you is how to become a tool for public cloud providers. Running k8s requires at least 9 servers. Managed k8s, like those cloud providers offer are expensive, because even if you think it isn't so, the devil is in the details. I see that guy posting of how easy it is. BS. Nothing is easier than a single host with a front proxy like nginx, which btw k8s also uses, they call it ingres proxy, a simple nginx config, some letsencrypt, your Go backend and the database on the same server. It doesn't get easier. What this article tries to teach you is stuff you will only ever need if you expect over 5k concurrency (note that's not 5000 users). When do those situations occur? Eurovision Song Contest. Very popular chat app (but even there you'd not use http). You don't need all this. And you also don't need microservices. Monoliths are fine. When are microservices useful? When you need to scale particular components of your big program. Is it worth the trouble? Hell no. Especially because now you have to deal with a problem so huge with very little benefit to going the event driven microservice route, because that's the only route that matters regarding microservices. And that's the only, ONLY time k8s makes sense. That's also where you can afford to pay those ridiculous prices for cloud traffic and managed k8s. Those are multilateral enterprise levels of business size, ok? Forget all that crap. In these comments you'll find people trying to BS you to get hyped for their product, promising "there will be only one". It's all BS. Just learn the basics. It's not hard. Disclaimer: truly failsafe setups should run on 3 servers (hn runs on 2 and has regular downtime). So if you have a money maker of course do that. But until then even a single server setup with regular backups will do just fine.
- oxff 4y agoAll these "you don't need X / Y / Z" points critically miss the point that it's irrelevant when that is what the companies hiring people want anyway.
- cloudyporpoise 4y agoCompanies hiring the people probably also have a need if they are hiring and looking to grow and scale out. I made a "you don't need X / Y / Z" point because I strongly believe most people don't need these tools and really need a better understanding of Linux basics. You can also learn these tools on your own if they're mentioned in job descriptions of jobs you're applying for, but that doesn't mean you have to use them when you're the decision maker, or for a personal project.
- oxff 4y agoUsing these tools in personal projects is how you learn them though, so you can talk about your experience, and maybe even show some prototype in an interview / CV etc.
- davewritescode 4y agoI can’t think of a worse way to manage Kubernetes than Terraform. After years of running into issues, I think it’s really only suitable for small clusters. ClusterAPI has been the way my company has been doing things lately and I can honestly tell you it’s been transformative. https://github.com/kubernetes-sigs/cluster-api https://github.com/kubernetes-sigs/cluster-api There’s nothing more amazing that updating a kubelet version in a git repo and watching ClusterAPI carefully cordoning off nodes and moving our workloads to new machines while I sit back and watch via ArgoCD.
- MuffinFlavored 4y agoHow does ClusterAPI compare to Helm charts (or just managing Kubernetes YAML manually or through Kustomize?) Why do you need clusterctl / clusterawsadm? Can't you just kubectl apply once you have your .kube/config set up for your AWS k8s cluster (or Azure or GCP or whatever)?
- dilyevsky 4y agoCluster API is just CRDs to manage cluster infrastructure itself. Clusterctl and co is to manage controllers that reconcile said CRDs
- MuffinFlavored 4y ago> CRDs CustomResourceDefinition for anybody else following along https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/ https://kubernetes.io/docs/concepts/extend-kubernetes/api-ex...
- davewritescode 4y agoCluster API allows you to create clusters with helm charts. We use ClusterAPI + a centralized ArgoCD to push our clusters that’s other teams can use but with all the required add-ons that the business says we need like security tooling and policy management.
- technocraftk 4y agoI recommend https://kubelabs.collabnix.com https://kubelabs.collabnix.com for Kubernetes, https://dockerlabs.collabnix.com https://dockerlabs.collabnix.com for Docker tutorials. The community also maintains https://kubetools.collabnix.com https://kubetools.collabnix.com that is highly useful.