Skip to content

Commit

Permalink
Merge pull request #170 from kcl-lang/fix-broken-konfig-links
Browse files Browse the repository at this point in the history
fix: broken konfig links
  • Loading branch information
Peefy authored Sep 22, 2023
2 parents 1c53a19 + 9603dc8 commit 5fb067d
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,21 @@ The `kcl-openapi` tool supports extracting and generating KCL schemas from Kuber

#### 3.1 Write configurations based on the Kusion_Models package

``
We provide an out-of-the-box `kusion_models` package for you to quickly start. It contains a well-designed frontend model called [`Server schema`](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k). You can declare the configurations by initializing the `Server schema`. For the description and usage of the schema and its attributes, please refer to the [Server schema documentation](https://kusionstack.io/docs/reference/model/kusion_models/kube/frontend/doc_server).
``
We provide an out-of-the-box `konfig` package for you to quickly start. It contains a well-designed frontend model called [`Server schema`](https://github.com/kcl-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k). You can declare the configurations by initializing the `Server schema`.

#### 3.2 Build Your Custom Frontend Models

The existing KCL Models may not meet your specific business requirements, then you can also design your custom frontend model package. You can design your custom models based on the pre-generated Kubernetes KCL models among all versions.

##### 3.2.1 Get the k8s package

The [Kubernetes KCL models](https://github.com/orgs/KusionStack/packages/container/package/k8s) among all versions are pre-generated, you get it by executing `kpm add k8s:<version>` under your project. For detailed information about kpm usage, please refer to [kpm quick start guide](https://github.com/kcl-lang/kpm#quick-start).
The [Kubernetes KCL models](https://github.com/orgs/kcl-lang/packages/container/package/k8s) among all versions are pre-generated, you get it by executing `kpm add k8s:<version>` under your project. For detailed information about kpm usage, please refer to [kpm quick start guide](https://github.com/kcl-lang/kpm#quick-start).

Alternatively, if you may want to generate them yourself, please refer to [Generate KCL Packages from Kubernetes OpenAPI Specs](https://github.com/kcl-lang/kcl-openapi/blob/main/docs/generate_from_k8s_spec.md).

##### 3.2.2 Design Custom Frontend Models

Since the Kubernetes built-in models are atomistic and kind of complex to beginners, we recommend taking the native model of Kubernetes as the backend output model and designing a batch of frontend models which could become a more abstract, friendlier and simpler interface to the user. You can refer to the design pattern in the [`Server Schema in the Konfig repo`](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k).
Since the Kubernetes built-in models are atomistic and kind of complex to beginners, we recommend taking the native model of Kubernetes as the backend output model and designing a batch of frontend models which could become a more abstract, friendlier and simpler interface to the user. You can refer to the design pattern in the [`Server Schema in the Konfig repo`](https://github.com/kal-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k).

##### 3.2.3 Migrate The Configuration Data

Expand Down
2 changes: 1 addition & 1 deletion docs/user_docs/guides/working-with-konfig/1-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_label: Overview
---
# Konfig Overview

In KCL, it is recommended to uniformly manage all configurations and model libraries in the way of **configuration library**, that is, to store not only KCL definitions of the abstract model itself, but also various types of configurations, such as application operation and maintenance configuration, policy, etc. The configuration is recommended to be hosted in various VCS systems to facilitate configuration rollback and drift check. The best practice code of the configuration repository is Konfig, and the repository is hosted in [Github](https://github.com/KusionStack/konfig)
In KCL, it is recommended to uniformly manage all configurations and model libraries in the way of **configuration library**, that is, to store not only KCL definitions of the abstract model itself, but also various types of configurations, such as application operation and maintenance configuration, policy, etc. The configuration is recommended to be hosted in various VCS systems to facilitate configuration rollback and drift check. The best practice code of the configuration repository is Konfig, and the repository is hosted in [Github](https://github.com/kcl-lang/konfig)

⚡ The Konfig repository mainly includes:

Expand Down
4 changes: 2 additions & 2 deletions docs/user_docs/guides/working-with-konfig/3-quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Before we start, we need to complete the following steps:

1. Install KCL - See [Download and Install](/docs/user_docs/getting-started/install) for more details.

2. Clone the [Konfig repo](https://github.com/KusionStack/konfig.git)
2. Clone the [Konfig repo](https://github.com/kcl-lang/konfig.git)

```shell
git clone https://github.com/KusionStack/konfig.git && cd konfig
git clone https://github.com/kcl-lang/konfig.git && cd konfig
```

## Quick Start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,6 @@ app:
app: app
```

执行如下命令

```bash
kcl main.k -O config.x-
```

输出结果为:

```yaml
config:
x: 1
y: s
```

### 3. 使用 KCL API 进行自动化

此外,我们还可以通过[多语言 API](/docs/reference/xlang-api/overview) 自动修改配置属性
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ KCLOpenAPI 工具支持从 OpenAPI/CRD 定义提取并生成 KCL schema. 在[KCL

#### 3.1 基于 kusion_models 编写配置

我们为你提供了一个开箱即用的 `kusion_models` 包,让你可以快速开始。其中包含一个精心设计的前端模型,称为[服务器模型](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k)(Server schema)。你可以通过初始化 `Server schema` 来声明其配置。有关模式及其属性的说明和用法,请参阅 [Server schema 文档](https://kusionstack.io/docs/reference/model/kusion_models/kube/frontend/doc_server)
我们为你提供了一个开箱即用的 `kusion_models` 包,让你可以快速开始。其中包含一个精心设计的前端模型,称为[服务器模型](https://github.com/kcl-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k)(Server schema)。你可以通过初始化 `Server schema` 来声明其配置。

#### 3.2 创建自定义的 models 前端模型

现有的 `kusion_models` 模型可能无法满足你的特定业务需求,那么你也可以设计自定义前端模型包。 您可基于预先生成的 Kubernetes KCL 包自定义您的前端模型。您还可以仿照`kube2kcl` 工具的模式,开发自定义脚本,完成配置数据的迁移
现有的 `konfig` 模型可能无法满足你的特定业务需求,那么你也可以设计自定义前端模型包。您可基于预先生成的 Kubernetes KCL 包自定义您的前端模型。

##### 3.2.1 获取 Kubernetes KCL 模型

我们提供了预生成的各版本[Kubernetes KCL模型](https://github.com/orgs/KusionStack/packages/container/package/k8s),您可以在项目下执行 `kpm add k8s:<version>` 来获得它。有关 kpm 使用的详细信息,请参考 [kpm快速入门指南](https://github.com/kcl-lang/kpm#quick-start)
我们提供了预生成的各版本[Kubernetes KCL模型](https://github.com/orgs/kcl-lang/packages/container/package/k8s),您可以在项目下执行 `kpm add k8s:<version>` 来获得它。有关 kpm 使用的详细信息,请参考 [kpm快速入门指南](https://github.com/kcl-lang/kpm#quick-start)

或者,如果您需要自己生成这些包,请参考[从 Kubernetes OpenAPI 文件生成 KCL 包](https://github.com/kcl-lang/kcl-openapi/blob/main/docs/generate_from_k8s_spec.md)

##### 3.2.2 编写自定义前端模型

由于 Kubernetes 内置模型较为原子化和复杂,我们推荐以 Kubernetes 原生模型作为后端输出的模型,对其进一步抽象,而向用户暴露一份更为友好和简单的前端模型界面,具体您可参照 Konfig 仓库中 [kusion_models Server](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k) 模型的设计方式进行。
由于 Kubernetes 内置模型较为原子化和复杂,我们推荐以 Kubernetes 原生模型作为后端输出的模型,对其进一步抽象,而向用户暴露一份更为友好和简单的前端模型界面,具体您可参照 Konfig 仓库中 [kusion_models Server](https://github.com/kcl-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k) 模型的设计方式进行。

##### 3.2.3 迁移配置数据

Expand All @@ -47,7 +47,7 @@ KCLOpenAPI 工具支持从 OpenAPI/CRD 定义提取并生成 KCL schema. 在[KCL

* 从 CRD 生成 KCL Schema

```
```sh
kcl-openapi generate model --crd --skip-validation -f your_crd.yaml
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_label: 概述
---
# Konfig 概述

在 KCL 中推荐通过**配置库**的方式统一管理所有的配置清单和模型库,即不仅存放抽象模型本身的 KCL 定义,还存放各种类型的配置清单,比如应用的运维配置、策略配置等。配置大库推荐托管在各类 VCS 系统中,以方便做配置的回滚和漂移检查。配置大库的最佳实践代号为 Konfig,仓库托管在 [Github](https://github.com/KusionStack/konfig)
在 KCL 中推荐通过**配置库**的方式统一管理所有的配置清单和模型库,即不仅存放抽象模型本身的 KCL 定义,还存放各种类型的配置清单,比如应用的运维配置、策略配置等。配置大库推荐托管在各类 VCS 系统中,以方便做配置的回滚和漂移检查。配置大库的最佳实践代号为 Konfig,仓库托管在 [Github](https://github.com/kcl-lang/konfig)

⚡️ 配置大库主要包括:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ sidebar_label: 快速开始

1. 安装 KCL, 详情信息请参阅[下载和安装](/docs/user_docs/getting-started/install)

2. 下载开源 Konfig 大库,仓库地址: [https://github.com/KusionStack/konfig.git](https://github.com/KusionStack/konfig.git)
2. 下载开源 Konfig 大库,仓库地址: [https://github.com/kcl-lang/konfig.git](https://github.com/kcl-lang/konfig.git)

```shell
git clone https://github.com/KusionStack/konfig.git && cd konfig
git clone https://github.com/kcl-lang/konfig.git && cd konfig
```

## 快速开始
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,6 @@ app:
app: app
```

执行如下命令

```bash
kcl main.k -O config.x-
```

输出结果为:

```yaml
config:
x: 1
y: s
```

### 3. 使用 KCL API 进行自动化

此外,我们还可以通过[多语言 API](/docs/reference/xlang-api/overview) 自动修改配置属性
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ KCLOpenAPI 工具支持从 OpenAPI/CRD 定义提取并生成 KCL schema. 在[KCL

#### 3.1 基于 kusion_models 编写配置

我们为你提供了一个开箱即用的 `kusion_models` 包,让你可以快速开始。其中包含一个精心设计的前端模型,称为[服务器模型](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k)(Server schema)。你可以通过初始化 `Server schema` 来声明其配置。有关模式及其属性的说明和用法,请参阅 [Server schema 文档](https://kusionstack.io/docs/reference/model/kusion_models/kube/frontend/doc_server)
我们为你提供了一个开箱即用的 `kusion_models` 包,让你可以快速开始。其中包含一个精心设计的前端模型,称为[服务器模型](https://github.com/kcl-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k)(Server schema)。你可以通过初始化 `Server schema` 来声明其配置。

#### 3.2 创建自定义的 models 前端模型

现有的 `kusion_models` 模型可能无法满足你的特定业务需求,那么你也可以设计自定义前端模型包。 您可基于预先生成的 Kubernetes KCL 包自定义您的前端模型。您还可以仿照`kube2kcl` 工具的模式,开发自定义脚本,完成配置数据的迁移
现有的 `konfig` 模型可能无法满足你的特定业务需求,那么你也可以设计自定义前端模型包。您可基于预先生成的 Kubernetes KCL 包自定义您的前端模型。

##### 3.2.1 获取 Kubernetes KCL 模型

我们提供了预生成的各版本[Kubernetes KCL模型](https://github.com/orgs/KusionStack/packages/container/package/k8s),您可以在项目下执行 `kpm add k8s:<version>` 来获得它。有关 kpm 使用的详细信息,请参考 [kpm快速入门指南](https://github.com/kcl-lang/kpm#quick-start)
我们提供了预生成的各版本[Kubernetes KCL模型](https://github.com/orgs/kcl-lang/packages/container/package/k8s),您可以在项目下执行 `kpm add k8s:<version>` 来获得它。有关 kpm 使用的详细信息,请参考 [kpm快速入门指南](https://github.com/kcl-lang/kpm#quick-start)

或者,如果您需要自己生成这些包,请参考[从 Kubernetes OpenAPI 文件生成 KCL 包](https://github.com/kcl-lang/kcl-openapi/blob/main/docs/generate_from_k8s_spec.md)

##### 3.2.2 编写自定义前端模型

由于 Kubernetes 内置模型较为原子化和复杂,我们推荐以 Kubernetes 原生模型作为后端输出的模型,对其进一步抽象,而向用户暴露一份更为友好和简单的前端模型界面,具体您可参照 Konfig 仓库中 [kusion_models Server](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k) 模型的设计方式进行。
由于 Kubernetes 内置模型较为原子化和复杂,我们推荐以 Kubernetes 原生模型作为后端输出的模型,对其进一步抽象,而向用户暴露一份更为友好和简单的前端模型界面,具体您可参照 Konfig 仓库中 [kusion_models Server](https://github.com/kcl-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k) 模型的设计方式进行。

##### 3.2.3 迁移配置数据

Expand All @@ -47,7 +47,7 @@ KCLOpenAPI 工具支持从 OpenAPI/CRD 定义提取并生成 KCL schema. 在[KCL

* 从 CRD 生成 KCL Schema

```
```sh
kcl-openapi generate model --crd --skip-validation -f your_crd.yaml
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_label: 概述
---
# Konfig 概述

在 KCL 中推荐通过**配置库**的方式统一管理所有的配置清单和模型库,即不仅存放抽象模型本身的 KCL 定义,还存放各种类型的配置清单,比如应用的运维配置、策略配置等。配置大库推荐托管在各类 VCS 系统中,以方便做配置的回滚和漂移检查。配置大库的最佳实践代号为 Konfig,仓库托管在 [Github](https://github.com/KusionStack/konfig)
在 KCL 中推荐通过**配置库**的方式统一管理所有的配置清单和模型库,即不仅存放抽象模型本身的 KCL 定义,还存放各种类型的配置清单,比如应用的运维配置、策略配置等。配置大库推荐托管在各类 VCS 系统中,以方便做配置的回滚和漂移检查。配置大库的最佳实践代号为 Konfig,仓库托管在 [Github](https://github.com/kcl-lang/konfig)

⚡️ 配置大库主要包括:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ sidebar_label: 快速开始

1. 安装 KCL, 详情信息请参阅[下载和安装](/docs/user_docs/getting-started/install)

2. 下载开源 Konfig 大库,仓库地址: [https://github.com/KusionStack/konfig.git](https://github.com/KusionStack/konfig.git)
2. 下载开源 Konfig 大库,仓库地址: [https://github.com/kcl-lang/konfig.git](https://github.com/kcl-lang/konfig.git)

```shell
git clone https://github.com/KusionStack/konfig.git && cd konfig
git clone https://github.com/kcl-lang/konfig.git && cd konfig
```

## 快速开始
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ The `kcl-openapi` tool supports extracting and generating KCL schemas from Kuber

#### 3.1 Write configurations based on the Kusion_Models package

We provide an out-of-the-box `kusion_models` package for you to quickly start. It contains a well-designed frontend model called [`Server schema`](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k). You can declare the configurations by initializing the `Server schema`. For the description and usage of the schema and its attributes, please refer to the [Server schema documentation](https://kusionstack.io/docs/reference/model/kusion_models/kube/frontend/doc_server).
We provide an out-of-the-box `konfig` package for you to quickly start. It contains a well-designed frontend model called [`Server schema`](https://github.com/kcl-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k). You can declare the configurations by initializing the `Server schema`.

#### 3.2 Build Your Custom Frontend Models

The existing KCL Models may not meet your specific business requirements, then you can also design your custom frontend model package. You can design your custom models based on the pre-generated Kubernetes KCL models among all versions.

##### 3.2.1 Get the k8s package

The [Kubernetes KCL models](https://github.com/orgs/KusionStack/packages/container/package/k8s) among all versions are pre-generated, you get it by executing `kpm add k8s:<version>` under your project. For detailed information about kpm usage, please refer to [kpm quick start guide](https://github.com/kcl-lang/kpm#quick-start).
The [Kubernetes KCL models](https://github.com/orgs/kcl-lang/packages/container/package/k8s) among all versions are pre-generated, you get it by executing `kpm add k8s:<version>` under your project. For detailed information about kpm usage, please refer to [kpm quick start guide](https://github.com/kcl-lang/kpm#quick-start).

Alternatively, if you may want to generate them yourself, please refer to [Generate KCL Packages from Kubernetes OpenAPI Specs](https://github.com/kcl-lang/kcl-openapi/blob/main/docs/generate_from_k8s_spec.md).

##### 3.2.2 Design Custom Frontend Models

Since the Kubernetes built-in models are atomistic and kind of complex to beginners, we recommend taking the native model of Kubernetes as the backend output model and designing a batch of frontend models which could become a more abstract, friendlier and simpler interface to the user. You can refer to the design pattern in the [`Server Schema in the Konfig repo`](https://github.com/KusionStack/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k).
Since the Kubernetes built-in models are atomistic and kind of complex to beginners, we recommend taking the native model of Kubernetes as the backend output model and designing a batch of frontend models which could become a more abstract, friendlier and simpler interface to the user. You can refer to the design pattern in the [`Server Schema in the Konfig repo`](https://github.com/kal-lang/konfig/blob/main/base/pkg/kusion_models/kube/frontend/server.k).

##### 3.2.3 Migrate The Configuration Data

Expand All @@ -53,7 +53,7 @@ If you developed CRDs, you can generate the KCL version of the CRD schemas and d

* Generate KCL Schema from CRD

```sh
```
kcl-openapi generate model --crd --skip-validation -f <your_crd.yaml>
```
Expand Down
Loading

0 comments on commit 5fb067d

Please sign in to comment.