Giter VIP home page Giter VIP logo

example-aks's Introduction

Azure Kubernetes Service (AKS) GitHub Action Example

An example workflow, using the GitHub Action for Azure to build, tag, and deploy a container image to a running Kubernetes cluster on AKS.

Workflow

The example workflow will trigger on every push to this repo.

For pushes to a feature branch, the workflow will:

  1. Build the Docker image from the included Dockerfile
  2. Tag and push the image to Azure Container Registry (ACR)

For pushes to the default branch (master), in addition to the above Actions, the workflow will:

  1. Update the deployment resource on the running AKS Kubernetes with the latest container image

Prerequisites

The following setup steps must be complete before running the example workflow.

  1. Create an Azure resource group, a logical container into which Azure resources are deployed and managed, in a location of your choice:
    • az group create --name $RESOURCE_GROUP --location $LOCATION (more info)
  2. Create an Azure Container Registry (ACR) instance in your resource group:
    • az acr create --name $REGISTRY --resource-group $RESOURCE_GROUP --sku Basic (more info)
  3. Configure ACR authentication, grant the AKS service principal the correct rights to pull images from ACR:
    • az role assignment create --assignee $AZURE_SERVICE_APP_ID --scope $ACR_ID --role Reader (more info)
  4. Build, tag, and push the included Docker image to ACR
  5. Create an AKS Kubernetes cluster:
    • az aks create --resource-group $RESOURCE_GROUP --name $CLUSTER --node-count 1 --service-principal $AZURE_SERVICE_APP_ID --client-secret $AZURE_SERVICE_PASSWORD --generate-ssh-keys (more info)
  6. Connect to your cluster using kubectl:
    • az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER (more info)
  7. Apply the included Kubernetes configuration to your cluster:
    • kubectl apply -f ./kconfig.yml

License

This repository is licensed under CC0-1.0, which waives all copyright restrictions.

example-aks's People

Contributors

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