Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Awesome Kubernetes | 14,249 | 8 days ago | 7 | other | Shell | |||||
A curated list for awesome kubernetes sources :ship::tada: | ||||||||||
Productsstoreonkubernetes | 87 | a year ago | 2 | HTML | ||||||
Demoing deployment of Docker containers into Kubernetes for both minikube and Azure AKS. | ||||||||||
Dynamic Pv Scaler | 80 | 3 years ago | 2 | apache-2.0 | Go | |||||
A golang based Kubernetes application which can scale volume dynamically | ||||||||||
Dev Services | 47 | 4 years ago | Shell | |||||||
Aks Learning Series | 27 | 3 years ago | 1 | gpl-3.0 | C# | |||||
Repository for Code related to AKS learning series Hands on Labs | ||||||||||
Quickstart | 24 | 3 months ago | 2 | HCL | ||||||
Quickstarts to provision Kubernetes with Otomi | ||||||||||
Core | 21 | 3 years ago | apache-2.0 | Python | ||||||
a robot management platform based on FIWARE and Kubernetes. The latest version conforms to FIWARE Release 7.8.1 | ||||||||||
Webinar Kubernetes Api Gateway | 19 | 6 years ago | JavaScript | |||||||
Microservices with Node.js and Kubernetes | ||||||||||
Melonkube | 9 | a year ago | mit | Shell | ||||||
Kubernetes Playbook by cloudmelon | ||||||||||
Dapr Microservices | 7 | 3 years ago | 32 | mit | TypeScript | |||||
Leverage the power of Dapr to build microservices on AKS |
This is a sample application used to demonstrate how to create dockerized apps and deploy them to Kubernetes cluster.
It takes a sample ASP.NET Core MVC app, creates its Dockerfile, then the Kubernetes deployment objects.
The Dockerfile is used to build the app from source code. Then runs the app inside a docker container.
The k8s objects defined in YAML files are used to deploy the app into a Kubernetes cluster. These files are:
1.1) The vision: Microservices on Docker containers on Kubernetes hosted on the Cloud and powered by DevOps.
1.2) Learn more about Kubernetes architecture:
1.3) Learn more about Kubernetes objects: Deployment, Service, ConfigMap, Secret, PersistentVolume...
Inside the MvcApp folder, we have a sample ASP.NET Core MVC application that displays web pages and connects to a Database. The goal here is to run this application in a Docker container. For that, we need the Dockerfile which describes the instructions to build/compile app from source code and deploy it into a base image that have .NET Core SDK and Runtime.
2.0) Install Docker into your machine Make sure you have Docker installed and running in your machine: Docker Desktop
2.1) Start Docker in your machine and check if it runs successfully by deploying a sample image called hello-world:
$ docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
2.2) Create Docker image
$ cd MvcApp
$ docker build . # don't forget the dot at the end to configure thecontext!
$ docker build --rm -f "Dockerfile" -t mvc-app:1.0 .
2.3) List the created image
$ docker images
2.4) Run the created image
$ docker run --rm -d -p 5555:80/tcp mvc-app:1.0
2.5) List the running image
$ docker ps
2.6) Open browser on localhost:5555 and note how the app doesn't connect to database despite it is configured to!!
2.7) Configure and start SQL Server on container
$ docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=@Aa123456' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-CU4-ubuntu-16.04
When dealing with multiple containers, Docker Compose becomes really useful. It allows to define the configuration in a single file. This file then will be used to build, deploy and stop all the images using docker-compose CLI. Open the docker-compose.yaml file. Note how we are defining 2 services: one to run the web app and a second one to deploy the database.
3.1) Build the Docker Compose file to create the images
$ docker-compose build
3.2) Run the Docker Compose file to run the created images
$ docker-compose up
Starting sqldb-k8s ... done
Starting mvcapp-k8s ... done
Now that we have created the docker image in our machine, we want to deploy it into Kubernetes. But, Kubernetes should get that image through a Container Registry. Container Registry is a like a database for all our containers. We can use Azure ACR or Docker Hub... We'll continue with Docker Hub. Make sure you create a an account here hub.docker.com and take note of your Docker Hub ID (Registry name).
4.1) Create a variable to hold our Registry name
$ $registry="REPLACE_WITH_YOUR_DOCKER_HUB_ID"
4.2) Tag the image by appending the registry name
$ docker tag mvc-app:1.0 $registry/mvc-app:1.0
4.3) Login to Docker Hub and enter your login and password
$ docker login
4.4) Push the image into the registry
$ docker push $registry/mvc-app:1.0
4.5) Check your hub.docker.io, you should see the image uploaded into a repository
5.1) Start the Dashboard
5.2) $ minikube start
5.3) $ minikube dashboard
6.1) $ Kubectl run
6.2) $ kubectl get deployments
6.3) $ kubectl get secrets
6.4) $ kubectl get services
7.1) $kubectl apply -f mssql-secret.yaml
$ kubectl get secrets
7.2) $kubectl apply -f mssql-pv.azure.yaml
$ kubectl get pv
7.3) $ kubectl apply -f mssql-deployment.yaml
$ kubectl get deployments
7.4 $ kubectl apply -f mvc-deployment.azure.yaml
$ kubectl get deployments
7.5) $ minikube config set memory 4096 # if we need to resize minikube
7.6) $ kubectl delete services,deployments,pvc,secrets --all -n default
8.1) $ az group create \
--location westeurope \
--subscription "Microsoft Azure Sponsorship" \
--name aks-k8s-rg
8.2) $ az aks create \
--generate-ssh-keys \
--subscription "Microsoft Azure Sponsorship" \
--node-count 1 \
--resource-group aks-k8s-rg \
--name aks-k8s
8.3) $ az aks get-credentials \
--resource-group aks-k8s-rg \
--name aks-k8s \
--subscription "Microsoft Azure Sponsorship"
Merged "aks-k8s" as current context in /Users/houssem/.kube/config
8.4) $ kubectl create clusterrolebinding kubernetes-dashboard \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:kubernetes-dashboard
8.5) $ az aks browse \
--resource-group aks-k8s-rg \
--name aks-k8s \
--subscription "Microsoft Azure Sponsorship"
9.1) CI pipeline: builds the container and pushes it to docker hub.
9.2) CD pipeline: deploys the YAML manifest files into Kubernetes cluster.
scalability, health check, mounting volume, resource limits, service discovery, deploy with Helm...
eShopOnContainers: dotnet-architecture/eShopOnContainers
https://www.udemy.com/kubernetes-for-developers/ Please email me if you want a free coupon :)