Coder Social home page Coder Social logo

aks-template's Introduction

page_type languages products description
sample
python
azure
azure-redis-cache
This sample creates a multi-container application in an Azure Kubernetes Service (AKS) cluster.

GitHub Demo Day

This demo is a cloned from the GitHub Demo Day sessions hosted on Sep 10, 2021!

We will use this repo to see how GitHub can simplify security, automation, container management, K8s deployments and more!

Prerequisites

  1. Create the Azure K8S Cluster in Azure in a resource group. Generate the SP Creds using the below suggestion

  2. This demo requires 4 secrets to be generated:

Secret Name Value Required
AKS_CLUSTER_NAME AKS Cluster name
AKS_CLUSTER_RESOURCE_GROUP Resource Group that contains the AKS Cluster
AZURE_SERVICE_PROVIDER_CREDENTIALS SP with permission to access the Azure Resource Group
GH_ENV_PAT PAT with repo admin access
  1. If you'd like to try this out yourself, ensure that the following files have been modified to represent your repository. Replace references to OWNER/REPO-NAME to your repo. docker-compose.yaml and deployment.yml

Generate Azure Service Principal

To deploy to Azure you will need to create a service principal. You can do that with the following command:

az ad sp create-for-rbac --name {yourServicePrincipalName} --role contributor \
                            --scopes /subscriptions/{subscription-id} \
                            --sdk-auth

  # Replace {yourServicePrincipalName}, {subscription-id} with the a service principal name and subscription id.

  # The command should output a JSON object similar to the example below

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

How to Demo

  1. Open project in Codespaces or VS Code
  2. Use docker-compose build and docker-compose up commands to show off the application
  3. Create a new branch,
    • modify azure-vote/azure-vote/config_file.cfg to update homepage values
  4. Create a PR, utilize review-lab keyword comment - if desired.
  5. Show AKS Cluster to demonstrate any namespace updates/changes.
  6. Merge PR, observe that Cleanup PR and AKS Staging & Production - Deploy workflows kick off
  7. View Staging and Production environment deployments

Azure Voting App

This sample creates a multi-container application in an Azure Kubernetes Service (AKS) cluster. The application interface has been built using Python / Flask. The data component is using Redis.

To walk through a quick deployment of this application, see the AKS quick start.

To walk through a complete experience where this code is packaged into container images, uploaded to Azure Container Registry, and then run in and AKS cluster, see the AKS tutorials.

Troubleshooting / Limitations

Manifest File

Currently the manifests/deployment.yml file needs to have the azure-vote-front image value updated to match your repository.

Available resources for multiple namespaces

For demo purposes, the manifest files only ask for 1 replica for the services. Multiple replicas or namespaces (5+) may hit resource limitations for your AKS cluster.

References

Microsoft Teams

GitHub is the world's leading software development platform. Microsoft Teams is one of the most popular communication platforms where modern development teams come together to build world-class products and services. With two of your most important workspaces connected, you'll stay updated on what's happening on GitHub without leaving Microsoft Teams.

GitHub Actions

Environments - You can configure environments with protection rules and secrets. When a workflow job references an environment, the job won't start until all of the environment's protection rules pass.

GitHub Container Registry

You can store and manage Docker and OCI images in the Container registry, which uses the package namespace https://ghcr.io.

aks-template's People

Contributors

rohitnb avatar

Watchers

 avatar

Forkers

muraliv21

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.