1

我是为 kubernetes 编写自定义控制器并试图理解这一点的新手。我已经开始参考示例控制器https://github.com/kubernetes/sample-controller

我想扩展示例控制器以使用 kubernetes 在云中操作 VM 资源。如果检测到新的 VM 种类资源,它可以创建一个 Vm。如果用户需要,更新子资源或删除。

架构应如下所示:

apiVersion: samplecontroller.k8s.io/v1alpha1
kind: VM
metadata:
name: sample
spec:
vmname: test-1
status:
vmId: 1234-567-8910
cpuUtilization: 50 

任何建议或帮助都是非常可观的:)

4

2 回答 2

1

而是从https://book.kubebuilder.io/开始。这是一个比采样控制器更好的起点。

于 2021-05-24T07:45:03.353 回答
0

You can use Operator SDK as well https://github.com/operator-framework/operator-sdk but I think kubebuilder.io is a way better!

However, if you're looking for a controller that supports multi-cloud, already there's one by Kubermatic. https://github.com/kubermatic/machine-controller

it works! you can have a look.

于 2021-05-24T08:32:57.973 回答