Coder Social home page Coder Social logo

kdcllc / k8.dotnetcore.workshop Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 3.0 966 KB

Kubernates and DotNetCore Workshop demonstrates essentials skills for DotNetCore Developer

License: Apache License 2.0

C# 90.91% Dockerfile 4.47% Smarty 4.43% Shell 0.20%
asp-net-core aspnetcore kubernetes kubernetes-deployment helm-charts docker-compose docker dotnetcore3 ingress cluster

k8.dotnetcore.workshop's Introduction

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: Application layout

  • 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 - the AspNetCore 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

  1. Install Docker and Local Kubernetes Cluster on Windows 10

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
  1. Install the Azure CLI

  2. Install Visual Studio Code

  3. 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

  1. Install Local Managed Service Identity (MSI) Azure Local Authenticator

  2. Create Azure Key Vault

  3. Create Azure Storage Account

Labs

K8 Cluster and Azure Resources

  1. Lab: Build Docker Images
  2. Lab: Kubectl commands
  3. Lab: Helm simple release
  4. Lab: Helm templated release

References

Windows Terminal

General Ideas

AKS specific

Ingress LetsEncrypt

k8.dotnetcore.workshop's People

Contributors

kdcllc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

k8.dotnetcore.workshop's Issues

Add Visual Studio Support for Dockerfile

Unfortunately, only web projects are supported with VS.NET 2019 right now.

FrontEnd.csproj modifications:

  1. Enable Docker files context
  <PropertyGroup>
    <!--https://docs.microsoft.com/en-us/visualstudio/containers/container-msbuild-properties?view=vs-2019-->
    <DockerfileContext>../../.</DockerfileContext>
    <DockerfileFile>../../src/K8.FrontEnd/Dockerfile</DockerfileFile>
    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
  </PropertyGroup>
  1. Enable tooling support
  <ItemGroup>
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.5" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
  </ItemGroup>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.