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?

81

u/DevDevGoose Apr 05 '22

Forget technology like Docker and K8s. DevOps is the recognition of how software should be created and run. In the past (and still in backwards companies), development teams "built" software and then handing it over to operations teams to run. This creates a conflict where development teams want to introduce change whereas operations teams want to stop change and keep things stable. This conflict is not good for getting the most out of software.

DevOps is the cultural shift aimed at bringing these 2 viewpoints together and harmonising them for the overall benefit of the software.

As more companies have shifted away from projects and into products and there are org structures that incorporate ideas like Platform Engineering type teams, technology like Docker and K8s have come around to help streamline the process of getting working software into production safely and consistently.

It is common for companies and individuals to not really grasp what DevOps is and so co-opt the term and create job titles related to technology.

6

u/painted-biird Apr 05 '22

This is kind of in the same vein, but what is the difference between virtualization- ie using VMware to run Red Hat on my Mac- and virtualized containers à la Docker and Vagrant? I’m so confused about this (yes, I’m a total noob- only studying Unix/IT since December), because as I understand you can spin up an OS in Docker and Vagrant…

15

u/Avastz Apr 06 '22

Docker was born from the thought process of people famously saying "well it works on my machine...why don't we just ship them my machine." And they did.

Think of it as their name/logosake, shipping containers. Whatever is inside the shipping container is shipped off somewhere else, then eventually delivered, everything (theoretically) still enclosed and safe inside. That's what's going on, except it's software and the necessary pieces of an OS and other dependencies to get that software to work.

0

u/[deleted] Apr 06 '22

[deleted]

3

u/painted-biird Apr 06 '22

Hmm, b/c when I've spun up Ubuntu on Docker, it had /etc files and whatnot- I don't recall it having all the utilities that my virtualized OS had, but it had a great deal of them- which is what I think added to the confusion. As a disclaimer- I'm not really focusing on programming right now- mostly learning *nix, CLI and Bash scripting, with a VERY small amount of Python, so maybe I don't know enough about programming and development to really understand containers and their purpose. I also think I just need to play with Docker/Vagrant some more and I'll likely/hopefully learn from just fucking w/it- just kind of difficult when I'm in my late 30s, trying to finally finish my degree while learning IT and finding literally everything fascinating lol- I sincerely wish I had gotten into IT when I was a teenager or even my 20s!

Thanks for the reply, btw!

2

u/DevDevGoose Apr 06 '22

In effect there isn't really any difference between the two. They both virtualise the environment in an attempt to provide benefits like isolation between applications.

However, docker virtualises at the container level which doesn't include the OS while obviously VMs do virtualise the OS. This makes VMs much heavier to create and pass around. Containers can be spun up and discarded in seconds whereas VMs take minutes. This is important for improving the workflow in development and for scaling out to meet production performance burst requirements.

1

u/notLOL Apr 06 '22

Still confused. What are people co-opting them to mean

1

u/DevDevGoose Apr 06 '22

DevOps is the cultural shift of bringing development teams and operations team together.

Creating a "DevOps" team whose job it is to manage deployments and releases within a project that will eventually hand over to an operations team, is a complete misunderstanding of the term and its goals.

It is unfortunately common to see companies hire "DevOps people" which really means people that understand how to use Jenkins/Docker/K8s etc. The tools are irrelevant, the old job titles were fine, the point is breaking down organisational silos for the global optima.

If you just hire people who know how to use specific tools without changing how your teams are expected to work together, you won't achieve a true DevOps culture. You will only modernise your tech stack while still having problems delivering.

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!

1

u/lionhart280 Apr 06 '22

I will note one thing:

If you have a company that currently is siloed and has that proverbial wall between Dev and Ops, you can often (when applied right) look at your DevOps Engineer position as the person/people hired to bring down that wall and connect the teams together.

Most companies can't just switch to DevOps methodology overnight, so a DevOps Engineer is someone they can hire who can help them with the transition (which might take quite awhile)

Said person would be knowledgeable on best practices, tools that fit their needs, etc, and more importantly will have the task of propagating all these new skills and info to the existing teams.

So I wouldn't say its bastardized as long as there is an expectation that eventually the DevOps Engineer has a goal line they are aiming for

8

u/truechange Apr 05 '22

I'm not really a devops guy but I think it's really just a general term of how moderm server admin and deployment stuff is being done today. Docker is the most popular containerization tech used these days that's used to deploy web apps, and, Kubernetes is used to manage multiple docker containers. You don't really need this to deploy stuff unless you're scaling real big.

3

u/SquarePixel Apr 06 '22

DevOps is the idea that development and operations should not be separate. Part of realizing this is to describe everything as code: the software, the infrastructure, the process. When you do this it enables new ways of working where you can have these incredibly tight feedback/iteration cycles (that were previously considered “impossible”) where it’s no longer unusual for developers to bring new features to production on a daily basis—a true embrace of “agile”.

There are many ancillary benefits too, such as onboarding new developers; the sometimes multi day ordeal of “setting up a new dev environment” can be fully automatic. There is much more to DevOps obviously, but this is how I like to distill it.

1

u/4THOT Apr 05 '22

Docker works essentially as a container environment to maintain dependencies and a strict environment for code through virtualization. Kubernetes functions a way to scale those virtualizations across multiple machines.

If you ever want to get a hands on with this stuff you can make a pretty neat cluster out of raspberry pi's for essentially the cost a nice dinner.

DevOps is usually responsible for managing these systems.

1

u/bmw_fan1986 Apr 06 '22

On a side note — Anyone who says there’s a single DevOps Team, an org that handles DevOps, or something similar has not implemented it correctly.

It’s supposed to be a whole methodology of open communication and collaboration across development and operations teams. Toolsets help drive automation and pipeline development which assists with facilitating the implementation of DevOps. Continuous feedback loops between dev and ops is crucial.

1

u/DeusExMagikarpa Apr 06 '22

Anyone who says there’s a single DevOps Team, an org that handles DevOps, or something similar has not implemented it correctly

As a DevOps Engineer, this is true lol. Also as a DevOps Engineer, I have no idea what I do or what my purpose is, but no one else seems to know either :p

1

u/kneeonball Apr 07 '22

A mature org with a good DevOps culture could probably be more specific, and that’s where they generally have people fit into certain roles like release automation engineering, site reliability engineering, infrastructure automation engineering, etc.

But the market is full of companies that are bad at tech that wants to “do” DevOps (even though it should really be thought of as a culture) so they wanted a DevOps engineer.

1

u/kneeonball Apr 07 '22

it’s supposed to be a whole methodology of open communication and collaboration

I’d edit this to say culture of open communication and collaboration. There are methodologies that help support a DevOps culture, but DevOps is more of a culture.

Did development involve operations early on in the problem solving process? Or did they come up with their own solution and tell Ops “this is what we need, when can you get it done?”

I only make this clarification because DevOps isn’t really something you do, but it’s something you are. Just like you don’t do agile, you either are agile, or you’re not agile.

I realize there has been a push by companies to say they want to do DevOps, but it’s the same thing with companies that want to “do” agile, rather than actually make changes to be agile.