r/learnprogramming • • Apr 05 '22

Name one programming/comp sci concept you never understood and if you understand it, try to explain it to them

Name a programming concept such as virtual functions, pointers, certain algorithms, etc that you always had a hard time understanding and why.

Someone else who reads yours and does understand it, try to explain it to them to help them learn

1.6k Upvotes

738 comments sorted by

View all comments

90

u/hehehuehue Apr 05 '22

What actually is DevOps? I get that it's a methodology but how does Docker and Kubernetes relate to DevOps? What even is Kubernetes and how does it work?

24

u/kneeonball Apr 06 '22 edited Apr 20 '22

This is a long post but kind will explain the basics of DevOps history at a high level.

If you take the original purpose of DevOps, it's not a methodology, but a culture. In companies that build and deploy some sort of software, there are traditionally two major groups at play on the tech side of things.

Developers - the people who are building the code

Operations - the people building and maintaining the hardware, networks, server infrastructure, etc.

Waterfall

When things were mainly waterfall you'd have a process that looks something like this:

  • The business would get an idea

  • They'd talk to some business analysts to get the requirements written down

  • Those requirements would get handed off to developers and they'd try to relay the requirements correctly

  • Developers develop the application(s)

  • Developers throw their app over the imaginary wall to operations and say "Here, run this in a test environment"

  • Operations tries to figure out how to run it, and often isn't involved in the planning process

  • Testers would test, and send bugs back to Dev

  • Dev would try to fix bugs

  • Deadline would come up, and developers would throw it over the wall again and say we need to run it in production

This process is full of siloed teams that are operating independently of each other and all have different goals. Developers would get mad at testers, testers would get mad at developers, operations would get mad at developers, developers would be mad at business analysts not relaying requirements right, there was plenty of blame to go around in most cases. Basically, after several months to a year or two, you'd go from idea, to deployment into production and all of these teams have barely collaborated.

There were all kinds of things that could be done better. Devs would manually deploy, operations would make network changes or patch servers and break the applications, there was mostly (or all) manual testing, so bugs would get introduced or reintroduced constantly.

Agile

The Agile Manifesto came along and we started trying to change the way we work, and it was effective at getting business analysts, developers, and testers all working together on the same team, but there was still a divide between the development and operations teams in most cases.

DevOps

Along came DevOps, which at its heart is a culture of collaboration between Development and Operations groups. They don't have to be on the same team. You don't even have to have someone called a DevOps engineer, and you don't have to be working with Docker or Kubernetes to be a DevOps organization. What it really boils down to is breaking down silos and collaborating earlier in the process.

This collaboration lead to operations helping development early on in the process with designing something that can run efficiently and effectively, and development could help with operations problems. In the past, someone manually did updates on each and every server by logging in, running the update, and checking it worked after. Maybe they got to the point where they were writing a script to do it, but it was still tedious. With Dev and Ops collaborating, this is where more automated tools came in.

Big DevOps concepts

You had automated server provisioning with tools like Terraform. No more manually building each server, or running a script to do it. Write some code for the configuration, and the tool will know how to build the server or resource for you.

You got automated configuration management tools like Puppet, Chef, Ansible, SCCM, etc. Define a configuration for a server, and let the tool automatically set the configuration on t he server for you without you ever having to log in and touch it. An added bonus, what if someone logs in and manually changes the config in an undocumented way? Well, the tool will reset it, making sure it always matches what you intended via code.

You got automated build tools, like Jenkins. No more pushing code, deploying, and hoping it works. You can automatically run tests and build the application every time a code change is pushed, in a standard way defined by how you configure it on the server. No more "The build for production only works with Bob's configuration on his machine for some reason." or anything like that.

You have automated deployment tools, like Octopus, Harness, Azure DevOps, etc. (lots to list here). Gone are the days of manually remoting into a server and copying and pasting the build artifacts over to the server.

You got better monitoring tools. Ops would generally have to figure out how to monitor the application (Application Performance Monitoring) and server, but with a DevOps culture, came tools like Prometheus (server monitoring), Data Dog, New Relic, AppDynamics, DynaTrace, etc.

Docker and Kubernetes

Then we figured out running apps inside of containers was nice, and then we had so many running in containers, that we needed to better orchestrate those, and along came Docker Swarm and Kubernetes (Kubernetes won obviously). If you think of a virtual machine and how it relates to a real machine (where we're virtualizing hardware to run multiple servers on the same set of hardware), I like to think of containers / Docker as virtualizing the Operating System. You package all the dependencies of your application with the application, so that as long as you deploy to a server that has the Docker Engine (or whatever container engine you want) on it, the app will run. In the past, this was a hard task as you had to have someone go and install all the tools necessary for running the application manually on each server. Later, we had Configuration Management tools to help with this some, but it was still a pain.

Kubernetes came along from the need to better manage all of these containers. Instead of running a single app on a single virtual machine, or several on a virtual machine, Kubernetes allows you to take an inventory of your entire data center you want added to the Kubernetes cluster, and Kubernetes can help you with running containers on your servers. In the past we had to manually decide where each server would go, where each app would run, set up all the networking for it, etc. With Kubernetes, we just tell it we want to run x instances of this container, and we want to increase the number of instances if the load on them gets too high, and Kubernetes figures out where to run them for you. In the past, if you decided you probably would need 4 servers to run your application in production, and then your app was more popular than expected, you now have to get another virtual machine ready with the right OS, give it an IP on the network, add it to the load balancer pool, deploy your app to it, and hope you did everything right so it would run. With Kubernetes, it just adds another instance wherever it thinks is best and you don't have to touch a thing.

Then you can take it a step further and go from plain old Kubernetes to a Service Mesh with something like Istio, linkerd, Consul Connect, etc.

Why the term DevOps has become bastardized

All of these tools came from a collaboration between Dev and Ops. Instead of solving their own problems separately, they solved problems together and we have vastly improved the way we build and ship software in the past 5, 10, 15+ years.

The companies that started doing this collaboration and coming up with these tools and talking about them at conferences would get other companies who weren't as good at tech wanting to do them. They'd see a company doing automated deployments as part of their DevOps culture, and that company would say "I want a DevOps engineer to build automated deployments for us." It's kind of bastardizing the core of the DevOps movement, because usually what these companies do is take two silos, Dev and Ops, and add a 3rd silo and call it DevOps. The whole idea is to remove silos and work together, not add another silo, but it is what it is. The DevOps engineer has been created and it's usually a term for someone who does release automation engineering, or infrastructure automation engineering (or both). In a perfect world, we'd still consider all of these Ops jobs separately, but companies that don't know any better use DevOps as a catch-all term for trying to improve what they do without solving the real problem to begin with.

This was a high level overview of a lot of concepts, and most of them probably won't make sense right away, but take it one piece at a time. Listen to some talks like what I have linked below and you'll start to get a better grasp on it. The guy in the video is coming at it from an Ops perspective mostly as he runs operations teams, but does a great job of explaining the dynamic of why a DevOps culture is helpful.

https://www.youtube.com/watch?v=qLUt6bwNnks

TL;DR: DevOps is a culture, not a methodology, but companies that don't know what they're doing have created the term DevOps engineer and think it's a thing that you do because they aren't good at building software. So even though a DevOps engineer shouldn't exist in theory, it does and it could mean a lot of different things.

Edit: Sorry for any small mistakes or anything, was late at night when I typed this.

2

u/tefloon5 Apr 06 '22

Not OP, but thank you so much for the great answer which clarified a lot of confusion I had about the "container" technology as well as DevOps!