Creating k8s workshops with Traefik and GitOps
Lucas Käldström - CNCF Ambassador
28th of October, 2020 - Traefik Online Meetup
Image credit: @ashleymcnamara
$ whoami
Lucas Käldström, 2nd-year student at Aalto, 21 yo
CNCF Ambassador, Certified Kubernetes Administrator and Kubernetes WG/SIG Lead�
KubeCon Speaker in Berlin, Austin,
Copenhagen, Shanghai, Seattle & San Diego
KubeCon Keynote Speaker in Barcelona�
Former Kubernetes approver and subproject owner, active in the community for 4+ years.�Worked on e.g. SIG Cluster Lifecycle => kubeadm to GA.
�Weave Ignite author
Cloud Native Nordics co-founder & meetup organizer
Educators, hands up!
“Tell me and I forget,
teach me and I remember,
involve me and I learn.”�-- Chinese proverb
#CloudNativeNordics
MAP
4
IT’S NOT ONLY ME!
5
Foto: Torstein Lund Eik
@phennex & @kubernetesonarm
#CloudNativeNordics
Agenda
6
Have you wanted to teach cloud native?
Enter, workshopctl, browser-based goodness
User-specific domain
Pre-populated
tutorials!
Cluster shell with kubectl, docker, helm
K8s syntax highlighting
What? How?
Requirements for the solution
Problem solved!
Architecture
Kubernetes Cluster XX in DigitalOcean
Kubernetes Cluster 02 in DigitalOcean
Kubernetes Cluster 01 in DigitalOcean
1xDroplet
$20-80/month
Droplet
DigitalOcean LoadBalancers
Traefik
Internet
Traefik
Namespace: default
nginx Ingress Rule
nginx Service
nginx Pod 1
nginx Pod 2
nginx Pod 3
nginx Deployment
Traefik Service
Type=LoadBalancer
$10/month
Public IPv4
DO Domains
Ingress Rules
traefik.@
@
podinfo.@
UI
<user-def>.@
Let’s Encrypt DNS-01 ACME
external-dns
Deployments/Pods
TXT _acme-challenge.traefik.@
TXT� _acme-challenge.@
TXT _acme-challenge.podinfo.@
code-server
TXT / A DNS records
podinfo
podinfo
podinfo
A �@
A�traefik.@
A�podinfo.@
Why Traefik?
Traefik UI, API and metrics available!
Just visit traefik.cluster-XX.{my-domain.com} and input password!
workshopctl workflow
15
@luxas / @kubernetesonarm
#CloudNativeNordics
workshopctl directory layout
@luxas / @kubernetesonarm
#CloudNativeNordics
workshopctl architecture
@luxas / @kubernetesonarm
#CloudNativeNordics
workshopctl architecture
@luxas / @kubernetesonarm
#CloudNativeNordics
What I have learned
@luxas / @kubernetesonarm
#CloudNativeNordics
Economics Breakdown
Say theoretically you want to organize a�workshop for 40 persons for 4 hours.�
You should at least expect the clusters to be�running for 6 hours in the best case (need to provision a bit before due to DNS).��$40/month for 1 Droplet => $0.060/hr * 6 hours * 40 persons = $14.4�$10/month for 1 LB => $0.015/hr * 6 hours * 40 persons = $3.6
Total: $18 per workshop (45c/person)
Traefik makes you need only one LB.�DigitalOcean doesn’t charge for the Kubernetes control plane.
DigitalOcean doesn’t charge for managing the domain records.
vCPUs | RAM | Dedicated | Price/month |
2 | 4 | No | $20 |
4 | 8 | No | $40 |
2 | 4 | Yes | $40 |
4 | 8 | Yes | $80 |
How bring this to an online audience?*
*Disclaimer: I haven’t actually run workshops of this exact sort purely online yet.
Questions?
If you want an example run-through of this workshop, you can find the recording here.
Thank you!
@luxas on Github
@kubernetesonarm on Twitter
lucas@luxaslabs.com