Java第1部分中的kubernetes自定义资源定义实现

In this post, we will dive into Custom Resource Definition as a way to extends K8S.

在本文中,我们将深入研究“自定义资源定义”,以扩展K8S。

We will first describe the use case of CRD, some hygiene of writing CRD and finally you will learn how to use Java to generate CRD instead of manually editing it.

我们将首先描述CRD的用例,编写CRD的一些习惯,最后您将学习如何使用Java生成CRD而不是手动编辑它。

This post will demonstrate how to implement Controller and CRD using Java to build CRD without YAML, running a custom controller for your CRD and detail on controller implementation step by step.

这篇文章将演示如何使用Java来实现Controller和CRD,以在不使用YAML的情况下构建CRD,并为CRD运行自定义控制器,并逐步介绍控制器的实现细节。

This post will not dive deep if you should use CRD or note, read the great comparison documentation from K8S.

如果您应该使用CRD或笔记,那么这篇文章将不会深入探讨,请阅读K8S的出色比较文档

This is an advanced level of information and only needed if you extend K8S, therefore I assume you are familiar with in deep of K8S, how to use K8S Java Client, and understand previous posts: Coding K8S resource in Java Part 1 and Part 2 .

这是高级信息 ,仅在您扩展K8S时才需要,因此,我假设您对K8S熟悉,如何使用K8S Java Client,并了解以前的文章: 在Java Part 1Part 2中 编码K8S资源

All the sample code can be download from the GitHub repo and Gist

可以从GitHub存储库Gist下载所有示例代码

什么是自定义资源定义? (What is Custom Resource Definition?)

Most of the time, using K8S with built-in resource is sufficient, all the built-in resources have well structured and comprehensive YAML.

在大多数情况下,将K8S与内置资源一起使用就足够了,所有内置资源都具有结构良好且全面的YAML。

Image for post
Before CRD
在CRD之前

These YAML could be extremely verbose, for example, if you have a MySQL cluster that want to deploy, it will require StatefulSet , Service , leader election, loa

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值