Evolution of application deployment over the past 20 years.
Configure your local and remote lab environments.
Covers the resource types that are included with Kubernetes.
•Pod
•Job
Using helm to manage Kubernetes resources
Example microservice application.
Kubernetes manifests to deploy the demo application.
Explore how custom resources can add functionality
Install additional software to enhance the deployment.
Improving the DevX when working with Kubernetes.
How to safely upgrade your clusters and nodes.
Implement CI/CD for your applications (with GitOps!)
Labels and annotations are key-value metadata stored under the metadata
section of most Kubernetes resources. They look similar but serve different purposes:
Service
uses label selectors to choose which Pods
it routes traffic to. Labels are also convenient when filtering kubectl
output.Below is an excerpt from the example Service/Deployment.yaml
in the course repo showing labels and annotations at multiple levels:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-minimal
labels:
foo: deployment-label
annotations:
bar: deployment-annotation
spec:
replicas: 3
selector:
matchLabels:
baz: pod-label
template:
metadata:
labels:
baz: pod-label
annotations:
bing: pod-annotation
spec:
containers:
- name: nginx
image: nginx:1.26.0
The accompanying Service.nginx-clusterip.yaml
uses a label selector to target these pods and also contains its own labels and annotations.
We will deploy the sample from the 04-built-in-resource-types/Service directory and explore how labels and annotations behave.
# task 01-create-namespace
# - Create the namespace for these examples and set it as default.
cd 04-built-in-resource-types/Service
task 01-create-namespace
# task 02-apply-deployment
# - Deploy the example Deployment
task 02-apply-deployment
# task 03-apply-clusterip-service
# - Deploy the Service that selects pods via a label
task 03-apply-clusterip-service
# Get pods with the "baz=pod-label" label
kubectl get pods -l baz=pod-label
# Show labels on the Service
kubectl get service nginx-clusterip --show-labels
# Add a custom annotation to the Service
kubectl annotate service nginx-clusterip devops-directive.com/purpose=demo
# View annotations on the Service
kubectl describe service nginx-clusterip | grep -A2 Annotations
# task 06-delete-namespace
# - Delete the namespace to clean up
task 06-delete-namespace