Giter Site home page Giter Site logo

k8s-bake's Introduction

Kubernetes bake action

Use this action to bake manifest file to be used for deployments using helm, kustomize or kompose testing fork PR 2 after 1st merge

Sets output variable 'manifestsBundle' which contains the location of the manifest bundles created by bake action

Bake using helm

- uses: azure/k8s-bake@v1
  with:
    renderEngine: 'helm'
    helmChart: './aks-helloworld/' 
    overrideFiles: './aks-helloworld/values-override.yaml'
    overrides: |     
        replicas:2
    helm-version: 'latest' 
    silent: 'false'

Bake using Kompose

- uses: azure/k8s-bake@v1
  with:
    renderEngine: 'kompose'
    dockerComposeFile: './docker-compose.yml'
    kompose-version: 'latest'     

Bake using Kubernetes Kustomize

- uses: azure/k8s-bake@v1
  with:
    renderEngine: 'kustomize'
    kustomizationPath: './kustomizeexample/'
    kubectl-version: 'latest'

Refer to the action metadata file for details about all the inputs https://github.com/Azure/k8s-bake/blob/master/action.yml

End to end workflow for building container images and deploying to a Kubernetes cluster

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    
    - uses: Azure/docker-login@v1
      with:
        login-server: contoso.azurecr.io
        username: ${{ secrets.REGISTRY_USERNAME }}
        password: ${{ secrets.REGISTRY_PASSWORD }}
    
    - run: |
        docker build . -t contoso.azurecr.io/k8sdemo:${{ github.sha }}
        docker push contoso.azurecr.io/k8sdemo:${{ github.sha }}
      
    - uses: Azure/k8s-set-context@v1
      with:
        kubeconfig: ${{ secrets.KUBE_CONFIG }}
        
    - uses: Azure/k8s-create-secret@v1
      with:
        container-registry-url: contoso.azurecr.io
        container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
        container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
        secret-name: demo-k8s-secret

    - uses: azure/k8s-bake@v1
      with:
        renderEngine: 'helm'
        helmChart: './aks-helloworld/' 
        overrideFiles: './aks-helloworld/values-override.yaml'
        overrides: |     
          replicas:2
        helm-version: 'latest' 
      id: bake

    - uses: Azure/k8s-deploy@v1
      with:
        manifests: ${{ steps.bake.outputs.manifestsBundle }}
        images: |
          demo.azurecr.io/k8sdemo:${{ github.sha }}
        imagepullsecrets: |
          demo-k8s-secret

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.

k8s-bake's People

Contributors

anumita avatar dependabot[bot] avatar josh-01 avatar microsoft-github-operations[bot] avatar microsoftopensource avatar shigupt202 avatar sundargs2000 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.