GithubHelp home page GithubHelp logo

isabella232 / aks-set-context Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure/aks-set-context

0.0 0.0 0.0 414 KB

GitHub Action for setting context before deploying to Kubernetes clusters

License: MIT License

JavaScript 53.35% TypeScript 46.65%

aks-set-context's Introduction

Azure Kubernetes Service set context

This action can be used to set cluster context before other actions like azure/k8s-deploy, azure/k8s-create-secret or any kubectl commands (in script) can be run subsequently in the workflow.

Refer to starter templates to deploy to any Kubernetes cluster on-premise or any cloud including Azure Kubernetes service.

Action inputs

Action inputs Description
creds
Credentials
(Required) Credentials required to authenticate with Azure. Steps to obtain these credentials are provided below
resource-group
Resource group
(Required) Resource group containing the AKS cluster
cluster-name
Cluster name
(Required) Name of the AKS cluster

Example

uses: azure/aks-set-context@v1
    with:
        creds: '${{ secrets.AZURE_CREDENTIALS }}' # Azure credentials
        resource-group: '<resource group name>'
        cluster-name: '<cluster name>'
    id: login

To fetch the credentials required to authenticate with Azure, run the following command:

az ad sp create-for-rbac --sdk-auth

For more details on this command, refer to service principal documentation

This generates a service principal and the output of the above command will be in the following format:

{
  "clientId": "<client id>",
  "clientSecret": "<client secret>",
  "subscriptionId": "<subscription id>",
  "tenantId": "<tenant id>",
  "activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
  "resourceManagerEndpointUrl": "https://management.azure.com/",
  "activeDirectoryGraphResourceId": "https://graph.windows.net/",
  "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
  "galleryEndpointUrl": "https://gallery.azure.com/",
  "managementEndpointUrl": "https://management.core.windows.net/"
}

Add the json output as a secret (let's say with the name AZURE_CREDENTIALS) in the GitHub repository. The example YAML snippet given above showcases how this secret is referenced in the action for specifying the credentials as input to the action.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

aks-set-context's People

Contributors

dependabot[bot] avatar microsoftopensource avatar msftgits avatar n-usha avatar ncthbrt avatar pjsier avatar rgsubh avatar shashankbarsin avatar shigupt202 avatar thesattiraju 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.