
Learn how Kubernetes evolved from Google's Borg to simplify container orchestration for distributed systems, using Linux containers and microservices to improve scalability and fault tolerance.
Turn a monolith into a distributed system by adopting loosely coupled microservices that communicate via APIs, enabling independent deployment, scale-out with containers, and technology-agnostic service boundaries.
Explore how containers sandbox a process, offering isolation and encapsulated dependencies for repeatable deployments across environments, with faster startup and vm-like isolation, compared to virtual machines.
Compare virtual machines and containers to reveal differences in isolation, startup speed, and resource use, driven by namespaces, cgroups, and shared kernel, and show how Kubernetes optimizes containerized microservices.
Discover how kubernetes automates scheduling, self-healing, and scaling for containerized apps, with built-in load balancing and health checks. Learn to manage secrets and abstractions across clusters.
Identify the two Kubernetes user roles: administrators and regular users, and focus on how regular users create and manage containerized applications. Learn to use Kubernetes to build reliable containerized apps.
Explore Kubernetes cluster architecture, including master and worker nodes, the control plane, scheduler, and API server, plus node components like kubelet and kube-proxy.
Build a quick foundation for learning Kubernetes, including a Docker crash course, setting up a cluster on Minikube and Google Kubernetes Engine, and a YAML crash course.
Discover how Docker packages, distributes, and runs applications and their dependencies using images and containers. Understand image registries, public and private options, and how Docker simplifies creating Linux containers.
Explore Docker's client-server architecture, where the Docker client acts as the command-line interface and the dockerd daemon runs containers and builds images under the client's direction.
Install Docker and run the truek8s/print-big container to see how docker run interacts with the daemon, image cache, and Docker Hub to print a large hello world.
Learn how Dockerfile acts as a recipe for building a Docker image, using instructions like FROM, COPY, RUN, EXPOSE, ENTRYPOINT, and CMD to package a Node.js greeting-server and run containers.
Demonstrate building a docker image from a dockerfile using the build context and COPY rules, tag it with repository:tag, push to a registry, and run with port mapping.
Install and compare Minikube and Google Kubernetes Engine to gain hands-on experience with a robust, scalable Kubernetes setup, preparing you to use Kubernetes for multi-container applications.
Install minikube to practice Kubernetes on your computer, following the official Kubernetes docs for your OS, and install kubectl. Start minikube, verify with kubectl cluster-info, and stop when done.
Learn how to create and delete a GKE cluster from a Google Cloud Platform account, switch kubectl to the new cluster, and reset back to Minikube.
Explore how Kubernetes components and containers fit together and learn to define them with YAML config files, reviewing YAML basics and component roles.
Learn how YAML comments use # with surrounding whitespace, indent with spaces, and use triple dashes to start documents, with optional dashes for a single document.
Learn how YAML relates to JSON by converting a JSON-style car object into YAML, removing quotes and braces, and using YAML maps to simplify keys while preserving meaning.
Explore arrays in yaml by converting a json-style array of mammals into yaml, using inline array format, unquoted keys, and minus-prefixed elements, and separating cars and mammals into distinct documents.
Wraps up the key yaml features. Prepares you to learn Kubernetes, with a preview of the next chapter on pods and containers.
Explore how a Kubernetes pod groups one or more containers, runs them on the same node, and ensures they share fate as the smallest deployable unit.
Explore pods in Kubernetes: each pod has a unique cluster IP and shared ports for its containers, with optional volumes, and decide when to group containers in one pod.
Create a Kubernetes pod from a YAML config, focusing on apiVersion, kind, metadata, and the spec with containers and image. Copy and modify configs, apply labels, and ensure container names.
Start a Minikube cluster and create the primes pod with kubectl create -f config file, then verify with kubectl get to read name, status, age, ready, and restarts.
View the primes container logs as a Python script prints the first thousand primes; use the logs command with a Kubernetes object type/name and --follow for real-time output, then ctrl-c.
Learn how the create command accepts YAML and JSON config files to deploy a primes pod, remove duplicates with the delete command, and recreate using the JSON config.
Use the get command to print a cluster object in JSON or YAML, revealing apiVersion, kind, metadata, spec, and status for debugging the cluster.
Explore how the restart policy governs pod container restarts in Kubernetes, with always, onfailure, and never, plus exponential back-off up to five minutes, reset after ten minutes of success.
Describe pod termination in Kubernetes, where Kubernetes sends TERM signal for shutdown, enforces a 30-second grace period, then uses a KILL signal if needed, and retries delete operation after interruption.
Configure the graceful shutdown period when deleting a pod, such as 56 seconds, and use --force with grace period 0 only as a last resort.
Explore how to configure containers in pods and distinguish Dockerfile instructions such as entrypoint and cmd to tailor container behavior.
Configure the default command for a container by specifying the command array, which overrides the container's entrypoint. Use args field to override cmd, with examples like hello-world on Alpine Linux.
Discover how to run shell commands in Kubernetes pods by explicitly invoking a shell with the -c option to execute a loop, ensuring the commands array runs as intended.
Kubernetes enables per-container environment variables to separate config from images, using the config file's env for cluster-specific values like MySQL host and port, usable by programs or in commands.
Learn how init containers run in sequence to initialize before the pod’s app containers start, and how app containers run in parallel once init completes.
Init containers run prestart steps and wait for other components and services to start, while isolating credentials and dangerous utilities from app containers to improve security.
Explore init container examples with one app container and two init containers, view pod status and logs, and learn that logs target a specific container with the -c flag.
Learn how to stop a minikube cluster to release resources and preserve the same Kubernetes objects, or delete it to start with a completely clean cluster.
Conclude this chapter and preview the next topic: naming, selecting, and grouping Kubernetes objects. See you there.
Explore how Kubernetes names and labels let you select and control components with kubectl, illustrated by primes pod and my-rs replica set. Ensure names stay non-empty and spatially unique.
Understand how Kubernetes uses the name field in the metadata section for human-readable, idempotent object naming, and how system-generated UIDs provide cluster-wide uniqueness for true identification.
Use the get command to print an object's UID from the output, where the UID appears; note that UIDs are hard to remember and you probably won't use them often.
Discover how labels group Kubernetes components using key-value pairs in metadata, enabling feature-based selection (for example, the app label) while avoiding names in labels and using annotations for large data.
Practice selecting pods using labels with kubectl get, show-labels, and -L or -l flags. Learn old-style and new-style selector fields, including matchLabels and matchExpressions, and build set-based queries.
Learn how annotations differ from labels by storing key-value, non-identifying metadata such as build versions and team contacts, and see how clusters use them.
Partition a single Kubernetes cluster into virtual namespaces to create isolated dev-team workspaces with resource quotas, and use labels rather than namespaces for versioning.
Use kubectl to manage namespaces by creating dev, qa, and prod, targeting with -n or --namespace, listing across all namespaces with --all-namespaces, and deleting a namespace to remove its objects.
Create and manage Kubernetes namespaces from config files, such as example-ns.yaml, and place resources like the orca pod in the specified namespace.
We have finished this chapter. In the next chapter, I’ll teach you about controllers—it’s going to be good.
Discover how Kubernetes controllers monitor pods and ensure the right number of them run by scheduling replacements, with three controller types to create and use.
Learn how a replica set maintains the desired number of pods with a pod template and replica count, replacing failed pods and deleting extras using apiVersion, kind, metadata, and spec.
Pods matching a replica set’s label selector are managed by that replica set, risking conflicts when two sets select the same pods; ensure unique pod labels for each controller.
Compare pod labels with replica set labels, noting they can be identical or different, and that the two label sets are completely unrelated.
Ensure a replica set pod uses the restart policy value Always, the only sensible choice to keep a defined number of pods running.
Create replica sets like other Kubernetes components; verify running status and pod readiness; my-blog replica set pods have names formed from the set name and a short random string.
Scale a replica set up or down with the scale command, specifying the desired pods with --replicas and targeting the controller with -f, then verify.
Delete a replica set and observe that its pods are removed as well, illustrating the linked lifecycle of replica sets and pods.
Running a single pod without a controller leaves it vulnerable to crashes and evictions. Always use a controller to create pods, even if only one.
Understand why replication controllers are legacy and deprecated, lacking set-based label selectors. Compare them to replica sets, which support both label-based and set-based selectors, and avoid replication controllers.
Deployments create replica sets behind the scenes, letting you update pods without downtime and roll back when needed; prefer deployments over replica sets.
Create a deployment and review its config alongside a replica set. Verify pod counts, readiness, and current pod template usage, and understand the replica set naming scheme.
Scale a deployment with the scale command to reduce replicas from 3 to 1, then edit the object in the default editor; updates apply to the cluster, not config file.
Master Kubernetes' describe command to inspect a deployment in detail, including name, namespace, creation time, labels and annotations, label selector, replica state, container image, and events for debugging.
Learn how deployments update pods on the fly with automatic rollouts, replacing old replica sets by adjusting the pod template and image version, all without downtime.
Explore deployment strategies in Kubernetes, contrasting rolling update and recreate methods. Learn how maxSurge and maxUnavailable control pod rollout, including absolute and percentage options and defaults.
Master the rollout command and its five sub-commands—history, pause, resume, status, and undo—to monitor deployment progress, troubleshoot image pull issues, and revert to prior revisions.
Use daemon sets to run exactly one pod per node for daemon processes, enabling per-node log aggregators like Fluentd and Logstash and distributed storage systems such as Ceph and GlusterFS.
Explore daemon sets versus deployments to run pods across nodes. Daemon sets ensure every node runs one pod, adapting to added or removed nodes, a unique capability deployments lack.
Explore the basic daemon set controller, compare it to deployments, and note that daemon sets lack a replicas field.
Deploy a daemon set on a three-node GKE cluster, switching kubectl contexts, and verify each node runs one daemon pod using kubectl get pods -o wide.
Delete a daemon set using the same process as other controllers, and know that deleting the daemon set also removes its pods.
Discover how daemon sets in Kubernetes schedule pods across nodes and how to constrain them to specific nodes using advanced scheduling.
Delete the GKE cluster after finishing the daemon set, then reset kubectl to the Minikube context by listing contexts, switching back, and removing the old GKE context.
Understand how daemon set pods bypass the kube scheduler and are placed at creation time, enabling daemon sets to start during cluster boot up.
Wrap up this chapter, thank viewers for watching, and say you’ll see them in the next chapter.
Discover how Kubernetes simplifies networking with clusterIP and a flat address space, removing port mappings and NAT, while the service component fixes unreliable direct pod communication.
Explore how a Kubernetes service acts as a proxy for pods, forwarding traffic to backing pods, while providing abstraction, a stable ClusterIP, and layer 4 load balancing.
Deploy three joke-generator pods behind a cluster-ip service, exposing port 3000 to serve JSON jokes with setup, punch line, and the generating pod IP across the replicas.
Learn how to explicitly set a service's clusterIP by adding the clusterIP field in the config, using a 10.96.0.0/12 range, and why auto-assignment avoids conflicts.
Explore how Kubernetes uses port and targetPort to separate the client-facing port from the pod target port, and learn how to configure a service and its ports.
Discover how DNS as an optional cluster add-on enables deterministic service domain names and test cross-namespace access by curling the joke-generator from an indigo namespace.
Explore how Kubernetes exposes service discovery through environment variables that encode a clusterIP service's IP and port, and test with a curly pod, joke-generator deployment, and curl.
Build on clusterIP concepts and learn how to expose applications beyond the cluster with externally-routable services in Kubernetes.
Expose a NodePort service externally by opening the same port on every node, so external clients reach the service with traffic routed like a ClusterIP service.
Learn why a NodePort service exposes a cluster service to outside traffic and can spread traffic across nodes with an external load balancer, while remaining simple to set up.
Turn a ClusterIP service into a NodePort by setting the type to NodePort in the 30000–32767 range. Test with Minikube IP and curl, then use connection=close to ensure load balancing.
Specify a nodeport value by adding the nodeport field to the config file, but invalid values prevent service creation; typically, let Kubernetes allocate the node port.
Learn how loadBalancer-type services expose a cluster via an external load balancer with a public IP, demonstrated by creating a GKE cluster, a joke-generator deployment, and testing with the IP.
Discover how to use a Kubernetes service in front of external objects with no-selector services, proxying a legacy database outside the cluster so test and production client code stay unchanged.
Discover how Kubernetes endpoints map a service to IPs and ports, and how to use a no-selector service with a manually created endpoint for an external IP.
Explore a user-defined endpoints example in Kubernetes by connecting a Vault web server to an external Redis-based session cache, using service and endpoints alignment, nodeport exposure, and cookie-based authentication.
Learn how Kubernetes session affinity enables client-IP based sticky sessions to keep a user logged in by routing requests to the same pod, using a sidecar Redis cache.
Configure a Kubernetes service with multiple ports by naming each port to clearly disambiguate endpoints.
Conclude this chapter and thank learners for watching, then invite them to the next chapter on Kubectl commands.
Master kubectl by exploring in-depth, practical commands you will actually use in the wild, with review on familiar commands and new tips.
Explore three equivalent Kubernetes command formats, including the -f option with a config file, and formats using the object type and target name; choose the style you prefer.
Learn how Kubernetes objects use type names recognized by kubectl, and when abbreviated names simplify command typing. Explore examples of object types and how abbreviations reduce keystrokes.
Apply a single command to multiple Kubernetes components by listing them as arguments, reducing typing when deleting several resources—across different types, such as pods and deployments.
Use the replace command to fully substitute the my-blog deployment with a new config, and the patch command to adjust replicas using JSON or YAML patches (prefixed with $).
Master Kubernetes declarative workflows with the Kubectl apply command. Learn how apply performs a three-way diff using last-applied-configuration to selectively patch objects and avoid deleting system-added fields.
Learn to use the create command to build Kubernetes components from local or URL config files and deploy many at once with a YAML file or a directory using -R.
List pods and daemonsets in a namespace with the get command in wide format, watch readiness, and sort by startTime using a JSONPath expression.
Master Kubernetes delete commands by removing single objects with type and name or with -f and a config file; delete all objects of a type in a namespace.
Explore the attach command to connect your terminal to a pod's container, streaming stdout and stderr, selecting a container with -c, and enabling stdin and tty for interaction.
Master the kubectl exec command to run utilities like ifconfig or start an interactive shell inside a running pod’s container, using a double dash for options on the popcorn pod.
Learn to use kubectl cp to copy files between a local machine and a pod, including the -c flag for multiple containers, target pod and path, and tar is installed.
Master port-forward to test Kubernetes pods and services locally by forwarding a local port to the joke-generator pod, then to a service, validating debugging and testing workflows.
Use the top command to monitor resource usage for pods and nodes, such as a pod's memory or a node's CPU, via the metrics server on Minikube.
Wrap up this chapter and preview the next chapter's pod and container topics, including health checks and lifecycle hooks.
Discover how container probes in Kubernetes determine container health and automatically kill and replace unhealthy containers with a clone, preventing zombie containers from going unnoticed.
Probes act as health checks for containers, indicating whether they are alive and healthy or ready to receive traffic, with the Kubelet executing a probe handler defined in pod config.
Master Kubernetes health checks by learning three probe handler types: exec action, http get action, and tcp socket action, including success and failure criteria for each.
Explore liveness and readiness probes in Kubernetes, showing how liveness restarts containers, and how readiness removes a pod's IP from endpoints to stop traffic during temporary unavailability.
Explore how the execAction liveness probe in Kubernetes uses a script to create and delete a healthy file; three consecutive failures trigger a pod restart.
Configure liveness probes in Kubernetes by adjusting failureThreshold, successThreshold, and probe timeouts; defaults are three, one, and one second, with timeouts yielding an unknown outcome and no action.
Explore how an HTTPGetAction liveness probe works by using a Node.js server on port 8080 with a /health endpoint, and observe restart behavior when 500 errors occur.
Demonstrate how a tcpSocketAction liveness probe checks a container by opening a tcp socket on port 7777, using a Python socket server to simulate healthy and deadlocked states in Kubernetes.
Explore readiness probes in Kubernetes by testing a two-pod http-readiness-example deployment with a /ready endpoint, liveness probe, and a nodeport service, and observe how uploading config data temporarily routes traffic.
Discover how Kubernetes containers use two lifecycle hooks, postStart and preStop, to run code at crucial events, with asynchronous postStart execution and graceful preStop termination before the pod ends.
Learn how lifecycle hooks trigger hook handlers in Kubernetes, using exec commands or http GET requests to containers, including host pod paths and ports for http servers.
Explore how an nginx pod uses postStart and preStop exec hooks to customize the homepage, run cleanup, and test via port-forward to localhost:8080.
Discover the standard format for an httpGet lifecycle hook in Kubernetes, and learn that the setup is straightforward and simple.
Explore how hook handlers affect pod states: a postStart hang blocks reaching running, while a preStop hang leaves the pod in terminating until terminationGracePeriodSeconds passes, typically 30 seconds.
Diagnose lifecycle hook issues by inspecting pod events, since hook output doesn't appear in container logs. Describe the pod to view events and identify warnings like a slow preStop hook.
Learn how hook delivery guarantees work in Kubernetes: a hook runs at least once, may run again, so the handler must be idempotent; preStop will not redeliver after a failure.
Conclude the introductory course on Kubernetes and preview the next topics, including volumes, StatefulSets, Secrets, and Horizontal Pod Autoscalers, with a bonus video and potential discount on the next course.
Explore Kubernetes fundamentals and advanced features—volumes, deployments, jobs, cronjobs, stateful sets, secrets, configmaps, ingress, network policies, autoscaling, resources, and the web user interface.
What is Kubernetes?
When you run a server in production, how do you handle problems such as...
hardware failures
application crashes
spikes in user demand
updates and redeployments of your application
automatically managing any number of Docker containers
migrating to completely different data centers or cloud providers
Sure. You could handle these problems using a collection of utility programs and custom infrastructure code. But that's a lot of work.
On the other hand, you can package your application in Docker containers and run those containers in Kubernetes!
The combination of containers and Kubernetes frees you from creating lots of infrastructure to manage your applications running in production.
That's no small thing.
So what is Kubernetes?
Kubernetes is a container management system.
Kubernetes makes your containerized applications highly reliable.
It reduces the number of damage control incidents and late night emergency phone calls from work.
Why Learn Kubernetes?
Kubernetes helps you manage your application in production by providing...
automatic crash recovery
built in load balancing
horizontal scaling using a single command
upgrade your app while maintain 100% uptime
revert without any downtime
simple service discovery
automatic container scheduling
secret data management
Kubernetes has a pluggable (customizable) architecture.
It abstracts away the underlying hardware.
It is open source (no vendor lock-in).
It's very popular—and growing more so every year.
What is Nick's Teaching Style?
Every lesson follows a four-part philosophy. I'm going to teach you...
what you're about to learn
why it's important
how to code it up and use it
which corner cases and caveats that you need to be on the lookout for
The course contains lots and lots of examples. They are designed to be...
interesting and entertaining
concise and to the point
clear and without any unnecessary complications