Giter Site home page Giter Site logo

torosgo-saas-aks's Introduction

Deploy AKS, ACR and a demo app for a multi-tenant environment

A demo project to deploy an AKS cluster, ACR, build and deploy sample Nodejs Express web application for a multi-tenant environment.

Usage:

0- Prerequisites

1- Clone Repository

git clone <URL of this repo>

2- Generate Azure deployment credentials and set as GitHub Actions Secret

Create a service principal with the az ad sp create-for-rbac command in the Azure CLI. More details

az ad sp create-for-rbac --name "<sp_name>" --role contributor --scopes /subscriptions/<subscription_id> --sdk-auth

Copy the jason output similar to below and paste in GitHub Actions secret with the name AZURE_CREDENTIALS

 {
    "clientId": "<GUID>",
    "clientSecret": "<GUID>",
    "subscriptionId": "<GUID>",
    "tenantId": "<GUID>",
    (...)
  }

3- Make customizations

Make customizations in workflows, ARM templates or app code if necessary.

4- Run GitHub Workflow "Build and Deploy AKS, ACR and application image"

Run this workflow once to provision AKS, ACR, and build/push the application container image. Tis workflow:

  • Deploys AKS with
    • Public api server endpoint
    • Enable rbac
    • Enable load balancer "standard" for public services
    • Enable "azure" cni and network policy
    • Enable container insights
    • Enable Microsoft Defender for Containers.
    • Enable Open Service Mesh
  • Deploys ACR
  • Builds and pushes the image to ACR

5- Run GitHub Action Workflow "Deploy application to AKS"

Run this workflow as many times as needed whenever an new tenant is onboarded. This workflow:

  • Creates a kubernetes namespace for the tenant
  • Applies namespace based resource quota for the tenant
  • Applies network policy to isolate namespace from other tenant namespaces
  • Pull the application from ACR and deploy to tenant namespace

Support

No SLA. Continuous development. Use at your own risk. Please read License.

Contributing

Contribution are welcome.

Copyright

Copyright © 2023.

License

This document is open source software licensed under the Apache License 2.0 license.

torosgo-saas-aks's People

Contributors

fecohi avatar torosgo avatar

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.