All Projects → ThorstenHans → aks-demo-app

ThorstenHans / aks-demo-app

Licence: MIT license
Sample Application for AKS demonstrations

Programming Languages

C#
18002 projects
typescript
32286 projects
HTML
75241 projects
HCL
1544 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to aks-demo-app

angular-app-kubernetes
Sample Dockerised angular app deployed on Kubernetes on Azure using AKS
Stars: ✭ 42 (+50%)
Mutual labels:  aks
Giraffe.Razor
Razor view engine http handlers for Giraffe web applications.
Stars: ✭ 27 (-3.57%)
Mutual labels:  aspnet-core
aspnet-core-ad-authentication
ASP.NET Core Active Directory authentication use LDAP
Stars: ✭ 21 (-25%)
Mutual labels:  aspnet-core
run-aspnetcore-blazor
New .Net Core 3.0 Asp.Net Blazor Components SPA Web Application
Stars: ✭ 22 (-21.43%)
Mutual labels:  aspnet-core
azure
Documentation, tooling and other resources related to the Azure account used by the Jenkins project
Stars: ✭ 20 (-28.57%)
Mutual labels:  aks
Huxley2
A cross-platform JSON proxy for the GB railway Live Departure Boards SOAP API
Stars: ✭ 22 (-21.43%)
Mutual labels:  aspnet-core
Mockaco
🐵 HTTP mock server, useful to stub services and simulate dynamic API responses, leveraging ASP.NET Core features, built-in fake data generation and pure C# scripting
Stars: ✭ 213 (+660.71%)
Mutual labels:  aspnet-core
fake-survey-generator
A slightly more-than-trivial full-stack application built with DDD & CQRS concepts
Stars: ✭ 49 (+75%)
Mutual labels:  aspnet-core
Wilson
ERP / CRM system for small to medium construction companies.
Stars: ✭ 84 (+200%)
Mutual labels:  aspnet-core
AspNetCoreFilters
ASP.NET Core MVC Filters
Stars: ✭ 34 (+21.43%)
Mutual labels:  aspnet-core
swan-aspnetcore
SWAN ASP.NET Core
Stars: ✭ 28 (+0%)
Mutual labels:  aspnet-core
iskan
Kubernetes Native, Runtime Container Image Scanning
Stars: ✭ 35 (+25%)
Mutual labels:  aks
mssql-restapi
A simple REST API for SQL Server, Azure SQL DB and Azure SQL DW using SMO on .NET Core 2.0
Stars: ✭ 33 (+17.86%)
Mutual labels:  aspnet-core
emplea do
Open source tech jobs portal. Made with .Net Core
Stars: ✭ 75 (+167.86%)
Mutual labels:  aspnet-core
abp-push
Push Notification System for ASP.NET Boilerplate
Stars: ✭ 16 (-42.86%)
Mutual labels:  aspnet-core
AspNetCoreFileUploadFileTable
ASP.NET Core MVC file upload / download with MS SQL Server FileTable
Stars: ✭ 112 (+300%)
Mutual labels:  aspnet-core
Az-DevOps-Agent-On-AKS
Build and deploy Azure DevOps Pipeline agent in a container on Azure Kubernetes Service. Elastically scale the DevOps build infrastructure.
Stars: ✭ 26 (-7.14%)
Mutual labels:  aks
AspNetCoreAzureSearch
ASP.NET Core with Azure Cognitive Search
Stars: ✭ 12 (-57.14%)
Mutual labels:  aspnet-core
aks-keyvault
Access Azure Key Vault secrets, keys and certs from AKS Pods using Secret Store CSI provider and Pod Identity.
Stars: ✭ 21 (-25%)
Mutual labels:  aks
BlazorDemo
Demo application for my writings about Blazor
Stars: ✭ 79 (+182.14%)
Mutual labels:  aspnet-core

AKS Demo App

A simple .NET Core / Angular application

aks-demo-app is a simple application to demonstrate basic concepts of kubernetes (k8s) and Azure Kubernetes Services (AKS). The app consists of four Docker images and a SQL database. The SQL database won't be hosted inside of k8s, instead Microsoft's PaaS offering (SQL Azure) is used. The Sample is licensed under MIT

  • An Angular SPA
  • .NET Core 2.0
    • An API for reading Sessions Sessions.API
  • .NET Core 2.0
    • An API for reading votes and persisting new votes Votings.API
  • .NET Core 2.0 CronJob
    • Which will remove old audit logs from SQL database Sessions.AuditLogCleaner

Cloud Environment

For running and hosting the application, the following environment is required.

- SQL Azure
- Azure Container Registry (ACR)
- Azure Kubernetes Service (AKS)

The cloud environment can be deployed using Terraform. The subfolder terraform contains already the environment and can be configured according to your needs by specifying your settings in a terraform.tfvars file. The terraform/terraform.tfvars.sample contains an example configuration.

Developer Environment Requirements

- Azure CLI (`az`)
- Kubernetes Control (`kubectl`)
- Docker (`docker`)

Generating the Database

  • Define a firewall exception for your local IP address on SQL Azure (SQL Server).
  • Create a new (empty) SQL Database
  • Set the connection string temporary as ENVIRONMENT Variable with the name DbConnectionString
  • Execute EF Migrations (Sessions.Migrations C# Project in /backend/Sessions.Migrations) using VS or Rider to generate the database from the current C# model

Building Docker images

Docker images must be generated for all four components. Replace thhdemo.azurecr.io with your ACR instance identifier.

$ cd backend
backend $ docker build -t thhdemo.azurecr.io/sessions:latest -f sessions-ms.Dockerfile .
backend $ docker build -t thhdemo.azurecr.io/votings:latest -f votings-ms.Dockerfile .
backend $ docker build -t thhdemo.azurecr.io/sessions-cleaner:latest -f log-cleaner.Dockerfile .
backend $ cd ..
cd frontend
frontend $ docker build -t thhdemo.azurecr.io/frontend:latest .

Push images to ACR

Replace thhdemo with your ACR instance identifier

$ az acr login --name thhdemo
$ docker push thhdemo.azurecr.io/sessions-api:1.0.0
$ docker push thhdemo.azurecr.io/votings-api:1.0.0
$ docker push thhdemo.azurecr.io/sessions-cleaner:1.0.0
$ docker push thhdemo.azurecr.io/sessions-spa:1.0.0

Prepare AKS deployment

All kubernetes resources are defined in deployment directory. You'll find a secrets.template.yaml there. Rename it to secrets.yaml and replace the token <<base64 ...>> with your DB connection string in base64. You can generate a base64 representation using the following command:

$ echo -n 'my connectionstring' | base64

Update backend.yaml, frontend.yaml and cronjob.yaml and provide correct name for your docker images (again replace thhdemo.azurecr.io with your ACR stuff).

Deploy to AKS

Execute the following commands to deploy everything to AKS:

$ cd deployment
deployment $ kubectl create -f secrets.yaml
deployment $ kubectl create -f services.yaml
deployment $ kubectl create -f backend.yaml
deployment $ kubectl create -f frontend.yaml
deployment $ kubectl create -f cronjob.yaml

Scale deployments

$ kubectl scale deployment sessions-api --replicas 5
$ kubectl scale deployment votings-api --replicas 5
$ kubectl scale deployment sessions-spa --replicas 3
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].