Latest / CyberSecurity Summary / Hands-on DevOps with Linux: Build and Deploy DevOps Pipelines Using Linux Commands, Terraform, Docker, Vagrant, and Kubernetes
Transcript
- 0:00Speaker 1: Welcome to the deep dive. Okay, so you've given us
- 0:04Speaker 1: this really dense stack of sources. It looks like it
- 0:08Speaker 1: takes us right from the basics the core of a
- 0:11Speaker 1: Linux server all the way up to managing stuff across
- 0:14Speaker 1: multiple clouds.
- 0:15Speaker 2: Yeah, that's the idea.
- 0:16Speaker 1: So our mission today it's pretty simple. We're giving you
- 0:19Speaker 1: the shortcut. We're not going to wade through, you know,
- 0:21Speaker 1: setting up servers by hand, definitely not. We're cutting straight
- 0:24Speaker 1: to the strategic stuff, the why and the how of
- 0:27Speaker 1: real DevOps automation exactly.
- 0:29Speaker 2: This deep dive it really tracks a huge shift in
- 0:32Speaker 2: it thinking. I mean, we're moving from system admins clicking
- 0:36Speaker 2: through installs one by one the old way right towards
- 0:39Speaker 2: a true DevOps model, and that's all about speed, being
- 0:42Speaker 2: able to audit everything, and well collaboration. The main thing
- 0:45Speaker 2: is breaking down those old walls using automation to get
- 0:47Speaker 2: things delivered faster and crucially reliably.
- 0:51Speaker 1: Okay, so we'll start with the basics, the foundation links, fundamentals,
- 0:54Speaker 1: and then pretty quickly ramp up towards infrastructure as cotatchies, containers, Kubernetes,
- 0:59Speaker 1: and and multi cloud strategies.
- 1:01Speaker 2: Think of it as your quick start guide. We want
- 1:04Speaker 2: you to get the whole picture, focusing on the insights
- 1:06Speaker 2: you really need, not all the low level detail.
- 1:09Speaker 1: Got it, Let's dive in app Okay, let's start right
- 1:12Speaker 1: at the beginning. Then Linux it's open source, which means
- 1:17Speaker 1: lots of different versions. Right, Distributions are distros.
- 1:19Speaker 2: Yep created by different groups, companies, communities.
- 1:23Speaker 1: So what's the like the strategic difference when you're choosing
- 1:25Speaker 1: between the big ones.
- 1:27Speaker 2: Well, it really boils down to risk versus reward, especially
- 1:30Speaker 2: around support. So on one side, you've got Red Hat
- 1:34Speaker 2: Enterprise Linux RHL, that's your corporate choice, the subscription model.
- 1:38Speaker 1: You pay for it.
- 1:39Speaker 2: You pay, but you get guaranteed support, stability that's certified,
- 1:42Speaker 2: and this is important compatibility with their enterprise software like
- 1:47Speaker 2: JBoss and stuff.
- 1:48Speaker 1: Okay, stable, supported, predictable exactly.
- 1:51Speaker 2: Then on the other side you have things like Debian
- 1:53Speaker 2: and it's very popular derivative Ubuntu. These are fully community maintained,
- 1:58Speaker 2: so free as in cost, yes, maximum freedom. But you know,
- 2:04Speaker 2: if something breaks, you're leaning on the community forums, mailing lists.
- 2:08Speaker 2: The fix isn't guaranteed on a deadline.
- 2:10Speaker 1: It's that classic trade off then, paid certainty versus free
- 2:15Speaker 1: community efforts precisely. Okay, So once you've picked your OS,
- 2:19Speaker 1: we're talking about putting it on a server. And the
- 2:21Speaker 1: sources remind us a server is really just a powerful
- 2:24Speaker 1: computer doing a specific job, like hosting a website or
- 2:29Speaker 1: running a database.
- 2:30Speaker 2: That's all it is. And when you pick the software
- 2:32Speaker 2: for that job, you're defining what we call a stack.
- 2:35Speaker 1: A stack like a set of tools to solve a
- 2:37Speaker 1: particular problem.
- 2:37Speaker 2: Right, you define the solution by the tools you choose.
- 2:40Speaker 2: Everyone knows the classic LMP stack, right, Linux, APATCHEQL, PHP.
- 2:44Speaker 1: The original workhorse totally.
- 2:46Speaker 2: But modern stacks are way more varied. The sources mentioned
- 2:49Speaker 2: one NPM and Jinx as the web server, piping for
- 2:53Speaker 2: the application itself, and Mango dB for the database, different
- 2:57Speaker 2: tools for different needs.
- 2:58Speaker 1: And the last bit of this foundation, where does the
- 3:00Speaker 1: server actually live? We're shifting here too, aren't we, from
- 3:03Speaker 1: on premise to cloud big shift on premise.
- 3:06Speaker 2: That meant the servers were physically inside the company in
- 3:10Speaker 2: their own data center, maybe even under someone's desk.
- 3:13Speaker 1: Huh hopefully not, hopefully not.
- 3:15Speaker 2: But they own the hardware, the cooling, everything. They manage
- 3:19Speaker 2: their own virtual machines too, maybe using tools like open stack.
- 3:22Speaker 1: Or overt right at the cloud.
- 3:24Speaker 2: Cloud just means those virtual servers are running on someone
- 3:27Speaker 2: else's hardware in a third party's huge data center think AWS, Azure, GCP.
- 3:35Speaker 1: And the big advantage there.
- 3:36Speaker 2: Elasticity and cost. Mostly you can spin up resources when
- 3:40Speaker 2: you need them and crucially turn them off when you don't,
- 3:43Speaker 2: like overnight or weekends. You only pay for the run
- 3:46Speaker 2: time and storage you actually consume. That can be a
- 3:48Speaker 2: massive cost saving for organization.
- 3:50Speaker 1: Makes sense. Pay for what you use. Yeah, all right,
- 3:53Speaker 1: so we have our servers maybe in the cloud, but
- 3:55Speaker 1: once you get more than a handful, doing things manually
- 4:00Speaker 1: just breaks down right immediately.
- 4:01Speaker 2: It doesn't scale. That's where automation becomes absolutely essential. And
- 4:04Speaker 2: the first tool pretty much everyone learns is Bash.
- 4:07Speaker 1: Bash the command line.
- 4:09Speaker 2: Yeah, the command line interpreter, but it's also a scripting language.
- 4:11Speaker 2: It's the system admin's Swiss army knife, you know, great
- 4:15Speaker 2: for automating simple repetitive things like whati oh, rotating log files,
- 4:19Speaker 2: checking if disk space is low, restarting a service, quick,
- 4:23Speaker 2: imperative commands.
- 4:24Speaker 1: Imperative. That's the key word here, isn't it. Bash tells
- 4:27Speaker 1: the system how to do something step by step.
- 4:29Speaker 2: Exactly. Step one, do this, step two do that.
- 4:32Speaker 1: But if you're trying to set up say fifty identical
- 4:34Speaker 1: web servers, writing a Bash script for that gets complicated fast.
- 4:39Speaker 1: You're downloading ISO images, figuring out disc allocation.
- 4:43Speaker 2: Oh yeah, dynamic allocation for your test lab maybe, but
- 4:46Speaker 2: fixed size for production so you don't accidentally fill up
- 4:49Speaker 2: the whole storage system. It's slow, it's prone to errors.
- 4:53Speaker 2: That whole pain point is really what led to infrastructure
- 4:55Speaker 2: as card I see. Absolutely nobody wants to sit there
- 4:59Speaker 2: manually prove visioning one hundred vms every day. IC is
- 5:02Speaker 2: the answer for the provisioning part, setting up the infrastructure itself.
- 5:06Speaker 2: It goes way beyond just simple task scripting.
- 5:09Speaker 1: So tools like Vagrant come in here.
- 5:11Speaker 2: Vagrant is often the first IC tool developers meet. Instead
- 5:15Speaker 2: of you know, clicking through all the virtual box setup screens,
- 5:18Speaker 2: defining memory disk size, enabling virtualization in the bios. Yes,
- 5:23Speaker 2: you just write a simple configuration file code. Vagrant reads
- 5:27Speaker 2: that code, talks to virtual box, and automatically builds the
- 5:30Speaker 2: VM for you. It usually uses pre built OS images
- 5:33Speaker 2: they call them boxes from places like Vagrant Cloud gets
- 5:36Speaker 2: the BASEOS installed instantly.
- 5:38Speaker 1: Okay, so that's a huge leap. We've gone from telling
- 5:41Speaker 1: the computer how to run each step with Bash to
- 5:44Speaker 1: just declaring what we want the end result to look
- 5:46Speaker 1: like with Vagrant and IIC.
- 5:48Speaker 2: That's the core philosophical shift. It makes the whole process repeatable, consistent,
- 5:52Speaker 2: and auditible. If your code says you need three gigs
- 5:55Speaker 2: of RAM, you get three gigs of RAM every single
- 5:57Speaker 2: time nopes I click the wrong button.
- 6:00Speaker 1: Automation is getting serious now, but we can accelerate even more. Right.
- 6:03Speaker 1: Moving beyond full virtual machines to containers, let's talk Docker.
- 6:08Speaker 1: People often call it lightweight virtualization. What's actually happening under
- 6:11Speaker 1: the hood in Linux?
- 6:12Speaker 2: Yeah, lightweight's a good description. Fundamentally, a container is about
- 6:15Speaker 2: isolating processes and their filesystems. Think of it like an
- 6:19Speaker 2: advanced version of an old Linux command crut. It creates
- 6:23Speaker 2: a sort of walled off directory that acts like its
- 6:26Speaker 2: own little OS.
- 6:27Speaker 1: Install walled off.
- 6:29Speaker 2: Yeah. It uses Linux kernel features control groups name spaces
- 6:33Speaker 2: to keep the container's resources. It's network traffic, it's view
- 6:36Speaker 2: of the filesystem separate from the host and other containers.
- 6:40Speaker 2: That's what makes it so portable. Everything the app needs
- 6:43Speaker 2: is bundled inside Okay, so let's.
- 6:45Speaker 1: Walk through an example. Say we're developing a simple web
- 6:48Speaker 1: app and Python using the Flask framework. How does the
- 6:51Speaker 1: whole container ecosystem build up around that to make it
- 6:54Speaker 1: ready for production?
- 6:55Speaker 2: Right, So you start coding with Flask, but flask itself
- 6:58Speaker 2: it even warns you it's built in server is just
- 7:00Speaker 2: for development. It's not tough enough for real traffic.
- 7:03Speaker 1: Okay, so step one need a better.
- 7:05Speaker 2: Server exactly for production. You need a proper WSGI server
- 7:10Speaker 2: that stands for a Web Server Gateway interface. It's a
- 7:13Speaker 2: standard way for Python web apps to talk to web servers.
- 7:16Speaker 2: Guncorn is a really popular one.
- 7:18Speaker 1: Gunnacorn handles the Python part robustly, but you still need
- 7:21Speaker 1: something to face the public internet right to handle all
- 7:24Speaker 1: the incoming connections.
- 7:26Speaker 2: You got it. You need a traffic cop out front
- 7:28Speaker 2: reverse proxy precisely. Typically you'd use something like in jincs.
- 7:32Speaker 2: Jinx is fantastic at handling tons and tons of simultaneous connections.
- 7:37Speaker 2: It does a few key things. It can load balance
- 7:40Speaker 2: traffic if you have multiple guncorn.
- 7:42Speaker 1: Workers, spreads the load yep.
- 7:44Speaker 2: It can also cash static files your images, CSS, JavaScript.
- 7:48Speaker 2: That stuff doesn't need to hit the Python app every time,
- 7:51Speaker 2: and jinc serves it directly, which is super.
- 7:54Speaker 1: Fast, takes load off the application server exactly.
- 7:56Speaker 2: It only forwards the request that actually need dynamic processing,
- 8:00Speaker 2: like fetching data from a database back to Gunnicorn. This
- 8:03Speaker 2: massively reduces the CPU load on your application servers and
- 8:06Speaker 2: makes everything much faster and more responsive.
- 8:09Speaker 1: Okay, so now we have this perfectly packaged production ready
- 8:12Speaker 1: container with then Jenks and Gunnicorn and our app. But
- 8:16Speaker 1: one container isn't usually enough, is it? What happens when
- 8:19Speaker 1: we need hundreds running across lots of physical machines, Doctor
- 8:22Speaker 1: swarm maybe isn't.
- 8:23Speaker 2: Quite enough right at that scale, you need serious orchestration.
- 8:27Speaker 2: You need Kubernetes K eight's the eight hundred pound Gorilla
- 8:31Speaker 2: pretty much. It's the standard now originally based on Google's
- 8:35Speaker 2: internal system called Borg. When you're managing hundreds, maybe thousands
- 8:39Speaker 2: of containers, the real challenge is maintaining the state you want. Declaratively,
- 8:45Speaker 2: you tell Kubernetes I want five copies of my web
- 8:47Speaker 2: server running and it makes it happen.
- 8:49Speaker 1: How does it manage that? What are the key concepts
- 8:51Speaker 1: we need to grasp?
- 8:52Speaker 2: Okay, three key objects to start with. First is the pod.
- 8:56Speaker 2: That's the smallest thing you can employ in Kubernetes. It's
- 8:58Speaker 2: basically one or moreiners that are always scheduled together, run
- 9:02Speaker 2: on the same node, and share resources like networking and storage.
- 9:05Speaker 1: So a pod might have my Jinx container and my
- 9:08Speaker 1: Gunicorn container running.
- 9:09Speaker 2: Side by side exactly. Then you have the deployment. Think
- 9:12Speaker 2: of this as the rulebook for your application. It defines
- 9:15Speaker 2: how many copies or replicas of a pod you want
- 9:18Speaker 2: running at all times. If a pod crashes, the deployment
- 9:21Speaker 2: controller notices and starts a new one automatically to get
- 9:24Speaker 2: back to the desired.
- 9:24Speaker 1: Number self healing. Nice. Okay, pods are the runners, deployments
- 9:29Speaker 1: are the rules. What's the third piece? How do users
- 9:32Speaker 1: actually reach these pods? If they can come and go?
- 9:35Speaker 2: Ah, that's the service. Pods are ephemeral, right, They can
- 9:38Speaker 2: be destroyed and recreated, and they'll get new internal IP addresses.
- 9:42Speaker 2: You can't rely on those ips. A service provides a stable,
- 9:45Speaker 2: single point of contact. It maps a fixed IP address
- 9:49Speaker 2: maybe an internal cluster IP or an external load balancer IP,
- 9:53Speaker 2: to the group of pods managed by a deployment.
- 9:55Speaker 1: So the service acts like a permanent front door even
- 9:58Speaker 1: if the rooms behind it keep changing.
- 10:00Speaker 2: Perfect analogy. It ensures traffic gets to healthy pods, enabling
- 10:04Speaker 2: real scaling and resilience without users noticing pods restarting.
- 10:07Speaker 1: Okay, it makes sense, But now we have potentially thousands
- 10:10Speaker 1: of these pods spitting out logs across maybe hundreds of servers.
- 10:14Speaker 1: Checking logs manually is.
- 10:15Speaker 2: Impossible, utterly impossible. Forget tailing log files at this scale.
- 10:19Speaker 2: You need centralized logging instantly, and.
- 10:20Speaker 1: That's where the efkstack comes in.
- 10:22Speaker 2: Yeah, EFK, elastic Search, Fluent, and Cubana. It's pretty standard
- 10:27Speaker 2: practice in Cubernetes environments. Flunid is the log collector and shipper.
- 10:31Speaker 2: It usually runs as a small agent on every single
- 10:34Speaker 2: node in your cluster, grabs all the container log streams
- 10:37Speaker 2: and sends them off, sends them where to elastic search.
- 10:39Speaker 2: That's the powerhouse. It receives all these logs, parses them,
- 10:43Speaker 2: indexes them so they're searchable, and stores them. It's built
- 10:46Speaker 2: for handling huge volumes of text data.
- 10:48Speaker 1: Okay, logs collected, indexed, how do we actually use them?
- 10:52Speaker 2: That's Cubana. Cubana is the web interface on top of
- 10:55Speaker 2: elastic Search. It lets you search across all your logs
- 10:58Speaker 2: from all your containers in near real time. You can
- 11:01Speaker 2: search for specific errors, filter by application, timeframe, whatever you need.
- 11:05Speaker 2: Plus you can create dashboards visualized trends like graphing the
- 11:09Speaker 2: number of four hundred and four or five hundred errors
- 11:11Speaker 2: over time, invaluable for troubleshooting and monitoring.
- 11:15Speaker 1: Right, so, we've built the infrastructure, we've containerized and scaled
- 11:17Speaker 1: the application. We're logging everything centrally. But there's another big
- 11:21Speaker 1: challenge organizations face today dealing with multiple cloud providers, the
- 11:25Speaker 1: rise of multi cloud. We've got the big three AWS, GCP, Azure.
- 11:30Speaker 2: Yep, the titans AWS is you know, the original Giant
- 11:33Speaker 2: still the main player, has an absolutely massive range of
- 11:36Speaker 2: services for almost anything, would be full choice for many
- 11:39Speaker 2: often Yeah, then you've got GCP, Google Cloud a bit newer,
- 11:43Speaker 2: often seen as being strong in data analytics and machine learning,
- 11:46Speaker 2: things like big Query for huge data sets, specialized hardware
- 11:49Speaker 2: for tensoflow, and sometimes it's cheaper, especially for raw compute power.
- 11:54Speaker 1: Interesting and Azure.
- 11:55Speaker 2: Azure is Microsoft's cloud, so its big strength is integration
- 11:58Speaker 2: with the Microsoft ecosystem. If your company relies heavily on
- 12:01Speaker 2: Windows Server Active Directory SQL server. Azure often makes the
- 12:05Speaker 2: most sense, is generally seen as very reliable, very enterprise focus,
- 12:08Speaker 2: but often the most expensive of the three.
- 12:11Speaker 1: Okay, so they each have their niches. But the problem
- 12:14Speaker 1: comes when a company wants to use services from more
- 12:16Speaker 1: than one. Right, maybe they need Azure Active Directory for identity,
- 12:20Speaker 1: by the one GCP's Big Query for analytics, and perhaps
- 12:23Speaker 1: they run some Core apps on AWS using Dynamo dB.
- 12:26Speaker 2: Exactly that's becoming super common. But managing that Each cloud
- 12:31Speaker 2: has its own way of doing things, its own dashboard,
- 12:33Speaker 2: and crucially, its own command line interface the awscli, Google's
- 12:38Speaker 2: u cloud Cli, azures as cli. They all work differently,
- 12:42Speaker 2: different commands, different syntax.
- 12:44Speaker 1: It's chaos trying to automate across them.
- 12:46Speaker 2: Total chaos, inconsistent, complex, aero prone. And that specific problem
- 12:51Speaker 2: managing infrastructure consistently across multiple providers is exactly what Hashi
- 12:56Speaker 2: Core's Terraform was built to solve.
- 12:58Speaker 1: Caere Form the big name in IAC.
- 13:00Speaker 2: It's become the de facto standard for multi cloud infrastructure
- 13:03Speaker 2: s code. Its brilliance is that it lets you define
- 13:05Speaker 2: your infrastructure, servers, databases, networks, load balancers, everything using one
- 13:10Speaker 2: single universal syntax. In its configuration.
- 13:12Speaker 1: Files one syntax for all clouds.
- 13:14Speaker 2: One syntax. You write your Terraform code describing what you want,
- 13:18Speaker 2: and Terraform itself figures out how to talk to the
- 13:20Speaker 2: specific APIs of AWS or GCP or Azure or dozens
- 13:25Speaker 2: of other providers to make it happen.
- 13:27Speaker 1: So if Vagrant brought iac to managing single vms easily,
- 13:31Speaker 1: Terraform brings that same declarative power to managing your entire
- 13:35Speaker 1: complex multi cloud setup.
- 13:37Speaker 2: That's a great way to put it. It manages the
- 13:39Speaker 2: state of your whole infrastructure, and probably its most critical
- 13:42Speaker 2: feature isn't even the apply part. It's the safety that
- 13:45Speaker 2: it provides before you apply changes.
- 13:48Speaker 1: You mean, the planning step.
- 13:49Speaker 2: Absolutely, the Terraform plan command before you actually change anything.
- 13:52Speaker 2: You run plan Terraform reads your code, checks the current
- 13:56Speaker 2: state of your actual live infrastructure. It keeps track of
- 13:58Speaker 2: this in a state file and tells you precisely what
- 14:01Speaker 2: it intends to do.
- 14:02Speaker 1: What it will add, change or dot delete exactly.
- 14:06Speaker 2: It shows you this resource will be created, plus this
- 14:09Speaker 2: one will be modified, and the really scary one, this
- 14:12Speaker 2: resource will be destroyed. That preview, that ability to see
- 14:16Speaker 2: the potential impact and catch mistakes before you accidentally delete
- 14:20Speaker 2: your production database. It's an absolutely essential guardrail for managing
- 14:24Speaker 2: complex infrastructure safely.
- 14:26Speaker 1: Okay, we've used Terraform to build it. We use Docker
- 14:29Speaker 1: and Kubernators to deploy and scale the app. Yeah, what's
- 14:31Speaker 1: the final piece tying all this automation together, Getting code
- 14:34Speaker 1: from a developer's laptop into production reliably. The CICD pipeline right.
- 14:40Speaker 2: CICD often orchestrated by tools like Jenkins get lab, CI
- 14:44Speaker 2: GitHub actions. There are many CI stands for continuous integration.
- 14:48Speaker 1: Checking the code quality automatically.
- 14:49Speaker 2: Pretty much every time a developer commits code, the CI
- 14:52Speaker 2: server automatically pulls it, builds it, and runs a series
- 14:55Speaker 2: of checks unit tests, integration tests, maybe static code analysis
- 14:58Speaker 2: tools like linters. The goal is to catch bugs early
- 15:01Speaker 2: and often makes sense fail fast exactly. Then if all
- 15:04Speaker 2: those cichecks pass, you move to CD. That can mean
- 15:08Speaker 2: continuous delivery or continuous deployment. Continuous delivery means the code
- 15:12Speaker 2: is proven ready to deploy, maybe with one final manual
- 15:16Speaker 2: approval click. Continuous deployment means it goes all the way
- 15:19Speaker 2: out to.
- 15:19Speaker 1: Production automatically, now fully automated.
- 15:22Speaker 2: The goal is to be able to reliably push new
- 15:24Speaker 2: versions frequently. And this whole complex workflow, build, test, deploy
- 15:30Speaker 2: is itself defined as code, pipeline as code they call it.
- 15:33Speaker 2: So the delivery process itself is versioned, repeatable and auditible,
- 15:37Speaker 2: just like the infrastructure.
- 15:38Speaker 1: Okay, wow, we have really covered a lot of ground.
- 15:41Speaker 1: We went from the Linux foundation, the.
- 15:42Speaker 2: Different district RHL versus w Nbuntu, through Bash scripting, the
- 15:46Speaker 2: limitations there, and then the big philosophical leap to infrastructure
- 15:50Speaker 2: as code with tools like Vagrant and crucially paraform for
- 15:54Speaker 2: managing multi.
- 15:55Speaker 1: Cloud Declarative configuration became key.
- 15:57Speaker 2: Then we got into modern application delivery Docker cant the
- 16:00Speaker 2: jin scuncorn pattern and scaling it all with Kubernetes, understanding pods,
- 16:05Speaker 2: deployments and especially services to connect the moving parts and
- 16:08Speaker 2: not forgetting centralized logging with EFK for managing that scale.
- 16:13Speaker 1: Right, The whole journey shows this relentless drive towards automation.
- 16:17Speaker 2: Doesn't it the overarching theme? It isn't just knowing the
- 16:20Speaker 2: individual tools, is it. It's understanding that automation has to
- 16:23Speaker 2: deliver resilience, consistency and auditibility. That's the goal.
- 16:28Speaker 1: So let's leave you with a final thought to chew on.
- 16:31Speaker 1: If the ultimate goal for a professional DevOps engineer is
- 16:34Speaker 1: to build infrastructure that's so well defined by code that
- 16:37Speaker 1: you could literally destroy it and recreate it perfectly identically
- 16:42Speaker 1: in moments, what people often call immutable infrastructure the dream state.
- 16:46Speaker 1: Can you realistically achieve that by clicking around in cloud
- 16:49Speaker 1: provider dashboards or by relying on a patchwork of custom
- 16:53Speaker 1: Bash scripts? Or is the unified declarative plan and apply
- 16:57Speaker 1: approach of something like terraform the only truly sustainable way
- 17:01Speaker 1: to manage the sheer, complexity and scale of modern, often
- 17:04Speaker 1: multi cloud reality.
- 17:06Speaker 2: How you answer that probably defines your approach as a
- 17:08Speaker 2: modern engineer, something.
- 17:09Speaker 1: They think about. That's all the time we have for
- 17:11Speaker 1: this deep dive. Thanks for joining us, See you next time.