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!)
Kustomize is built into kubectl
and lets us maintain a common set of manifests while tweaking only the fields that differ between environments. The example configuration lives in the kustomize directory.
kustomize/
base/
api-golang/
Deployment.yaml
IngressRoute.yaml
Service.yaml
...
staging/
api-golang/
patches/
Deployment.yaml
IngressRoute.replace-host.yaml
kustomization.yaml
production/
...
Taskfile.yaml
The base folder contains complete manifests for each service. Staging and production overlays reference the base and apply small patches.
A production patch might update the replica count and image tag:
# production/api-golang/patches/Deployment.yaml
spec:
replicas: 2
template:
spec:
containers:
- name: api-golang
image: sidpalas/devops-directive-docker-course-api-golang:PRODUCTION_VERSION
Routing rules are patched as well. Because routes are defined in an array, we specify the index of the entry being replaced:
# production/api-golang/patches/IngressRoute.replace-host.yaml
- op: replace
path: /spec/routes/0/match
value: "Host(`kubernetes-course.devopsdirective.com`) && PathPrefix(`/api/golang`)"
Use kubectl kustomize
to build the manifests for an environment:
kubectl kustomize ./staging | yq
kubectl kustomize ./production | yq
The accompanying Taskfile.yaml
provides task render-staging
and task render-production
shortcuts. Once verified, deploy with kubectl apply -k <overlay>
.
Kustomize offers a lightweight approach to multi-environment deployments by sharing common configuration and patching only what needs to change. Arrays require a bit of manual work, but it's a great place to start.