Crazy fast Kubernetes Automation with Terraform
Вставка
- Опубліковано 21 лип 2024
- In this video, we deploy a HA Kubernetes Cluster in the Cloud and run some workloads on it. I've created a template for Kubernetes, Traefik, Cert-Manager and SSL Certs and DNS Records all in Terraform. This will also show how to combine multiple workloads and providers in one automation script. #Kubernetes #Terraform #CIVO
Project Files: github.com/christianlempa/boi...
Terraform Tutorial: • What is infrastructure...
Helm Tutorial: • Package Management wit...
Traefik Tutorial: • How to use Traefik as ...
Cert-Manager Tutorial: • Free SSL Certs in Kube...
CIVO-*: civo.com/thedigitallife
Follow me:
TWITTER: / christianlempa
INSTAGRAM: / christianlempa
DISCORD: / discord
GITHUB: github.com/christianlempa
PATREON: / christianlempa
MY EQUIPMENT: kit.co/christianlempa
Timestamps:
00:00 - Introduction
00:57 - What tools we use
01:33 - Project Overview
04:00 - Advertisement-*
04:37 - Create the Kubernetes Cluster
10:18 - Deploy Software on Kubernetes
13:27 - Deploy Traefik and Cert-Manager
16:45 - Deploy DNS and Certificates
21:31 - Deploy a test application
24:42 - Summarize and test
________________
All links with "*" are affiliate links.
Fantastic video, this gave a nice run down of how all the components are connected together. Keep up your great work.
bloody hell! and sooo awesome. Fantastic video! Love the speed of delivery and single command deployment solutions
Thank you very much!
Hi, Christian Great video , thank you so much for sharing🙏👌
Awesomejob, keep up the quality content. 🙂
Thank you! Will do!
Nice work Christian! Great video!
Thank you! :) I've learned so much about Kubernetes with the help of your videos!
@@christianlempa That's awesome! Glad they helped!
Though I like this video, the pace is so high that anything meaningful is lost. Pure entertainment is the highest outcome of this.
Incredible video! I’m totally going to be forking this one and putting my own spin on it. Very nicely done!
Thank you! :)
why use Terraform when you can do all by Rest APIs ?
@@mchannel1365 why implement what terraform does when you have terraform?
Hi. I've just started to learn DevOps. Your video is great. Explanation is super.
Thank you so much 😃
This is really awesome, thank you so much for sharing ;)
Thank you so much! And also for your help with that :D
@@christianlempa You are always welcome ;)
Thanks for the high quality videos.
You’re welcome ☺️
Great video! I never messed with the time_sleep resource, very cool.
Nice shirt! Where do we get it at?
Great to hear!
awesome video, a lot of effort but well worth it. Thank you for video.
Thanks 😊
The kubernetes terraform provider introduced a kubernetes_manifest resource a while back. I think it’s a better choice than the kubectl provider especially because it’s more readable (not just a single multiline string) and it’s an official provider (in contrast to the third party kubectl provider).
Nice, I didn't know that
Perfect channel for professionals.
Thanks ;)
-Interesting videos as usual, many thanks :)
you're welcome :)
Thanks. Simple to follow.
Thanks for watching :)
excellent video! thank you.
Thank you! :D
you could create a custom helm chart for these yamls and deploy the argocd on you cluster, this is a MUST have! you gonna love it
Sounds like a great idea, currently learning CI CD is one of my topics to learn for this year.
Could you please elaborate on this? I would love to implement your idea, but I need more clues to start. Thanks.
man, you are the best👍 thanks
Very nice video, impressive!
Thank you very much!
love the drawings in your videos, is that just an ipad app and you are screen capturing the ipad?
Thanks ;) It's just my Samsung Galaxy Tab as an external screen and recording in OBS
Amazing! Thank you!
Thank you too!
Great video as usual. Just wondering if some of the new features of latest Terraform versions like pre and post conditions could solve some of the timing issues you mentioned and therefore get rid of the timers ;-)
Thanks for the idea, I think that would be great to solve some of the problems here ;)
Thanks for the high quality content.
There's one thing I would like to ask. Does teraform have any kind of code encrypting/compiling function so that people got the encoded copy they cannot read the source code but able to run it.
while running terraform plan, you can add -out with output file like "terraform plan -out kubclt" and you can run "terraform apply kubctl"
Yes the terraform plan provides the binary to run and configure your infrastructure
Bro....awesome
..ty
Great Works!!!!
Thanks!
Lovely mate..
Thank you! Cheers!
Great video with a lot of good detail! I'll say though Terraform is great at a lot of things except for Helm deployments...very static compared to something like ArgoCD.... ask me how I know.
Thanks! :)
16:00 you can use both atomic and wait equals true on the cert manager helm release and evict a time_sleep resource
Thanks mate!
This is super cool. Could you please make it a little more sophisticated using redis, postgresql ha, minio and perhaps argocd to deploy an app repository?
Wow, Argo CD that's something I don't know anything about :D It's on my list to learn for this year.
F#%^ing awesome. Thanks for sharing 🤗
Glad you enjoyed it
So I haven't been able to find a good answer for this online. When is it appropriate to run ingress on bare metal/ terraform versus through the ingress controller object in Kubernetes?
Or was this actually a k8s object since it got run through a helm chart?
Great Video!
I hope somebody can help me to solve this issue and understand how to implement the best approach. I have a number of situations where I need to retry a task n-times if it fails.
My ask is, I need help writing a Terraform module to monitor an azure task which is to restart it in case it encounters an exception. retry logic). If an exception is thrown, the task should be retried up to the max-retry count.
Very informative. I tried to create a GKE auto mode cluster with a shared VPC network(private IP range), and assigned necessary IAM roles to the GKE hosted service project with (compute.engineadmin and container.admin roles). While provisioning the gke auto pilot cluster, getting this exception as - " Error: Error waiting for creating GKE cluster: All cluster resources were brought up, but: only 0 nodes out of 1 have registered; cluster may be unhealthy." Verified the logs for any key findings, but not helpful. Any thoughts/references on this error scenario to troubleshoot ??
My head just got terraformed 🤯
why not to let traefik to do certificate stuff?
Nice Video! However, try not to use the „depends_on“ keyword, but instead you should reference the dependent resource. For the „helm_release.traefik“ resource you should set „namespace = kubernetes_namespace.metadata.0.name“. This way terraform can figure out the dependencies automatically and most importantly you don’t repeat yourself (i.e. when changing the namespace name you only need to change it in one location).
Using „depends_on“ is not a good practice, and you will thank me once you terraform codebase reaches a certain size.
Yeah terraform will implicitly wait for the value you have referenced
Thank you, that's such a great tip ;)
What is this vscode theme that you uses ?
Please make a video of deploying eks cluster using Terraform
this is amazing, really help on traefik part as i was trying to do same with AKS , can you share refence link for traefik for the helm parameter in terraform?
Thank you so much! Which reference do you mean?
@@christianlempa the parameter for traefik helm chart in terraform like this one
set {
name = "ingressClass.isDefaultClass"
value = "true"
}
ok first of all, GREAT RESOURCE!, Thanks!
I have some trouble converting this to a non-civo based cluster (I run on Azure). Could you tell me how the cluster knows to connect the loadbalancer to traefik ? Can this be forced ?
Hey mate, sorry I only have done it on Civo. I guess it depends on the Terraform Provider for Azure how to do that, but they should have a similar config.
@@christianlempa thanks!
you dont have the Terraform for create the cluster Kubernetes on Premises (no cloud) ?
Amazing
Thanks
you can also terraform virtio which I found nicer (I think everyone would have their own opinion about this) than proxmox for local projects
man, my love for terraform exceeds love for myself
Hey Christian! Great video as always!.
I have a video request showcasing the proper way to setup WordPress with SSL using Nginx which is reverse proxying to an Apache back-end. I'm really stuck from 2 days and not much help online on the forums.
Would really love it if you make an in-depth video with SSL in the picture with WordPress.
At some point i had WordPress pages working but i couldn't login to wp-admin as it always told "you are not authorized to access this page". All permissions are setup correctly. It was working before with Apache. I believe it has to do something with the reverse proxy which messes up wp-admin dashboard.
Hoping to get a solution from you!
As always Thanks a bunch!
I currently have too many projects to do. But I will at some point look into that. However I plan a slightly different setup with an HA PHP-FPM based setup of wordpress on Kubernetes. Will be a bit of a challenge 🤣
So if you can use terraform to create tbe resources, and kubernetes to orchrstrate the deployment, with Argo CD to build the solution after tested development... doesnt this make it a No Ops architecture?
Curious: why did you set "proxied" to false at the last step (nginx DNS record)? Any particular reason or didn't that matter to you in that case?
Mainly to show how the cert-manager certificate is working.
@@christianlempa ahhh good point.
may I know which tool you are using for that handwritten visualizations ?
I think that time I was using explain everything, now I’m using excalidraw
Give us an OpenTofu tutorial next!
How do I get ahead at work if everyone they hire or that remains in a similar position knows more than I do? Room full of engineers I'm the newest and dumbest, currently a hiring spree these new people know way more than I do leapfrog over me for raises and promotions
Man I wish someone would show us how to deploy multiple gcp backend services, setup ingress and load balancer and then setup proper custom domains with either Terraform or Pulumi. Could start with a Cloud run example.
You can do it Sean!
@@bmejia220 if someone would actually show the end to end solution I can probably do it ;)
How to run this via cloudbuild yaml
This project can be applied in On-premises?
The projects would need some adjustments, but you could in theory use the same tools, yes.
Can you do a video on Harvester
Not in the near future, maybe I'll do at some point.
Very funny Christian , "If that does not sound very interesting to you, then I don't know what you are doing here?", well kind sir, I was enjoying a cup of French Coffee with an English friend of mine, in an Antwerp Coffee shop when I heard a knock on the door, and voila there was this guy called Christian, peddling software and I thought to myself , "It is probably going to be more interesting listening to him than trying to understand the Englishman's DRY sense of humor, and we speak IT does not matter where you from. I can even watch a Polish IT guy on UA-cam and just by the way he pulls his face and angrily points at a non existing point in the sky I instinctively know he is getting problems from a Load balancer somewhere in Das Bundesrepublik and there is a Data Center in Berlin that is guarded by a guy called Christian Lempa who does not want to give him access the iDRAC on his New Dell.
What?
Now do one for OpenStack!
Don't you need 3 nodes for it to be HA?!
Once again, can you share the code....?
It's on my GitHub
It's just me or he put a frame with a clown at 20:10?
That’s my desktop wallpaper sneaking in xD
“Deploy in seconds”
Got tired of UA-camrs making the same videos about the same tech + in a narrow window while there is so much news and improvements made. Sad to unsubscribe those who had a good start. but failed along the way...
M
Pretty homosexual thumbnail but the content of the video is on point. Good job my man!
i want to like this stack, but this is just a horrible way of doing things, a cake with a million layers of abstractions and code everyone uses with zero understanding of inner workings.
so a simple task of deploying a binary becomes an insane mashup of CRAP that nobody needs.
Using Terraform for such things is a really bad idea. Overly complicated, unmaintainable and inflexible. Terraform is for creating VMs, volumes and stuff. It's a not configuration tool.
Thanks!
Thank you so much for your support ❤️👏