meshery/meshery

Create a Kubectl Plugin for Meshery Snapshots

Open

#12,036 opened on Sep 14, 2024

 (10 comments) (1 reaction) (0 assignees)HTML (3,101 forks)batch import
GSoCcomponent/mesheryctlhelp wantedissue/design requiredissue/willfixkind/enhancementlanguage/go

Repository metrics

Stars
 (10,013 stars)
PR merge metrics
 (Avg merge 22d 16h) (332 merged PRs in 30d)

Description

See mesheryctl Command Tracker for current status of commands.

Desired Behavior

Kubernetes manifests, especially collections of them, can be complex. This plugin will bridge the gap between Kubernetes cluster and workflow configurations and their visual representation in Meshery UI Snapshots. The plugin will allow users to generate a visual snapshot of the combination of multiple Kubernetes manifest files, each containing one or more Kubernetes resources.

Feature Overview

Meshery users may want to generate snapshots of their designs for various purposes. Meshery currently provides the ability to create snapshots and integrates with GitHub, allowing snapshots to be generated automatically when a pull request is made. This feature gives reviewers a visual representation of the infrastructure changes, simplifying the review process.

In addition to GitHub integration, users working with tools like Helm, Kubernetes, and Docker may also want to generate snapshots directly from the command line.

A Helm plugin, allowing users to generate a visual snapshot of their Helm charts directly from the command line, has already been developed available at: https://github.com/meshery/helm-kanvas-snapshot.

  1. Current Design Spec for Helm Plugin
  2. Meshery Snapshots Sequence Diagram

Implementation

With the Kubectl plugin, users will be able to generate a snapshot from a Kubernetes manifest file.

The proposed command will be: kubectl kanvas-snapshot -f manifest.yaml

This plugin will be developed using the Kubectl Krew Plugin manager.

Additional Reference material

1. Krew, the plugin manager for kubectl 2. Reference https://docs.meshery.io/extensions/snapshot 3. Reference https://github.com/marketplace/actions/meshmap-snapshot

Acceptance Tests

  1. Users can install the latest snapshot plugin.
  2. Users can execute kubectl kanvas-snapshot -f manifest.yaml and have the Meshery Snapshot workflow invoked.

After generating the snapshot:

  1. Users will receive a URL in the terminal that they can click to view the snapshot in their browser.
  2. Users may also choose to have the snapshot sent to them via email.

Additional options for viewing snapshots could be proposed, such as:

  1. Downloading the image directly to their local machine.
  2. Sharing the snapshot via messaging apps or collaboration platforms (e.g., Slack, Teams).
  3. Embedding the snapshot into project documentation.

Contributor Resources

Contributor guide