カスタムテンプレートを作成する
7347 ワード
どのようなKubernetesですか?☸
👉🏻 K 8 Sと略されるKubernetesは、現代のインフラ自動化のための人気のあるオープンソースツールです.これは、分散システムでコンテナアプリケーションを展開、スケール、管理するために使用されます.
詳しくはhttps://kubernetes.io/docs/home/
モノクルとは何か💬
👉🏻 Monokleはあなたに役立ちます:
🌀 どのように我々はKubernetesサービスのテンプレートを書くためのモノクルを使用できるかを探る
何がMonokleテンプレートですか?💬
👉🏻 モノクルテンプレートは、視覚フォームを作成し、それらのフォームからデータを1つまたは複数のマニフェストに補間するためのメカニズムです.
各フォームについては、フォームとして使用するデータのJSONスキーマとフォームのビジュアルをカスタマイズするUIスキーマを定義する必要があります.
詳しくはhttps://kubeshop.github.io/monokle/templates/
必要条件:
👉🏻 ステップ1:作成
package.json
ファイル{
"name": "Templates plugin",
"description": "Custom templates plugin",
"version": "1.0.0",
"author": "Hitesh Kowdiki",
"repository": "https://github.com/kkhitesh/monokle-templates-plugin",
"monoklePlugin": {
"id": "com.github.kkhitesh.plugin.templates",
"helpUrl": "https://github.com/kkhitesh/monokle-templates-plugin",
"modules": [{
"type": "template",
"path": "basic-pod-template"
}]
}
}
🌀 これでpath
テンプレートの基本位置を指定します👉🏻 *ステップ2 :*フォルダ名を作成する
basic-pod-template
次のコンテンツを追加します.1 . create
monokle-template.json
次の行を追加します.{
"name": "Basic Kubernetes Pod",
"id": "com.github.kkhitesh.plugin.templates.basic-pod-template",
"author": "Hitesh Kowdiki",
"version": "1.0.0",
"description": "Creates a Pod for a specified Image",
"repository": "",
"type": "vanilla",
"forms": [
{
"name": "Pod Settings",
"description": "Specify the settings for your Pod",
"schema": "form-schema.json",
"uiSchema": "form-ui-schema.json"
}
],
"manifests": [
{
"filePath": "template.yaml"
}
],
"resultMessage": "Pod resource created successfully!",
"helpUrl": "https://github.com/kkhitesh/monokle-templates-plugin"
}
2 . createform-schema.json
次の行を追加します.{
"type": "object",
"required": [
"name",
"image"
],
"properties": {
"name": {
"type": "string",
"default": "my-pod"
},
"namespace": {
"type": "string"
},
"image": {
"type": "string"
}
}
}
3 . Createform-ui-schema.json
次の行を追加します.{
"name": {
"ui:title": "Name",
"ui:help": "The name of the Pod"
},
"namespace": {
"ui:title": "Namespace",
"ui:help": "The target namespace for the Pod",
"ui:widget": "namespaceSelection"
},
"image": {
"ui:title": "Image",
"ui:help": "The image name to use for the Pod, for example nginx-ingress:latest"
}
}
4 . createtemplate.yaml
次の行を追加します.apiVersion: v1
kind: Pod
metadata:
name: [[forms[0].name]]
[[ forms[0].namespace ? " namespace: " + forms[0].namespace + "\n" : ""]]
spec:
containers:
- image: [[forms[0].image]]
name: [[forms[0].name]]
resources: {}
🌀 Githubにコードをプッシュします.https://github.com/kkhitesh/monokle-templates-plugin カスタムテンプレートの使用時間
👉🏻 ステップ1:実行モノクル

👉🏻 ステップ2 :プラグインのインストール
右上隅にプラグインボタンがあります


🌀 プラグインをインストールする

👉🏻 ステップ3:ダッシュボードからプロジェクトを作成する

🌀 テンプレートを選択

🌀 プロジェクト作成




カスタムテンプレートを作成しました🥳🥳
読書ありがとう🙌🏻🙌🏻
🚀 接続してください.
Reference
この問題について(カスタムテンプレートを作成する), 我々は、より多くの情報をここで見つけました https://dev.to/kkhitesh/create-custom-templates-in-monokle-446jテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol