Create App and Deploy to Kubernetes in less than 3 minutes !!! (Build Real-World Event-Driven Enterprise Microservices system from Scratch — Part 3 — Kubernetes)
You can watch this article here:
Today, let’s talk about something that used to make me a bit scared.I read a bunch of articles and books, but everything felt like a mystery.
Maybe because people said it’s really hard to learn.
Guess what? I cracked the code, and it’s not as scary as it seems.
Learning Kubernetes is like learning anything else — it takes a bit of time, but there’s no giant roadblock stopping you.
I want to share something cool
I totally recommend using Kubernetes for everything !!!
Yep, you heard it right
- Big and small apps
- For microservices and monoliths.
- For Enterprise projects as well as Hobby projects.
The best part?
You can write a deploy definition for your app or any part of it, and boom, you can deploy it anywhere.
There are many already prepared deploy definitions for almost every part of your application like PostgreSQL, Kafka, Mongo, and more.
I’ll show you Super simple Kubernetes deployment approach, just what we need for our project. Combine a few steps, and you’re good to go.
I’ll show you how to create a simple app and deploy it to Kubernetes in less than 3 minutes! Yep, you heard it right — 3 minutes. Ready? Let’s dive in!” 🚀✨
As I sad in previous session. These videos are gonna be a bit special.
Because
We’re gonna jump right into doing things first, and then we’ll chat about the theory stuff. It’s like learning by doing! .
The first step — Let’s run our Kubernetes one node cluster locally
- Install and run docker desktop — https://www.docker.com/products/docker-desktop/
- Go to settings
- Enable Kubernetes
- Install and Run lens as our UI for Kubernetes — https://store.k8slens.dev/all
- Run Lens and check your Kubernetes Cluster
- Create Kubernetes namespace:
kubectl create namespace salon
Namespaces — Is a space for our application
- Install Helm
https://helm.sh/docs/intro/install/
https://github.com/helm/helm/releases
- Try it from command line: helm version
helm version
Create Visual studio project with blank solution
- Disable https
- Enable swagger for all environments
Go to command line
Go to C:\…\…\Salon
run commands:
docker build -t salonapi:1.0 -f "src/Salon.Api/Dockerfile" .
md deploy/charts
helm create .\deploy\charts\salon
code ./deploy/charts/salon
Optional (Install Visual studio Code Helm extension)
- Delete Template, Values, Tests
- Update Values
— salonapi
— Never
— 1.0
— Port 8080
Update deployment probes: /swagger/index.html
Run from command
helm install salon ./deploy/charts/salon -n salon
Do port forward
Everything is explained in more detail in this video: