Skip to content

Feat/add dry run docs #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions content/en/kanvas/tasks/designs/dry-running-designs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Dry Running Designs
description: >
Try out your design without applying it—Dry Run helps you safely test deployments across one or more clusters.
weight: 7
categories: [Designer]
tags: [designs]
---

Dry Run lets you try out your design without making any changes to your Kubernetes clusters.
It’s a safe way to check if everything is set up correctly before you actually deploy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice explanation. This is relatable and understandable.


![Find Dry Run Menu](/kanvas/tasks/designs/images/find-dry-run-menu.gif)

## Why you should perform Dry Runs

- **Catch mistakes early** before real resources are created or modified.
- **Validate permissions** to ensure your service account can perform the intended actions.
- **Ensure compatibility** with your cluster’s API versions and admission policies.
- **Speed up reviews** by sharing simulation results instead of waiting for full deployments.

> Dry Run does not create, update, or delete any live resources.

## How to Perform a Dry Run

In Kanvas, there are two ways to trigger a Dry Run—via the **Actions dropdown** or the **arrow-shaped dropdown** in design mode. Both options perform exactly the same operation:

- They simulate the deployment or undeployment of your design across **all selected Kubernetes clusters**.
- They use the same backend mechanism and validation pipeline.
- The results of the simulation are identical regardless of the entry point.

The only difference lies in how results are delivered:

- **Actions Dropdown**: A modal window appears to display the dry-run results.
- **Arrow Dropdown**: Feedback is shown in the **[Notification Center](https://docs.meshery.io/guides/infrastructure-management/notification-management)**.

### To Start a Dry Run

1. Navigate to [Kanvas](https://playground.meshery.io/extension/meshmap).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're describing Kanvas, let's use https://kanvas.new as the domain in the URLs, not playground.meshery....

2. Choose one of the following entry points:
- **Actions dropdown**
![Actions menu showing Dry Run option](/kanvas/tasks/designs/images/actions-dropdown-menu.png)
- **Arrow-shaped dropdown**
![Dropdown Menu Shortcut](/kanvas/tasks/designs/images/arrow-dropdown-menu.png)
3. Select **Dry Run**.

Depending on the entry point, you will either see a modal or receive a notification, but the operation and its output remain the same.[^1].

## How It Works

When you trigger a Dry Run in Meshery, the following steps happen behind the scenes:

1. **Frontend Sends a Dry Run Request**
Meshery’s UI sends your design and selected Kubernetes clusters to the server, with the Dry Run option enabled.

2. **Backend Simulates Deployment**
Meshery reads your design and prepares it for deployment, but instead of applying changes, it simulates the actions against the selected Kubernetes clusters.

3. **Kubernetes Validates the Changes**
Meshery asks Kubernetes to review the deployment using its built-in dry-run feature, checking if the resources would succeed without actually creating or modifying anything.

4. **Results Are Returned**
Simulation results for each component and each cluster are collected and sent back to the UI. You can view any errors or warnings directly in the Notification Center.

> Meshery’s Dry Run feature leverages Kubernetes' native dry-run support to ensure highly accurate and cluster-aware simulations.

## Q&A

#### Q: What’s the difference between Validate, Dry Run, and Deploy?
- **Validate** checks whether the design’s structure and schema are correct based on MeshModel component definitions. It does not contact the cluster.
- **Dry Run** simulates the deployment against real clusters without changing any resources. It checks compatibility, permissions, and configuration issues.
- **Deploy** actually applies the design to the cluster, creating or updating resources as needed.

{{< alert type="info" title="Simply put:" >}}
- *Validate* checks “Did I fill out this design correctly?”
- *Dry Run* asks “If I try to apply this, will Kubernetes accept it?”
- *Deploy* means “Go ahead and create the actual resources now.”
{{< /alert >}}

#### Q: Is Dry Run 100% accurate?
Dry Run is highly accurate because it uses Kubernetes’ official `dryRun=All` API flag.
However, certain dynamic behaviors (e.g., runtime environment differences, sidecar injection) may still only surface during real deployment.

#### Q: Does Dry Run include the schema Validate step? Should I click both?*
No, Dry Run and Validate are separate steps.
Dry Run does **not** include schema validation.
We recommend clicking **Validate first**, then **Dry Run**, then **Deploy**.

## Best Practices & Tips

1. As a best practice, always **Validate → Dry Run → Deploy** - in that order.
2. Use Dry Run in your CI pipelines to catch issues before merge.
3. Ensure your Kubernetes context is correctly configured and you have network access to the clusters you are targeting.

[^1]: In the current release, you may occasionally encounter a case where the Arrow Dropdown Menu does not respond as expected. This is a known issue and is currently being addressed. In the meantime, please use the Actions Dropdown Menu as an alternative for triggering a Dry Run.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's huge value in your discovery and raising of bugs, @zihanKuang. Is there an open issue on this behavior?

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.