← Back
Mischa Vandenburg July 9, 2025 15m

K3D Kubernetes Tutorial: Local Clusters in Seconds [Step-by-Step]

Read full transcript 12 segments
  1. K3D is my new favorite way of deploying K3D is my new favorite way of deploying Kubernetes clusters for local testing Kubernetes clusters for local testing Kubernetes clusters for local testing and development. In this video, I'll and development. In this video, I'll and development. In this video, I'll show you what K3D is, how to install it, show you what K3D is, how to install it, show you what K3D is, how to install it, and some very interesting use cases that and some very interesting use cases that and some very interesting use cases that you can consider this tool for. Let's you can consider this tool for. Let's you can consider this tool for. Let's dive right into the installation. We go dive right into the installation. We go dive right into the installation. We go to the K3D website at k3d.io. to the K3D website at k3d.io. to the K3D website at k3d.io. And when you then scroll down, then you And when you then scroll down, then you And when you then scroll down, then you will see a few installation methods. You will see a few installation methods. You will see a few installation methods. You can install it using curl. You can can install it using curl. You can can install it using curl. You can install it using Brew or Yay if you're install it using Brew or Yay if you're install it using Brew or Yay if you're running Arch Linux like I'm doing by the running Arch Linux like I'm doing by the running Arch Linux like I'm doing by the way or there are several other pack way or there are several other pack way or there are several other pack package managers also asf for example package managers also asf for example package managers also asf for example and I'm currently running this inside of and I'm currently running this inside of and I'm currently running this inside of a dev container using mis but I'll a dev container using mis but I'll a dev container using mis but I'll explain that a little bit later. So it's explain that a little bit later. So it's explain that a little bit later. So it's very easy to install and when you have very easy to install and when you have very easy to install and when you have it installed then you just run one it installed then you just run one it installed then you just run one command k3d cluster create my cluster command k3d cluster create my cluster command k3d cluster create my cluster and this is then going to create a and this is then going to create a and this is then going to create a kubernetes cluster inside of containers kubernetes cluster inside of containers kubernetes cluster inside of containers for you. So this cluster this single for you. So this cluster this single for you. So this cluster this single command will create a docker network. It command will create a docker network. It command will create a docker network. It will spin up a server node or a control will spin up a server node or a control will spin up a server node or a control plane. It will set up a load balancer plane. It will set up a load balancer plane. It will set up a load balancer for the nodes and configure your cube for the nodes and configure your cube for the nodes and configure your cube config uh locally to connect to this config uh locally to connect to this config uh locally to connect to this cluster. So if we check out what cluster. So if we check out what cluster. So if we check out what containers were created now, we see that containers were created now, we see that containers were created now, we see that our cluster is up and running. So if I our cluster is up and running. So if I our cluster is up and running. So if I do docker ps, then here we see that I do docker ps, then here we see that I do docker ps, then here we see that I have two containers running. It's my K3D have two containers running. It's my K3D have two containers running. It's my K3D proxy. This is the server load balancer proxy. This is the server load balancer proxy. This is the server load balancer as you see here. And then we see my as you see here. And then we see my as you see here. And then we see my rancher K3S. So this is my my actual rancher K3S. So this is my my actual rancher K3S. So this is my my actual control plane here. And it's currently a control plane here. And it's currently a control plane here. And it's currently a single node cluster. So you see two

  2. single node cluster. So you see two single node cluster. So you see two containers. And then let's verify if we containers. And then let's verify if we containers. And then let's verify if we can actually talk to the Kubernetes API. can actually talk to the Kubernetes API. can actually talk to the Kubernetes API. Yes, we can. Our cube config file has Yes, we can. Our cube config file has Yes, we can. Our cube config file has been automatically configured to talk to been automatically configured to talk to been automatically configured to talk to this new cluster which is now 46 seconds this new cluster which is now 46 seconds this new cluster which is now 46 seconds old. And we see that we have one node old. And we see that we have one node old. And we see that we have one node which is a control plane and the master which is a control plane and the master which is a control plane and the master node. That's the default configuration node. That's the default configuration node. That's the default configuration when you run this command. So we we see when you run this command. So we we see when you run this command. So we we see our node listed as ready now. So let's our node listed as ready now. So let's our node listed as ready now. So let's check out what pods are then created by check out what pods are then created by check out what pods are then created by K3D when it's running automatically. So K3D when it's running automatically. So K3D when it's running automatically. So we see that we have core DNS. We see we see that we have core DNS. We see we see that we have core DNS. We see that it has installed traffic the that it has installed traffic the that it has installed traffic the ingress controller. We have the local ingress controller. We have the local ingress controller. We have the local path provisioner so we can provision path provisioner so we can provision path provisioner so we can provision persistent volumes. We have our metric persistent volumes. We have our metric persistent volumes. We have our metric server. We have our service LB. So this server. We have our service LB. So this server. We have our service LB. So this will provide external IPs for load will provide external IPs for load will provide external IPs for load balancers when we create them. And then balancers when we create them. And then balancers when we create them. And then we have our traffic ingress controller we have our traffic ingress controller we have our traffic ingress controller running here. So we see that has been running here. So we see that has been running here. So we see that has been that it has configured everything you that it has configured everything you that it has configured everything you need for a fully functional Kubernetes need for a fully functional Kubernetes need for a fully functional Kubernetes cluster. It has all of the K3S cluster. It has all of the K3S cluster. It has all of the K3S components running. So as you saw here, components running. So as you saw here, components running. So as you saw here, this image is then is basically taking this image is then is basically taking this image is then is basically taking the Rancher K3S base image and then make the Rancher K3S base image and then make the Rancher K3S base image and then make and running that inside of a and running that inside of a and running that inside of a containerized environment. So now that containerized environment. So now that containerized environment. So now that we have our Kubernetes cluster up and we have our Kubernetes cluster up and we have our Kubernetes cluster up and running, let's just do a quick running, let's just do a quick running, let's just do a quick test deployment here. So as always, test deployment here. So as always, test deployment here. So as always, we're always deploying engine X of we're always deploying engine X of we're always deploying engine X of course. And we now see that we have a course. And we now see that we have a course. And we now see that we have a deployment. So if I do k get pods we see deployment. So if I do k get pods we see deployment. So if I do k get pods we see that our container is now being created

  3. that our container is now being created that our container is now being created and if when that is done or while it's and if when that is done or while it's and if when that is done or while it's creating that I can already expose the creating that I can already expose the creating that I can already expose the the container. So if I now do kget get the container. So if I now do kget get the container. So if I now do kget get svc we see that our um deployment has svc we see that our um deployment has svc we see that our um deployment has been exposed now been exposed now been exposed now and our our deployment is up and running and our our deployment is up and running and our our deployment is up and running already. So that we have a fully already. So that we have a fully already. So that we have a fully functional kubernetes cluster in just functional kubernetes cluster in just functional kubernetes cluster in just mere seconds. So we've created our mere seconds. So we've created our mere seconds. So we've created our cluster and deployed our first cluster and deployed our first cluster and deployed our first application to it. So let's check out application to it. So let's check out application to it. So let's check out some more CLI commands that we can do. some more CLI commands that we can do. some more CLI commands that we can do. So if you just type K3D, we see that So if you just type K3D, we see that So if you just type K3D, we see that there are several commands that we can there are several commands that we can there are several commands that we can use. We have cluster completion, image, use. We have cluster completion, image, use. We have cluster completion, image, etc. So let's just walk through a couple etc. So let's just walk through a couple etc. So let's just walk through a couple of them. So to list all of the clusters of them. So to list all of the clusters of them. So to list all of the clusters that we have now, we can do K3D cluster that we have now, we can do K3D cluster that we have now, we can do K3D cluster list. So this means yes, you can have list. So this means yes, you can have list. So this means yes, you can have multiple clusters running uh in K3D. multiple clusters running uh in K3D. multiple clusters running uh in K3D. Again, I'm running this inside of a dev Again, I'm running this inside of a dev Again, I'm running this inside of a dev container, so I'm just going to run one. container, so I'm just going to run one. container, so I'm just going to run one. But if you are running this on your But if you are running this on your But if you are running this on your local machine, you can have multiple local machine, you can have multiple local machine, you can have multiple clusters running each in their own set clusters running each in their own set clusters running each in their own set of containers. You can easily switch of containers. You can easily switch of containers. You can easily switch between them, which is a very between them, which is a very between them, which is a very interesting use case. If you want to interesting use case. If you want to interesting use case. If you want to stop your cluster without deleting it, stop your cluster without deleting it, stop your cluster without deleting it, we can just do K3D cluster stop and then we can just do K3D cluster stop and then we can just do K3D cluster stop and then it's going to stop my cluster. So if I it's going to stop my cluster. So if I it's going to stop my cluster. So if I now do K get pods, then the connection now do K get pods, then the connection now do K get pods, then the connection is refused. If I do docker ps, then I is refused. If I do docker ps, then I is refused. If I do docker ps, then I see there are no containers running. But see there are no containers running. But see there are no containers running. But if I do K3D cluster list again, then we if I do K3D cluster list again, then we if I do K3D cluster list again, then we see it is still uh loaded or it's still see it is still uh loaded or it's still see it is still uh loaded or it's still available to us. It's just not started.

  4. available to us. It's just not started. available to us. It's just not started. So the server is 0 to one. So there are So the server is 0 to one. So there are So the server is 0 to one. So there are zero servers ready. If I want to start zero servers ready. If I want to start zero servers ready. If I want to start the cluster again, I can just do K3D the cluster again, I can just do K3D the cluster again, I can just do K3D start my cluster and then it's going to start my cluster and then it's going to start my cluster and then it's going to spin it up again. So you can keep spin it up again. So you can keep spin it up again. So you can keep certain clusters archived if you will. certain clusters archived if you will. certain clusters archived if you will. You can keep them uh stop in a stop You can keep them uh stop in a stop You can keep them uh stop in a stop state. They're not taking any resources, state. They're not taking any resources, state. They're not taking any resources, but you can start and stop them as you but you can start and stop them as you but you can start and stop them as you require. And then finally, when you're require. And then finally, when you're require. And then finally, when you're done with the cluster, so again, I like done with the cluster, so again, I like done with the cluster, so again, I like to I like to use K3D for these test to I like to use K3D for these test to I like to use K3D for these test environments, these ephemeral environments, these ephemeral environments, these ephemeral environments. I just do K3D cluster environments. I just do K3D cluster environments. I just do K3D cluster delete and my cluster is gone. delete and my cluster is gone. delete and my cluster is gone. So it also makes it very easy to create So it also makes it very easy to create So it also makes it very easy to create multi-node clusters too. So let's say multi-node clusters too. So let's say multi-node clusters too. So let's say you want to practice pot affinity rules you want to practice pot affinity rules you want to practice pot affinity rules and things like that. We can just do um and things like that. We can just do um and things like that. We can just do um K3D cluster create multiode. That's K3D cluster create multiode. That's K3D cluster create multiode. That's going to create three servers and two going to create three servers and two going to create three servers and two agents. So it's then going to deploy agents. So it's then going to deploy agents. So it's then going to deploy five containers um or six containers in five containers um or six containers in five containers um or six containers in total. It's each server gets their own total. It's each server gets their own total. It's each server gets their own container.

  5. container. container. And here we go. Our multi-node cluster And here we go. Our multi-node cluster And here we go. Our multi-node cluster is now created. So if I do k get nodes is now created. So if I do k get nodes is now created. So if I do k get nodes now now we see that we have two control now now we see that we have two control now now we see that we have two control three control planes and then two agents three control planes and then two agents three control planes and then two agents two worker nodes. If I do docker ps then two worker nodes. If I do docker ps then two worker nodes. If I do docker ps then we see they have multiple containers now we see they have multiple containers now we see they have multiple containers now and each node has is running in its own and each node has is running in its own and each node has is running in its own container. And now that we have a container. And now that we have a container. And now that we have a multi-node cluster running we can use multi-node cluster running we can use multi-node cluster running we can use this command to get some more this command to get some more this command to get some more information about it. So we do the information about it. So we do the information about it. So we do the cluster list command again but with the cluster list command again but with the cluster list command again but with the verbose flag. And then we see some more verbose flag. And then we see some more verbose flag. And then we see some more information about our cluster. I can information about our cluster. I can information about our cluster. I can also do docker network ls and then we also do docker network ls and then we also do docker network ls and then we see the network that has been created by see the network that has been created by see the network that has been created by K3D for our Kubernetes cluster. And then K3D for our Kubernetes cluster. And then K3D for our Kubernetes cluster. And then when you're done with this cluster, you when you're done with this cluster, you when you're done with this cluster, you can delete it by running the cluster can delete it by running the cluster can delete it by running the cluster delete command. And now if I do K3D delete command. And now if I do K3D delete command. And now if I do K3D cluster ls again, I see that there are cluster ls again, I see that there are cluster ls again, I see that there are no clusters left anymore. So that's how no clusters left anymore. So that's how no clusters left anymore. So that's how easy and how fast it is to just spin up easy and how fast it is to just spin up easy and how fast it is to just spin up and tear down Kubernetes clusters for and tear down Kubernetes clusters for and tear down Kubernetes clusters for quick local testing and development. Now quick local testing and development. Now quick local testing and development. Now as I mentioned I am running this in a as I mentioned I am running this in a as I mentioned I am running this in a dev container. So I do if I do cat OS dev container. So I do if I do cat OS dev container. So I do if I do cat OS release then you will see that this is a release then you will see that this is a release then you will see that this is a Debian GNU Linux dev container. But if I Debian GNU Linux dev container. But if I Debian GNU Linux dev container. But if I open up a shell on my normal system and open up a shell on my normal system and open up a shell on my normal system and if I do catoss if I do catoss if I do catoss release then you will see that I have release then you will see that I have release then you will see that I have arch that I'm running Arch Linux by the arch that I'm running Arch Linux by the arch that I'm running Arch Linux by the way. So way. So way. So this this means that in this container I this this means that in this container I this this means that in this container I can install all of the tooling that I can install all of the tooling that I can install all of the tooling that I want for this particular project. So I

  6. want for this particular project. So I want for this particular project. So I can have my local Kubernetes cluster can have my local Kubernetes cluster can have my local Kubernetes cluster inside of the dev container with all of inside of the dev container with all of inside of the dev container with all of the tooling that I need. So if I do K the tooling that I need. So if I do K the tooling that I need. So if I do K get pods. So yes, this is timing out get pods. So yes, this is timing out get pods. So yes, this is timing out because I don't have a cluster running. because I don't have a cluster running. because I don't have a cluster running. But which cubectl here I have cubectl But which cubectl here I have cubectl But which cubectl here I have cubectl running. But if I run this on my my Arch running. But if I run this on my my Arch running. But if I run this on my my Arch Linux machine, you will see that I don't have cubectl you will see that I don't have cubectl installed which K3D I have no K3D installed which K3D I have no K3D installed which K3D I have no K3D installed. So on my local Arch Linux installed. So on my local Arch Linux installed. So on my local Arch Linux machine, I don't even have cubectl. I'm machine, I don't even have cubectl. I'm machine, I don't even have cubectl. I'm not even able to connect to Kubernetes not even able to connect to Kubernetes not even able to connect to Kubernetes cluster from my local machine. I work cluster from my local machine. I work cluster from my local machine. I work completely um I work exclusively in dev completely um I work exclusively in dev completely um I work exclusively in dev containers these days. And even inside containers these days. And even inside containers these days. And even inside of this dev container, I'm able to run of this dev container, I'm able to run of this dev container, I'm able to run multi-node Kubernetes clusters with all multi-node Kubernetes clusters with all multi-node Kubernetes clusters with all of the tooling and editing and of the tooling and editing and of the tooling and editing and everything tailored to that specific everything tailored to that specific everything tailored to that specific project inside of the dev container. So project inside of the dev container. So project inside of the dev container. So if you want to learn more about this dev if you want to learn more about this dev if you want to learn more about this dev container workflow that I'm that I'm container workflow that I'm that I'm container workflow that I'm that I'm using here, I have just finished a full using here, I have just finished a full using here, I have just finished a full course on this. It is available in my course on this. It is available in my course on this. It is available in my cubecraft community at cubecraft community at cubecraft community at school.com/cubcraft.

  7. school.com/cubcraft. school.com/cubcraft. This is a C full course where I show you This is a C full course where I show you This is a C full course where I show you how I set up my entire environment using how I set up my entire environment using how I set up my entire environment using dev containers using neovim inside of dev containers using neovim inside of dev containers using neovim inside of them that I can that I can use for them that I can that I can use for them that I can that I can use for having tailored project environments for having tailored project environments for having tailored project environments for every project that I do even including every project that I do even including every project that I do even including K3D. This is in addition to the 40 hours K3D. This is in addition to the 40 hours K3D. This is in addition to the 40 hours of other courses that you can that you of other courses that you can that you of other courses that you can that you will get when you join. And I am always will get when you join. And I am always will get when you join. And I am always online in this community. You can see online in this community. You can see online in this community. You can see I'm active every day answering I'm active every day answering I'm active every day answering questions. So, if you have if you get questions. So, if you have if you get questions. So, if you have if you get stuck, if you need some help, or if you stuck, if you need some help, or if you stuck, if you need some help, or if you want career advice, I am here answering want career advice, I am here answering want career advice, I am here answering your questions every single day. So, your questions every single day. So, your questions every single day. So, check out school.com/cubcraft check out school.com/cubcraft check out school.com/cubcraft because I know you're going to like it. because I know you're going to like it. because I know you're going to like it. Now, another cool feature of K3D is that Now, another cool feature of K3D is that Now, another cool feature of K3D is that you can use config files. So, the CLI is you can use config files. So, the CLI is you can use config files. So, the CLI is great for quick operations, but config great for quick operations, but config great for quick operations, but config files give you more flexibility and files give you more flexibility and files give you more flexibility and reproducibility. I can create the same reproducibility. I can create the same reproducibility. I can create the same cluster over and over again. So, this is cluster over and over again. So, this is cluster over and over again. So, this is my configuration file. It's very my configuration file. It's very my configuration file. It's very interesting that it has a kind simple interesting that it has a kind simple interesting that it has a kind simple and it's using the K3D API of course and and it's using the K3D API of course and and it's using the K3D API of course and then this configuration file will do then this configuration file will do then this configuration file will do several things. So it creates a cluster several things. So it creates a cluster several things. So it creates a cluster named devcluster. So here you see the named devcluster. So here you see the named devcluster. So here you see the name of devcluster and then it has one name of devcluster and then it has one name of devcluster and then it has one server and two agents. So here we see server and two agents. So here we see server and two agents. So here we see servers one agents two. So one control servers one agents two. So one control servers one agents two. So one control plane and two worker nodes. Then it maps plane and two worker nodes. Then it maps plane and two worker nodes. Then it maps port 8080 on your host to port 80 on the port 8080 on your host to port 80 on the port 8080 on your host to port 80 on the load balancer. So here you see my host load balancer. So here you see my host load balancer. So here you see my host port is going to be mapped to that of port is going to be mapped to that of port is going to be mapped to that of the load balancer and then it's going to the load balancer and then it's going to the load balancer and then it's going to map port 443 to port 8443 on my local

  8. map port 443 to port 8443 on my local map port 443 to port 8443 on my local machine. Next it disables the built-in machine. Next it disables the built-in machine. Next it disables the built-in traffic ingress controller. So that's traffic ingress controller. So that's traffic ingress controller. So that's what you see here with these extra args what you see here with these extra args what you see here with these extra args disable traffic. So if I don't want to disable traffic. So if I don't want to disable traffic. So if I don't want to have the traffic ingress controller have the traffic ingress controller have the traffic ingress controller because I'm practicing engine X, well I because I'm practicing engine X, well I because I'm practicing engine X, well I can just disable it like this and it can just disable it like this and it can just disable it like this and it mounts a volume from my host to all mounts a volume from my host to all mounts a volume from my host to all agent nodes. So here you will see my agent nodes. So here you will see my agent nodes. So here you will see my volumes workspace K3D data and it's volumes workspace K3D data and it's volumes workspace K3D data and it's going to mount that to all of my nodes going to mount that to all of my nodes going to mount that to all of my nodes here. And finally it automatically here. And finally it automatically here. And finally it automatically updates my cube config again and updates my cube config again and updates my cube config again and switches the context to it. So I have switches the context to it. So I have switches the context to it. So I have now saved this file in my dev container now saved this file in my dev container now saved this file in my dev container and if I then cluster create and point and if I then cluster create and point and if I then cluster create and point it to this cluster config.yml, it's it to this cluster config.yml, it's it to this cluster config.yml, it's going to read in that configuration and going to read in that configuration and going to read in that configuration and build a cluster based on that build a cluster based on that build a cluster based on that configuration. So now my cluster is up configuration. So now my cluster is up configuration. So now my cluster is up and running again. So if I do k get pods and running again. So if I do k get pods and running again. So if I do k get pods a again. So now I see that there are a again. So now I see that there are a again. So now I see that there are there are much fewer pods deployed now there are much fewer pods deployed now there are much fewer pods deployed now and you'll see that there is no mention and you'll see that there is no mention and you'll see that there is no mention of the ingress the the traffic ingress of the ingress the the traffic ingress of the ingress the the traffic ingress controller. So if I do k get ingress controller. So if I do k get ingress controller. So if I do k get ingress classes here we see there are no ingress classes here we see there are no ingress classes here we see there are no ingress classes defined. So I have no ingress classes defined. So I have no ingress classes defined. So I have no ingress controller. If I do k get nodes we see controller. If I do k get nodes we see controller. If I do k get nodes we see that we have one control plane and two that we have one control plane and two that we have one control plane and two agents just like we specified. So this agents just like we specified. So this agents just like we specified. So this is a very cool way of defining your is a very cool way of defining your is a very cool way of defining your desired state in code and deploying your desired state in code and deploying your desired state in code and deploying your Kubernetes cluster from that. And this Kubernetes cluster from that. And this Kubernetes cluster from that. And this is of course very useful in pipelines is of course very useful in pipelines is of course very useful in pipelines which we're going to be checking out in which we're going to be checking out in which we're going to be checking out in just a second. So now that I have this

  9. just a second. So now that I have this just a second. So now that I have this this cluster I could either update my this cluster I could either update my this cluster I could either update my configuration file and apply that or if configuration file and apply that or if configuration file and apply that or if I want to create a new node added to it I want to create a new node added to it I want to create a new node added to it then I can just add one node with just a then I can just add one node with just a then I can just add one node with just a oneliner like this. So now if I have do oneliner like this. So now if I have do oneliner like this. So now if I have do k get nodes we see that we have a new k get nodes we see that we have a new k get nodes we see that we have a new agent over here with or with with four agent over here with or with with four agent over here with or with with four that's 4 seconds old and I can remove that's 4 seconds old and I can remove that's 4 seconds old and I can remove that one if I want I can remove an older that one if I want I can remove an older that one if I want I can remove an older one here and then this node is also one here and then this node is also one here and then this node is also deleted. So you can you can either deleted. So you can you can either deleted. So you can you can either update the config file or you can just update the config file or you can just update the config file or you can just have these CLI commands and add or have these CLI commands and add or have these CLI commands and add or delete nodes directly for example. So delete nodes directly for example. So delete nodes directly for example. So there are a few interesting use cases there are a few interesting use cases there are a few interesting use cases that I want to share with you. There is that I want to share with you. There is that I want to share with you. There is one where you do a one command enginex one where you do a one command enginex one where you do a one command enginex deployment test. So this this is a deployment test. So this this is a deployment test. So this this is a script that I wrote and it creates a K3D script that I wrote and it creates a K3D script that I wrote and it creates a K3D cluster with specific configurations. cluster with specific configurations. cluster with specific configurations. It deploys engine X using declarative It deploys engine X using declarative It deploys engine X using declarative YAML definitions. It exposes it through YAML definitions. It exposes it through YAML definitions. It exposes it through a load balancer server. It then tests a load balancer server. It then tests a load balancer server. It then tests the connectivity and then when you exit, the connectivity and then when you exit, the connectivity and then when you exit, it automatically cleans up all of the it automatically cleans up all of the it automatically cleans up all of the resources. So let's run the script by resources. So let's run the script by resources. So let's run the script by running bash scripts and then k3d running bash scripts and then k3d running bash scripts and then k3d engineext test. So my script has engineext test. So my script has engineext test. So my script has finished running and as we see here it finished running and as we see here it finished running and as we see here it first creates a k3d cluster and then it first creates a k3d cluster and then it first creates a k3d cluster and then it sets it up completely. Then it's going sets it up completely. Then it's going sets it up completely. Then it's going to verify if my cluster is ready by to verify if my cluster is ready by to verify if my cluster is ready by doing some tests and making sure that doing some tests and making sure that doing some tests and making sure that the status is ready here. Then it's the status is ready here. Then it's the status is ready here. Then it's going to deploy an engine x deployment.

  10. going to deploy an engine x deployment. going to deploy an engine x deployment. It waits until that is done and then It waits until that is done and then It waits until that is done and then it's going to expose it using a load it's going to expose it using a load it's going to expose it using a load balancer service. So with an external IP balancer service. So with an external IP balancer service. So with an external IP when the service is ready, it's then when the service is ready, it's then when the service is ready, it's then going to test the engineext response going to test the engineext response going to test the engineext response using curl. So it first finds the IP and using curl. So it first finds the IP and using curl. So it first finds the IP and then it's going to curl that. So here then it's going to curl that. So here then it's going to curl that. So here you see that it then prints out the you see that it then prints out the you see that it then prints out the content of the curl response. So in this content of the curl response. So in this content of the curl response. So in this case it's showing the engineext standard case it's showing the engineext standard case it's showing the engineext standard welcome page. Welcome to EngineX. And welcome page. Welcome to EngineX. And welcome page. Welcome to EngineX. And then it's going to automatically clean then it's going to automatically clean then it's going to automatically clean up all the resources and it's going to up all the resources and it's going to up all the resources and it's going to delete my cluster. So you can maybe see delete my cluster. So you can maybe see delete my cluster. So you can maybe see how useful this is if I have a program how useful this is if I have a program how useful this is if I have a program that runs on Kubernetes and I can I can that runs on Kubernetes and I can I can that runs on Kubernetes and I can I can include this in a pipeline to just have include this in a pipeline to just have include this in a pipeline to just have a ephemeral environment spin up and just a ephemeral environment spin up and just a ephemeral environment spin up and just see if the application is running as I see if the application is running as I see if the application is running as I intended to do if the the responses are intended to do if the the responses are intended to do if the the responses are what I intended to be. So this is what I intended to be. So this is what I intended to be. So this is extremely useful for CI/CD pipelines. extremely useful for CI/CD pipelines. extremely useful for CI/CD pipelines. And what I love about this approach is And what I love about this approach is And what I love about this approach is demonstrates the speed and simplicity of demonstrates the speed and simplicity of demonstrates the speed and simplicity of K3D. With a single script, we create a K3D. With a single script, we create a K3D. With a single script, we create a cluster, deploy an application, verify cluster, deploy an application, verify cluster, deploy an application, verify that it works, and clean everything up.

  11. that it works, and clean everything up. that it works, and clean everything up. Perfect for CI/CD pipelines. Another Perfect for CI/CD pipelines. Another Perfect for CI/CD pipelines. Another good uh use case for this is a training good uh use case for this is a training good uh use case for this is a training and workshops. So each participant gets and workshops. So each participant gets and workshops. So each participant gets their own isolated cluster without their own isolated cluster without their own isolated cluster without overloading the host machine. And I've overloading the host machine. And I've overloading the host machine. And I've used this for workshops with over 20 used this for workshops with over 20 used this for workshops with over 20 participants on a single powerful participants on a single powerful participants on a single powerful server. You just need one big VM and server. You just need one big VM and server. You just need one big VM and then you can use this for deploying then you can use this for deploying then you can use this for deploying clusters on it. And even in a bash clusters on it. And even in a bash clusters on it. And even in a bash script like this, you can just create script like this, you can just create script like this, you can just create several clusters and then pull out the several clusters and then pull out the several clusters and then pull out the cube config files and share them with cube config files and share them with cube config files and share them with your students for example. And finally your students for example. And finally your students for example. And finally there this is also good for ephemeral there this is also good for ephemeral there this is also good for ephemeral dev environments. So you can create a dev environments. So you can create a dev environments. So you can create a cluster for a specific feature branch cluster for a specific feature branch cluster for a specific feature branch and then you can apply certain and then you can apply certain and then you can apply certain Kubernetes manifests to that feature Kubernetes manifests to that feature Kubernetes manifests to that feature branch based on the overlays using branch based on the overlays using branch based on the overlays using GitOps and customize. GitOps and customize. GitOps and customize. Then when you're done with working on Then when you're done with working on Then when you're done with working on that feature then you can delete the that feature then you can delete the that feature then you can delete the cluster. So it's very powerful where you cluster. So it's very powerful where you cluster. So it's very powerful where you can have a cluster dedicated to a can have a cluster dedicated to a can have a cluster dedicated to a specific feature branch that you're specific feature branch that you're specific feature branch that you're working on. if you are, for example, a working on. if you are, for example, a working on. if you are, for example, a developer working on multiple features developer working on multiple features developer working on multiple features and you want to have an environment and you want to have an environment and you want to have an environment that's tailored to that feature. So it that's tailored to that feature. So it that's tailored to that feature. So it it lets developers create isolated it lets developers create isolated it lets developers create isolated environments for each feature they're environments for each feature they're environments for each feature they're working on, test it, and clean up when working on, test it, and clean up when working on, test it, and clean up when they're done. So this is extremely they're done. So this is extremely they're done. So this is extremely useful if you are like me and you don't useful if you are like me and you don't useful if you are like me and you don't like to install things locally. You want like to install things locally. You want like to install things locally. You want to have things isolated and in control.

  12. to have things isolated and in control. to have things isolated and in control. K3D is a massive gamecher and I K3D is a massive gamecher and I K3D is a massive gamecher and I absolutely love it. I'm using it all the absolutely love it. I'm using it all the absolutely love it. I'm using it all the time now. So, if you want access to this time now. So, if you want access to this time now. So, if you want access to this file and get a list of all the commands file and get a list of all the commands file and get a list of all the commands that we just used, and if you want to that we just used, and if you want to that we just used, and if you want to get access to that script that I showed get access to that script that I showed get access to that script that I showed you, just jump into my CubeCraft you, just jump into my CubeCraft you, just jump into my CubeCraft community. It's all there and you'll get community. It's all there and you'll get community. It's all there and you'll get access to all of the courses and of access to all of the courses and of access to all of the courses and of course direct access to me and the course direct access to me and the course direct access to me and the community. You can ask me questions all community. You can ask me questions all community. You can ask me questions all day long and I'm also hosting Q&A calls day long and I'm also hosting Q&A calls day long and I'm also hosting Q&A calls every single week. So, thank you so much every single week. So, thank you so much every single week. So, thank you so much for watching. Hope to see you in crew for watching. Hope to see you in crew for watching. Hope to see you in crew craft and see you in the next

Summary

This tech transcript focuses on K3D as a tool for deploying local Kubernetes clusters for development and testing. It highlights the ease of installation, mentioning methods like curl and Brew, and the simplicity of creating a cluster with a single command that sets up Docker networks, a control plane, and load balancing. The practical takeaway is that K3D automates essential cluster components like core DNS, ingress controllers, and volume provisioners, making local Kubernetes environments readily accessible.

View original episode ↗