K8.DotNetCore.Workshop
K8.DotNetCore.Workshop copied to clipboard
Kubernates and DotNetCore Workshop demonstrates essentials skills for DotNetCore Developer
Kubernetes DotNetCore Workshop
This workshop will provide with ability to learn the basics of the Kubernetes development from DotNetCore developer perspective.
The solution includes the following projects:
-
K8.AspNetCore.HealthChecks.csproj
- a simple project that demonstrates how to add custom HealthChecks. -
K8.Extensions.Configuration.csproj
- a project that creates a custom Azure Key Vault Secrets retrieval. -
K8.Extensions.Hosting.csproj
- a project that demonstrates how to extend hosting creation for the common K8s projects. -
K8.FrontEnd.csproj
- theAspNetCore
Web Api project that demonstrates usage of health and liveliness checks. -
K8.LongProcess.csproj
- the DotNetCore 3.0 Worker Hosted Console App that runs custom K8s CronJobs.
Technologies
- Docker Containers
- Kubernetes Cluster
- Helm deployment
- Microsoft Azure Managed Identity (MSI)
Pre-requisites
- Install Docker and Local Kubernetes Cluster on Windows 10
-
Enable Local Kubernetes Cluster: Docker --> Settings --> Kubernetes
This dashboard doesn't require token authentication, since the cluster is running on the local machine.
# install
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/alternative/kubernetes-dashboard.yaml
# launch the dashboard
kubectl proxy
# dashboard url 'http://localhost:8001/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/#!/overview?namespace=default'
The UI dashboard is useful for learning and management purposes.
Open Local Kuberbetes Cluster Dashboard
This component is required for the labs.
# installation
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml
# validate installation
kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx --watch
-
Update Windows 10 Hosts file update to include
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 kubernetes.docker.internal k8-frontend-app.local
This hosts
entry provides with the following local development Url for the application
https://k8-frontend-app.local/weatherforecast
-
Install
Local Managed Service Identity (MSI) Azure Local Authenticator
-
Create Azure Storage Account
Labs
- Lab: Build Docker Images
-
Lab:
Kubectl
commands - Lab: Helm simple release
- Lab: Helm templated release
References
Windows Terminal
General Ideas
AKS specific
-
Deploy a SQL Server container in Kubernetes with Azure Kubernetes Services (AKS)
-
Create an ingress controller with a static public IP address in Azure Kubernetes Service (AKS)
-
Deploying a Stateful Application on Azure Kubernetes Service (AKS)
-
Use Azure managed identities with Azure Kubernetes Services (AKS)
-
Manually create and use a volume with Azure Files share in Azure Kubernetes Service (AKS)
-
How to: Mount an Azure Storage File Share to containers in Azure Kubernetes Services (AKS)
-
Configure agent data collection for Azure Monitor for containers