text
stringlengths
7
369
[1721.54 --> 1726.42] which is probably your NFS. It's the same thing with MySQL too. And when we were talking about that
[1726.42 --> 1729.78] earlier, the reason why I don't choose that is because you're just, you know, you're taking
[1729.78 --> 1733.12] something that's highly available and all of a sudden you're making a single point of failure,
[1733.24 --> 1739.46] be your MySQL server. And then you have to make your MySQL server HA to make that HA. And so it just
[1739.46 --> 1745.66] grows exponentially. It depends on how, how, how rigid you are about making things highly available.
[1745.66 --> 1751.26] And so you, you, you have a lot of choices, you know, but for storage, it's really going to be
[1751.26 --> 1755.72] up to you. If you want to make it highly available, you could dump everything in NFS and that's fine.
[1755.82 --> 1760.82] Or you could choose things like Rook, Seth or, or Longhorn there, there, there are options.
[1761.60 --> 1767.98] Why, why didn't I take the blue pill? That's often what I end up thinking at 2am when I've started
[1767.98 --> 1775.68] one of these ludicrous adventures down that particular rabbit hole. Yeah. So let's presuppose
[1775.68 --> 1782.18] that, uh, we now have a running Kubernetes cluster with a load balancer, uh, with storage and
[1782.18 --> 1787.74] everything's working. We've got a completely empty cluster. Now what, where do people find apps to
[1787.74 --> 1792.96] actually run on this thing that are compatible with Kubernetes? Yeah, good question. So most, um,
[1793.02 --> 1797.80] most, I'll say most, uh, air quotes, most containers that are, are built on Docker,
[1797.98 --> 1803.36] um, are compatible with Kubernetes because Kubernetes under the covers is now using a
[1803.36 --> 1807.56] different container runtime. It's not important, but it's compatible with Docker images and Docker
[1807.56 --> 1812.32] containers. So one, anything you were previously running in Docker most likely is going to run in
[1812.32 --> 1816.82] Kubernetes. I mean, that's how it was designed to work. Something you'll need to pay attention to.
[1816.84 --> 1821.90] And I kind of hinted at it a little bit was, was, you know, stateful applications. You'll need to make
[1821.90 --> 1827.10] sure that that application you have can scale. Everybody thinks like, Oh, you know, I'm running Plex.
[1827.10 --> 1832.22] The way to make it highly available is spin the replicas up to three. It's not going to work.
[1832.94 --> 1837.76] It's not going to work. Yeah. So if, if things weren't built to be stateless, you're not going
[1837.76 --> 1841.50] to be able to scale them. You'll get some other benefits, like they could bounce around on nodes,
[1841.54 --> 1846.42] but you can only run one. So it's almost a bit like raid in that regard, right? It's not designed
[1846.42 --> 1852.50] to increase your resilience necessarily. It's designed to increase your uptime. That's right. So the whole
[1852.50 --> 1858.56] sales pitch behind Kubernetes that kind of got me excited about it in the beginning was let's say
[1858.56 --> 1864.08] you had a Plex instance running on node one and node two and three are just sat there chilling out,
[1864.16 --> 1869.80] doing nothing. Node one has a hardware failure and Kubernetes is running a loop constantly checking
[1869.80 --> 1875.80] the state of these things. And every time that loop executes, it's saying right on node one,
[1875.80 --> 1883.24] this pod exists, Plex exists, and it matches the state declared in the YAML file that Alex put in
[1883.24 --> 1888.28] place. Cool. Everything's hunky dory and it will carry on doing that loop. I don't know what the
[1888.28 --> 1894.62] frequency is, but it's many times a minute that that typically happens. Now what happens when node
[1894.62 --> 1901.46] one has a hardware failure or drops off the network or just crashes if the application crashes for some
[1901.46 --> 1905.98] reason? Well, Kubernetes is going to come around and do its health checks and make sure that everything's
[1905.98 --> 1910.98] tickety-boo and it's going to say, hang on a minute, the desired state over here doesn't match what I'm
[1910.98 --> 1916.64] expecting. Well, what I'm going to do is I'm going to utilize a different node that matches the node
[1916.64 --> 1921.14] selector rule that you've put in here. Let's say it's a node with quick sync for transcoding, for example.
[1922.00 --> 1927.94] Not every node in your cluster might have a GPU available to do that. The loop will go around and it will
[1927.94 --> 1933.92] say, hey, okay, well, out of the five nodes in this cluster, I can use these two. And now I'm going to
[1933.92 --> 1937.48] take the Plex pod and I'm going to make sure it's destroyed over there, but I'm going to spin up a new
[1937.48 --> 1942.10] one over here. And then I'm going to tell you that that happened in your log and alert you about it.
[1942.76 --> 1948.32] That's generally speaking, the typical use case for a stateful application in Kubernetes. Like Tim was
[1948.32 --> 1954.82] saying, it's not to have three copies of Plex running at the same time because the database writes.
[1954.82 --> 1959.82] And like, if you think about how the data would flow in that transaction, you're coming in to
[1959.82 --> 1965.26] watch video. Well, which version of the Plex runtime are you hitting? And then that version of the Plex
[1965.26 --> 1970.16] runtime is probably got its fingers in the database somewhere. And how does the database know which one
[1970.16 --> 1976.34] to listen to? And it can get very confusing very quickly, which is why a lot of dev shops have to
[1976.34 --> 1984.10] architect things in a way called the 12 factor app. If you're interested, go and look at 12 factor app.net.
[1984.10 --> 1989.24] I think that's the website. Hang on. Yeah. Yeah. Good site. Good reference to 12 factor.net is the
[1989.24 --> 1995.62] website. There'll be a link in the show notes. There are a few different ways to run containers
[1995.62 --> 1999.98] on Kubernetes. Like you were saying, OCI compliant containers. Typically that's mostly Docker containers.
[2000.34 --> 2006.58] There are a few others under the covers as well. There is a project called Kubernetes at home,
[2006.64 --> 2011.22] which there'll be a link to in the show notes, Kate's at home. And this is a fantastic resource.
[2011.22 --> 2016.34] If you're not familiar with it, go check it out. You can go over there and download Helm charts and all
[2016.34 --> 2022.66] sorts of other stuff to run applications on top of your Kubernetes cluster. And a lot of other smart
[2022.66 --> 2027.44] people have done a lot of the legwork for you thinking about how do I run an application that
[2027.44 --> 2034.04] wasn't designed for the Kubernetes world to make it run in the Kubernetes world, stuff like user
[2034.04 --> 2038.86] management. You know, we're all familiar with the group and user ID stuff from a normal Linux
[2038.86 --> 2043.70] Docker host. There's some tweaks you've got to make in the Kubernetes world to translate that
[2043.70 --> 2048.70] stuff across multiple nodes because it's not just typical Linux permissions, right? There's a,
[2048.78 --> 2053.54] there's an extra layer on top and there's, there's lots of other small gotchas like that. Like,
[2053.84 --> 2056.98] you know, like Tim was saying, you know, there's plenty of stuff that you don't know what you don't
[2056.98 --> 2062.22] know until you find out you don't know it. And it's a, it's a deep rabbit hole, but it's one that if
[2062.22 --> 2067.64] you've got any interest in, I highly recommend you give a look to Tim's channel as well as the
[2067.64 --> 2072.94] Kubernetes at home stuff that's linked in the show notes. Yeah. Like I've worked with
[2072.94 --> 2078.14] Kubernetes at home folks, a couple of them there. I'm in their community. That's how I got bit by
[2078.14 --> 2083.52] the flux bug, you know, and declaratively defining your whole entire Kubernetes cluster through
[2083.52 --> 2088.18] manifest. Yeah. That's a great call out. The Kubernetes at home helm charge are fantastic,
[2088.36 --> 2093.02] especially for people self-hosting because they went after a lot of the services that people are
[2093.02 --> 2097.70] self-hosting. And if you just want normal, you know, I shouldn't say normal, but publicly available
[2097.70 --> 2102.96] helm charts that, you know, for services like NGINX and, you know, all these enterprise services,
[2103.10 --> 2107.72] those are out there. Those helm charts are out there. But what the Kates at home helm charts are,
[2107.84 --> 2111.94] they're going after, they're going after Plex, they're going after, you know, Sonar, Radar,
[2112.04 --> 2116.62] like all these services that people like to run at home and building charts for them. And if you even
[2116.62 --> 2122.20] search some of the helm chart repository aggregators, they referenced their charts too. So yeah,
[2122.20 --> 2127.60] they've been a huge help in getting me onto flux, which is a totally different topic, but it's
[2127.60 --> 2131.32] pretty far down the rabbit hole. I got absolutely hooked by these guys when I found out I could run
[2131.32 --> 2136.42] a Factorio server on my Kubernetes cluster. I just thought it was the coolest thing in the world.
[2136.86 --> 2141.64] So talk to me a bit about GitOps and flux and that kind of thing. We've talked to, obviously,
[2141.74 --> 2146.22] I rambled a lot a minute ago about, you know, declarative state and how there's this loop
[2146.22 --> 2152.00] in Kubernetes that is constantly checking the state of things. GitOps takes that to another
[2152.00 --> 2159.38] level, right? It does. So GitOps is a lot more defined, I guess, than DevOps. So GitOps is this
[2159.38 --> 2168.50] idea that you define your cluster state or your environment state in manifest 100%. And the way
[2168.50 --> 2177.18] that you influence the state of a cluster or infrastructure is by doing it through Git. So
[2177.18 --> 2183.24] for example, I just went through this exercise, you know, I needed to get, let's just say an Nginx
[2183.24 --> 2191.24] container, I would add an Nginx manifest, whether I'm using Helm or Kubernetes manifests, I would create
[2191.24 --> 2196.72] that manifest, I would create that manifest, I would commit it to Git, and I would push it up. And then
[2196.72 --> 2202.74] there are services within Kubernetes that say, hey, I just got this manifest, I'm looking at the current
[2202.74 --> 2208.28] state, I'm looking at the desired state, and I will apply it. And so GitOps basically says that you,
[2208.60 --> 2214.40] the only way you can influence state is really by influencing Git, but they say through a pull
[2214.40 --> 2222.02] request could be anyway. But now my whole entire cluster at home is that way. And I think the benefit
[2222.02 --> 2228.16] of that is that I can reproduce my whole entire Kubernetes cluster by just saying, you know,
[2228.16 --> 2234.14] kubectl apply or use Flux to do it all over again, and rebuild my whole entire cluster. Now,
[2234.30 --> 2239.90] data is a different story, I would have to do some restores on data to get those, those persistent
[2239.90 --> 2245.40] volume claims back. But at the end of the day, I have my whole entire playbook for how to build my
[2245.40 --> 2250.18] cluster. You know, if you're running your own cluster, you can do one offs and do all these weird
[2250.18 --> 2252.04] stuff. You know, you know how it is to tinker.
[2252.04 --> 2257.30] That's just it. That's just it. GitOps at home might seem like massive overkill,
[2257.56 --> 2261.20] just like ansibilizing your server might seem massive overkill when it's just you.
[2261.34 --> 2261.80] That's right.