Skip to content

Commit b1a8b9b

Browse files
authored
Merge pull request #300 from Peefy/crossplane-kcl-funcion-marketplace-blog
docs: add crossplane kcl function publishing on the marketplace
2 parents 39703a7 + 60f34eb commit b1a8b9b

File tree

6 files changed

+128
-0
lines changed

6 files changed

+128
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
slug: 2024-03-04-crossplane-marketplace-kcl
3+
title: "Empowering Cloud-Native Platforms: The Synergy of KCL and Crossplane"
4+
authors:
5+
name: KCL Team
6+
title: KCL Team
7+
tags: [KCL, Crossplane]
8+
---
9+
10+
> _Content sourced from the original Crossplane official blog post: [https://blog.crossplane.io/function-kcl](https://blog.crossplane.io/function-kcl)_
11+
12+
## Introduction
13+
14+
[KCL](https://github.com/kcl-lang) is a constraint-based record and functional language hosted by Cloud Native Computing Foundation (CNCF) that enhances the writing of complex configurations and polices, including those for cloud-native scenarios. With its advanced programming language technology and practices, KCL is dedicated to promoting better modularity, scalability, and stability for configurations. It enables simpler logic writing and offers ease of automation APIs and integration with homegrown systems.
15+
16+
**Since the release of the beta version of composite functions in Crossplane v1.14**, the potential for building cloud-native platforms using Crossplane has been rapidly expanding. The KCL team promptly followed up and actively built a reusable function. **The entire Crossplane ecosystem can now utilize the high-level experience and capabilities provided by KCL to build its own cloud-native platform**.
17+
18+
Additionally, Crossplane announced that the KCL function has become the first third-party function component to be released to the Upbound Marketplace, available at https://marketplace.upbound.io/providers/crossplane-contrib/function-kcl. The source code can be found at https://github.com/crossplane-contrib/function-kcl, and contributions and feedback are welcome.
19+
20+
You can install the function-kcl with the following command and start using it across the entire Crossplane control plane:
21+
22+
```shell
23+
crossplane xpkg install function xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0
24+
```
25+
26+
**The Crossplane team and community are thankful for the KCL team's significant contribution, and its substantial enhancement to the evolving Functions for Crossplane ecosystem!**
27+
28+
![crossplane-announcing](/img/blog/2024-03-04-crossplane-marketplace-kcl/crossplane-announcing.png)
29+
30+
Crossplane, along with its composite model, allows developers to create higher-level abstractions that encapsulate and combine various types of cloud resources across different providers and services. Rendering these abstractions using composite functions can effectively enhance the template functionality of various provider resources while reducing the amount of YAML code required.
31+
32+
Combining KCL with Composition Functions offers several benefits:
33+
34+
- **Simplification of Complex Configurations**: KCL provides a more concise syntax and structure as a DSL, reducing the complexity of configurations. When combined with Crossplane’s composite resources, you can create more intuitive and easy-to-understand configuration templates with loop and condition features, simplifying the definition and maintenance of resources instead of duplicate YAMLs.
35+
- **Reusability and Modularity**: KCL supports modularity and code reuse through OCI Registry, which means you can create reusable configuration components. Combined with Crossplane, this promotes the modularity of composite resources, increases the reuse of configurations, and reduces errors.
36+
- **Automation and Policy-Driven**: You can use KCL’s powerful features to write policies and constraints that, combined with Crossplane’s declarative resource management, can be automatically enforced, ensuring compliance within the cloud environment.
37+
38+
## Getting Started
39+
40+
There are two ways to combine KCL and Crossplane:
41+
42+
- One involves using KCL to write Crossplane composite functions and install them for use in a cluster, still using YAML to define the schema and input required by the app team. KCL is used to write rendering logic to Crossplane Manged Resource to interface with different cloud platforms or Kubernetes clusters. **Note: This approach can install KCL functions for use in the cluster and also use the crossplane beta render command to complete Managed Resource rendering directly on the client.**
43+
44+
![crossplane-kcl-func](/img/blog/2024-03-04-crossplane-marketplace-kcl/crossplane-kcl-func.png)
45+
46+
- The other method involves using KCL to entirely provide abstractions for application developers on the client side and generating Crossplane managed resources to deploy to a cluster, providing a unified programmable access layer for Kubernetes. Specific usage defines the schema input required by the app team using KCL Schema and writes the logic to render it to Crossplane Manged Resource to interface with different cloud platforms or Kubernetes clusters.
47+
48+
![kcl-on-crossplane](/img/blog/2024-03-04-crossplane-marketplace-kcl/kcl-on-crossplane.png)
49+
50+
**For detailed instructions on both approaches, please refer to the Crossplane official blog content: https://blog.crossplane.io/function-kcl**
51+
52+
![crossplane-kcl-blog](/img/blog/2024-03-04-crossplane-marketplace-kcl/crossplane-kcl-blog.png)
53+
54+
Both of these methods require a Registry to facilitate the work. The final choice between them may depend on your operational habits and environmental costs. Regardless of the chosen method, **we recommend maintaining KCL code in Git for better GitOps implementation and better IDE experience and reusable modules**, such as using the Crossplane AWS Module: https://github.com/kcl-lang/modules/tree/main/crossplane-provider-aws
55+
56+
## Summary
57+
58+
The function-kcl project is now donated to the Crossplane community, and we encourage the entire community to test it and try using KCL (the latest advanced language experience provided by Crossplane Functions) to build a cloud-native control plane. We welcome contributions and feedback from the community on the GitHub repository. Let us know your thoughts! https://github.com/crossplane-contrib/function-kcl
59+
60+
For more resources, please refer to:
61+
62+
- KCL Website: https://kcl-lang.io/
63+
- KusionStack Website: https://kusionstack.io/
64+
- KCL v0.9.0 Milestone: https://github.com/kcl-lang/kcl/milestone/9
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
slug: 2024-03-04-crossplane-marketplace-kcl
3+
title: 官宣!知名 IaC 工具 Crossplane 宣布 KCL 登陆其官方函数市场!
4+
authors:
5+
name: KCL 团队
6+
title: KCL 团队
7+
tags: [KCL, Crossplane]
8+
---
9+
10+
> _内容转载整理自 Crossplane 官网博客原文:[https://blog.crossplane.io/function-kcl](https://blog.crossplane.io/function-kcl)_
11+
12+
## 内容简介
13+
14+
[KCL](https://github.com/kcl-lang) 是一个 CNCF 基金会托管的基于约束的记录及函数语言,期望通过成熟的编程语言技术和实践来改进对大量繁杂配置比如云原生 Kubernetes 配置场景的编写,致力于构建围绕配置的更好的模块化、扩展性和稳定性,更简单的逻辑编写,以及更简单的自动化和生态工具集成。
15+
16+
**自 Crossplane v1.14 中的组合函数 Beta 版发布以来**,使用 Crossplane 构建云原生平台的可能体验范围一直在迅速扩大。KCL 团队在第一时间进行跟进并主动构建了一个可重用的函数,**整个 Crossplane 生态系统现在可以利用 KCL 提供的高水平经验和能力来构建自己的云原生平台**
17+
18+
同时 Crossplane 宣布 KCL 函数成为**第一个发布到 Upbound 市场的第三方函数组件**,地址为 *[https://marketplace.upbound.io/providers/crossplane-contrib/function-kcl](https://marketplace.upbound.io/providers/crossplane-contrib/function-kcl)* 。源代码可以在 *[https://github.com/crossplane-contrib/function-kcl](https://github.com/crossplane-contrib/function-kcl)* 找到,欢迎贡献和反馈。
19+
20+
您可以通过使用以下一行命令安装 function-kcl 并开始在整个 Crossplane 控制平面中使用:
21+
22+
```shell
23+
crossplane xpkg install function xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0
24+
```
25+
26+
**Crossplane 团队和社区感谢 KCL 团队的这笔巨大捐赠,以及对不断发展的 Functions for Crossplane 生态系统的巨大补充**
27+
28+
![crossplane-announcing](/img/blog/2024-03-04-crossplane-marketplace-kcl/crossplane-announcing.png)
29+
30+
Crossplane 及其组合模型允许开发人员创建更高级别的抽象,这些抽象可以封装和组合跨不同提供商和服务的多种类型的云资源。使用组合函数来渲染这些抽象可以有效增强各种提供者资源的模板功能,同时减少所需的 YAML 代码量。
31+
32+
将 KCL 与 Crossplane 组合函数结合起来有几个好处:
33+
34+
- **简化复杂配置**:KCL 提供了比一般 DSL 更简洁的语法和结构,降低了配置的复杂性。与 Crossplane 的复合资源结合时,您可以创建更直观且易于理解的具有循环和条件功能的配置模板对接到不同的云平台,从而简化资源的定义和维护,而不是编写重复的 YAML 模版。
35+
- **可重用性和模块化**:KCL 通过 OCI Registry 支持模块化和代码重用,这意味着您可以创建可重用的配置组件。与 Crossplane 结合,可以促进复合资源的模块化,提高配置的重用性,并减少错误。
36+
- **自动化和策略支持**:您可以使用 KCL 的强大功能来编写策略和约束,这些策略和约束与 Crossplane 的声明性资源管理相结合,且可以自动实施,从而确保云环境中的合规性,进一步提升效率和稳定性。
37+
38+
## 快速开始
39+
40+
有两种将 KCL 和 Crossplane 结合使用的方式
41+
42+
- 一种是使用 KCL 编写 Crossplane 组合函数并安装到集群使用,仍然采用 YAML 来定义 App Team 所需的 Schema 和输入,使用 KCL 撰写渲染逻辑到 Crossplane Manged Resource 的逻辑以对接不同的云平台或者 Kubernetes 集群。**需要注意的是:这种方式既可以将 KCL 函数安装到集群中使用,也可以使用 crossplane beta render 命令直接在客户端完成 Manged Resource 的渲染。**
43+
44+
![crossplane-kcl-func](/img/blog/2024-03-04-crossplane-marketplace-kcl/crossplane-kcl-func.png)
45+
46+
- 另外一种是使用 KCL 完全在客户端提供面向应用开发者的抽象并生成 Crossplane 托管资源下发到集群,提供 Kubernetes 的统一可编程接入层,具体使用 KCL Schema 规定 App Team 所需的 Schema 输入,并撰写渲染到 Crossplane Manged Resource 的逻辑以对接不同的云平台或者 Kubernetes 集群
47+
48+
![kcl-on-crossplane](/img/blog/2024-03-04-crossplane-marketplace-kcl/kcl-on-crossplane.png)
49+
50+
**两种方法的具体操作方式可以查看 Crossplane 官方博客内容:*https://blog.crossplane.io/function-kcl***
51+
52+
![crossplane-kcl-blog](/img/blog/2024-03-04-crossplane-marketplace-kcl/crossplane-kcl-blog.png)
53+
54+
此外,这两种方式都需要 Registry 来协助完成工作。它们之间的最终选择可能取决于您的操作习惯和环境成本。无论选择哪种方法,**我们都建议在 Git 中维护 KCL 代码,以便更好地实施 GitOps 并获得更好的 IDE 体验和可重用模块**,例如使用 Crossplane AWS Module: *https://github.com/kcl-lang/modules/tree/main/crossplane-provider-aws*
55+
56+
## 小结
57+
58+
现在 function-kcl 项目已捐赠给 Crossplane 社区,我们鼓励整个社区对其进行测试,并尝试使用 KCL(Crossplane Functions 提供的最新高级语言体验)构建云原生控制平面。我们非常欢迎社区在GitHub 上的存储库中提供贡献和反馈。让我们知道您的想法!*https://github.com/crossplane-contrib/function-kcl*
59+
60+
更多其他资源请参考:
61+
62+
- _KCL 网站: https://kcl-lang.io/_
63+
- _KusionStack 网站: https://kusionstack.io/_
64+
- _KCL v0.9.0 Milestone: https://github.com/kcl-lang/kcl/milestone/9_
130 KB
Loading
802 KB
Loading
672 KB
Loading
663 KB
Loading

0 commit comments

Comments
 (0)