Skip to content

layer5labs/kanvas-snapshot

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Layer5 Kanvas Snapshot

Give your pipelines super powers with Kanvas Snapshot GitHub Actions.

Kanvas Snapshot GitHub Action

  1. See your deployment before you merge.
  2. Connect Kanvas to your GitHub repo and see changes pull request-to-pull request.
  3. Get snapshots of your infrastructure directly in your PRs.

Overview

The Kanvas Snapshot GitHub Action allows you to generate and snapshot a visual diagram of your infrastructure as code whether that be Kubernetes manifests, Helm charts, or Docker compose files. This action automates the process of creating Kanvas Snapshots.

Features

  1. Snapshot Generation: Create visual snapshots of infrastructure as code, complete with associated resources.
  2. Delivery via Email or PR Comment: Snapshots can be delivered via email, image in your design catalog, or via comment in a GitHub pull request.
  3. Plugins:
  4. See Helm Kanvas Snapshot plugin
  5. See Kubectl Kanvas Snapshot plugin

Standard Installation and Use

See Configuring Kanvas Snapshots in Layer5 Docs.

Customized Use

Example: Importing design from filesystem


name: 'MeshMap Snapshot With File-located in Fs'
on: # rebuild any PRs and main branch changes
  pull_request:
  push:
    branches:
      - main
      - master
      - 'releases/*'

jobs: test: # make sure the action works on a clean machine without building runs-on: ubuntu-latest steps: - name: Set PR number # To comment the final status on the Pull-request opened in any repository run: | export pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") echo "PULL_NO=$pull_number" >> $GITHUB_ENV - uses: actions/checkout@v3 # the repository where your infrastructure is located - uses: actions/checkout@v3 #this step would go and would be no longer needed to be written with: path: action repository: layer5labs/meshmap-snapshot - id: test_result uses: layer5labs/[email protected] with: githubToken: ${{ secrets.GITHUB_TOKEN }} # github's personal access token example: "ghp_...." mesheryToken: ${{ secrets.MESHERY_TOKEN }} # Meshery Cloud Authentication token, signin to meshery-cloud to get one, example: ey..... prNumber: ${{ env.PULL_NO }} # auto-filled from the above step application_type: "Kubernetes Manifest" # your application type, could be any of three: "Kubernetes Manifest", "Docker Compose", "Helm Chart" filePath: "action/tests/manifest-test" # relative file-path from the root directory in the github-runner env, you might require to checkout the repository as described in step 2

Notes

The filesystem-approach asks for your relative file-path and automatically merges all the yaml files together to bundle up into one. So you might like to give the root directory where all the yamls are located. It doesn't move recursevely in internal folders, so only the first level yaml files are checked.

Example: Importing design from URL


name: 'MeshMap Snapshot With URL-Upload'
on: # rebuild any PRs and main branch changes
  pull_request:
  push:
    branches:
      - main
      - master
      - 'releases/*'

jobs: test: # make sure the action works on a clean machine without building runs-on: ubuntu-latest steps: - name: Set PR number # To comment the final status on the Pull-request opened in any repository run: | export pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") echo "PULL_NO=$pull_number" >> $GITHUB_ENV - uses: actions/checkout@v3 #this step would go and would be no longer needed to be written with: path: action repository: layer5labs/meshmap-snapshot - id: test_result uses: layer5labs/[email protected] with: githubToken: ${{ secrets.GITHUB_TOKEN }} # github's personal access token example: "ghp_...." mesheryToken: ${{ secrets.MESHERY_TOKEN }} # Meshery Cloud Authentication token, signin to meshery-cloud to get one, example: ey..... prNumber: ${{ env.PULL_NO }} # auto-filled from the above step application_type: "Helm Chart" # your application type, could be any of three: "Kubernetes Manifest", "Docker Compose", "Helm Chart" application_url: "https://github.com/meshery/meshery.io/raw/master/charts/meshery-v0.6.88.tgz"

Customizing your workflow

The following is a list of Action Inputs.


designId:  # id of input  #deprecated
  description: "The design uuid, example: 3c116d0a-49ea-4294-addc-d9ab34210662"
  required: false
  default: '{}'
applicationId:  #deprecated
  description: "The application uuid, example: 3c116d0a-49ea-4294-addc-d9ab34210662"
  required: false
githubToken:
  description: "Github PAT token"
  required: true
providerToken:
  description: "Meshery Authentication Provider Token"
  required: true
prNumber:
  description: "The Pull request on which comment has to be made"
  required: false
  default: 0
filePath: 
  description: "The relative filepath of the location where the manifests are stored"
  required: false
application_type:
  description: "Application upload type, any of the three, Kubernetes Manifest, Docker Compose, Helm Chart"
  required: true
application_url:
  description: "Application's source url where the manifests or data is stored"
  required: false
 

Join the Layer5 Community!

We warmly welcome all contributors! Our projects are community-built and each welcomes open collaboration. As you get started, please review this project's contributing guidelines. Whether you are a user or code contributor and whether you're opening an issue or a pull request, know that any form of your engagement is considered contribution and is appreciated. Contributors are expected to adhere to the CNCF Code of Conduct.

Join us in the discussion forum and on Slack to learn more about Layer5 and its community! Make sure you see the newcomer's guide for a tour of resources available to you.

Shows an illustrated light mode meshery logo in light color mode and a dark mode meshery logo dark color mode. Layer5 Cloud Native Community ✔️ Join any or all of the weekly meetings on the community calendar.
✔️ Watch community meeting recordings.
✔️ Fill-in a community member form to gain access to community resources.
✔️ Discuss in the Community Forum.
✔️ Explore more in the Community Handbook.

Not sure where to start? Grab an open issue with the help-wanted label.

License

All of Layer5's projects are available as open source under the terms of the Apache 2.0 License.