-
Notifications
You must be signed in to change notification settings - Fork 15
add how-to-customize-consoleyamlsamples #45
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
docs/en/solutions/How_To_Customize_Samples_for_Web_Console.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| id: KB250500032 | ||
| products: | ||
| - Alauda Container Platform | ||
| kind: | ||
| - Solution | ||
| --- | ||
|
|
||
| # How to Customize Samples for Web Console | ||
|
|
||
| You can dynamically add YAML examples to any Kubernetes resources at any time. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - You must have cluster administrator privileges. | ||
| - Target for `Custom Resources`, ensure the CRD (apiVersion/kind) is already installed in the cluster. | ||
|
|
||
| ## Resolution | ||
|
|
||
| 1). Create a YAML example for the `Deployment` resource by defining a `ConsoleYAMLSample` object. | ||
|
|
||
| 2). Apply the object to the cluster: | ||
| ```yaml | ||
|
zhhray marked this conversation as resolved.
|
||
| apiVersion: console.alauda.io/v1 | ||
| kind: ConsoleYAMLSample | ||
| metadata: | ||
| name: sample-deployment | ||
| spec: | ||
| title: "NGINX Deployment" | ||
| description: "Sample deployment with 2 replicas" | ||
| targetResource: | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| yaml: | | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: nginx-deploy | ||
| spec: | ||
| replicas: 2 | ||
| selector: | ||
| matchLabels: | ||
| app: nginx | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: nginx | ||
| spec: | ||
| containers: | ||
| - name: nginx | ||
| image: nginx:1.25 | ||
| ``` | ||
|
|
||
| Note: ConsoleYAMLSample is a cluster-scoped resource – do not specify a namespace during creation. | ||
|
zhhray marked this conversation as resolved.
|
||
|
|
||
| Field specification: | ||
| | Field | Description | Required/Optional | | ||
| | --------- | --------- | ----------- | | ||
| | title | The title of the sample as displayed in the web UI. | Required | | ||
| | description | A detailed description of the sample. | Required | | ||
| | targetResource | Specifies the target resource type using apiVersion and kind. This supports both native Kubernetes resources and Custom Resource Definitions (CRDs). | Required | | ||
| | yaml | The actual YAML template. Must conform to the schema of the target resource. | Required | | ||
| | snippet | When set to true, only a code snippet is displayed instead of the full YAML. | Optional | | ||
|
|
||
| This resource allows users to seamlessly integrate custom YAML examples directly into the Alauda web console, improving usability and accelerating development workflows. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.