Preparing for v0.8.0 release (#543)

Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
This commit is contained in:
Siyu Wang 2021-03-04 12:41:01 +08:00 committed by GitHub
parent 825d6d0454
commit 117e676672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 5583 additions and 59 deletions

View File

@ -1,7 +1,95 @@
# Change Log
## v0.8.0
### Breaking changes
1. The flags for kruise-manager must start with `--` instead of `-`. If you install Kruise with helm chart, ignore this.
2. SidecarSet has been refactored. Make sure there is no SidecarSet being upgrading when you upgrade Kruise,
and read [the latest doc for SidecarSet](https://openkruise.io/en-us/docs/sidecarset.html).
3. A new component named `kruise-daemon` comes in. It is deployed in kruise-system using DaemonSet, defaults on every Node.
Now Kruise includes two components:
- **kruise-controller-manager**: contains multiple controllers and webhooks, deployed using Deployment.
- **kruise-daemon**: contains bypass features like image pre-download and container restart in the future, deployed using DaemonSet.
### New CRDs: NodeImage and ImagePullJob
[Official doc](https://openkruise.io/en-us/docs/imagepulljob.html)
Kruise will create a NodeImage for each Node, and its `spec` contains the images that should be downloaded on this Node.
Also, users can create an ImagePullJob CR to declare an image should be downloaded on which nodes.
```yaml
apiVersion: apps.kruise.io/v1alpha1
kind: ImagePullJob
metadata:
name: test-imagepulljob
spec:
image: nginx:latest
completionPolicy:
type: Always
parallelism: 10
pullPolicy:
backoffLimit: 3
timeoutSeconds: 300
selector:
matchLabels:
node-label: xxx
```
### SidecarSet
[Official doc](https://openkruise.io/en-us/docs/sidecarset.html)
- Refactor the controller and webhook for SidecarSet:
- For `spec`:
- Add `namespace`: indicates this SidecarSet will only inject for Pods in this namespace.
- For `spec.containers`:
- Add `podInjectPolicy`: indicates this sidecar container should be injected in the front or end of `containers` list.
- Add `upgradeStrategy`: indicates the upgrade strategy of this sidecar container (currently it only supports `ColdUpgrade`)
- Add `shareVolumePolicy`: indicates whether to share other containers' VolumeMounts in the Pod.
- Add `transferEnv`: can transfer the names of env shared from other containers.
- For `spec.updateStrategy`:
- Add `type`: contains `NotUpdate` or `RollingUpdate`.
- Add `selector`: indicates only update Pods that matched this selector.
- Add `partition`: indicates the desired number of Pods in old revisions.
- Add `scatterStrategy`: defines the scatter rules to make pods been scattered during updating.
### CloneSet
- Add `currentRevision` field in status.
- Optimize CloneSet scale sequence.
- Fix condition for pod lifecycle state from Updated to Normal.
- Change annotations `inplace-update-state` => `apps.kruise.io/inplace-update-state`, `inplace-update-grace` => `apps.kruise.io/inplace-update-grace`.
- Fix `maxSurge` calculation when partition > replicas.
### UnitedDeployment
- Support Deployment as template in UnitedDeployment.
### Advanced StatefulSet
- Support lifecycle hook for in-place update and pre-delete.
### BroadcastJob
- Add PodFitsResources predicates.
- Add `--assign-bcj-pods-by-scheduler` flag to control whether to use scheduler to assign BroadcastJob's Pods.
### Others
- Add feature-gate to replace the CUSTOM_RESOURCE_ENABLE env.
- Add GetScale/UpdateScale into clientsets for scalable resources.
- Support multi-platform build in Makefile.
- Set different user-agent for controllers.
## v0.7.0
### Breaking changes
Since v0.7.0:
1. OpenKruise requires Kubernetes 1.13+ because of CRD conversion.

View File

@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.14 as builder
FROM golang:1.15 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
@ -21,11 +21,11 @@ RUN CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o manager main.go \
&& CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o daemon ./cmd/daemon/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
#FROM gcr.io/distroless/static:nonroot
FROM ubuntu:latest
# This is required by daemon connnecting with cri
RUN apt-get update -y && apt-get install ca-certificates -y && rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/* /usr/sbin/ && apt-get update -y \
&& apt-get install --no-install-recommends -y ca-certificates \
&& apt-get clean && rm -rf /var/log/*log /var/lib/apt/lists/* /var/log/apt/* /var/lib/dpkg/*-old /var/cache/debconf/*-old
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/daemon ./kruise-daemon

View File

@ -58,6 +58,7 @@ vet:
# Generate code
generate: controller-gen
@scripts/generate_client.sh
@scripts/generate_openapi.sh
@scripts/generate_bindata.sh
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./apis/..."

View File

@ -12,16 +12,16 @@
|![notification](docs/img/bell-outline-badge.svg) 最新进展:|
|------------------|
|Feb 4th, 2021. Kruise v0.8.0 is 发布! 提供了重构版本的 SidecarSet、UnitedDeployment 支持管理 Deployment以及一个新的 kruise-daemon 组件目前支持镜像预热,详情参见 [CHANGELOG](CHANGELOG.md).|
|Dec 16th, 2020. Kruise v0.7.0 发布! 提供一个新的 AdvancedCronJob CRD、将 Advanced StatefulSet 升级 v1beta1 版本、以及其他控制器一些新增能力,详情参见 [CHANGELOG](CHANGELOG.md).|
|Oct 1st, 2020. Kruise v0.6.1 发布! 提供一系列增强 feature 和 bugfix 比如 CloneSet lifecycle hook 、UnitedDeployment 支持 CloneSet 等,详情参见 [CHANGELOG](CHANGELOG.md).|
|Aug 19th, 2020. Kruise v0.6.0 发布! 升级新的项目结构和依赖,并提供新的 Advanced DaemonSet 控制器,详情参见 [CHANGELOG](CHANGELOG.md).|
## 介绍
OpenKruise (官网: [https://openkruise.io](https://openkruise.io)) 是托管在 [Cloud Native Computing Foundation](https://cncf.io/) (CNCF) 下的 Sandbox 项目。
它提供一套在 [Kubernetes核心控制器](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/) 之外的扩展 workload 管理和实现
它提供一套在 [Kubernetes核心控制器](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/) 之外的扩展工作负载、应用管理能力
目前Kruise 提供了以下 workload 控制器:
目前Kruise 主要提供了以下控制器能力
- [CloneSet](https://openkruise.io/zh-cn/docs/cloneset.html): 提供了更加高效、确定可控的应用管理和部署能力,支持优雅原地升级、指定删除、发布顺序可配置、并行/灰度发布等丰富的策略,可以满足更多样化的应用场景。
@ -29,16 +29,15 @@ OpenKruise (官网: [https://openkruise.io](https://openkruise.io)) 是托管在
- [SidecarSet](https://openkruise.io/zh-cn/docs/sidecarset.html): 对 sidecar 容器做统一管理,在满足 selector 条件的 Pod 中注入指定的 sidecar 容器。
- [Advanced DaemonSet](https://openkruise.io/zh-cn/docs/advanced_daemonset.html): 基于原生 DaemonSet 之上的增强版本,默认行为与原生一致,在此之外提供了灰度分批、按 Node label 选择、暂停、热升级等发布策略。
- [UnitedDeployment](https://openkruise.io/zh-cn/docs/uniteddeployment.html): 通过多个 subset workload 将应用部署到多个可用区。
- [BroadcastJob](https://openkruise.io/zh-cn/docs/broadcastjob.html): 配置一个 job在集群中所有满足条件的 Node 上都跑一个 Pod 任务。
- [Advanced DaemonSet](https://openkruise.io/zh-cn/docs/advanced_daemonset.html): 基于原生 DaemonSet 之上的增强版本,默认行为与原生一致,在此之外提供了灰度分批、按 Node label 选择、暂停、热升级等发布策略。
- [AdvancedCronJob](https://openkruise.io/zh-cn/docs/advancedcronjob.html): 一个扩展的 CronJob 控制器,目前 template 模板支持配置使用 Job 或 BroadcastJob。
项目的 **roadmap** 参考[这里](https://github.com/openkruise/kruise/projects)。
[Video](https://www.youtube.com/watch?v=elB7reZ6eAQ) by [Lachlan Evenson](https://github.com/lachie83) 是一个对于新人很友好的 demo。
- [ImagePullJob](https://openkruise.io/zh-cn/docs/imagepulljob.html): 支持用户指定在任意范围的节点上预热镜像。
## 核心功能
@ -54,6 +53,10 @@ OpenKruise (官网: [https://openkruise.io](https://openkruise.io)) 是托管在
定义一个跨多个可用区的全局 workload容器OpenKruise 会帮你在每个可用区创建一个对应的下属 workload。你可以统一管理他们的副本数、版本、甚至针对不同可用区采用不同的发布策略。
- **镜像预热**
支持用户指定在任意范围的节点上下载镜像。
- **...**
## 快速开始
@ -63,15 +66,15 @@ OpenKruise (官网: [https://openkruise.io](https://openkruise.io)) 是托管在
```bash
# Kubernetes 版本 1.13 或 1.14
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz --disable-openapi-validation
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.8.0/kruise-chart.tgz --disable-openapi-validation
# Kubernetes 版本大于等于 1.15
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.8.0/kruise-chart.tgz
```
注意直接安装 chart 会使用默认的 template values你也可以根据你的集群情况指定一些特殊配置比如修改 resources 限制或者只启用某些特定的控制器能力
注意直接安装 chart 会使用默认的 template values你也可以根据你的集群情况指定一些特殊配置比如修改 resources 限制或者配置 feature-gates
更多细节可以查看 [quick-start手册](https://openkruise.io/zh-cn/docs/quick_start.html)
更多细节可以查看 [安装手册](https://openkruise.io/zh-cn/docs/installation.html)
## 文档

View File

@ -12,16 +12,16 @@ English | [简体中文](./README-zh_CN.md)
|![notification](docs/img/bell-outline-badge.svg) What is NEW!|
|------------------|
|Feb 4th, 2021. Kruise v0.8.0 is **RELEASED**! It provides refactoring SidecarSet, Deployment hosted by UnitedDeployment, and a new kruise-daemon component which supports image pre-download, please check the [CHANGELOG](CHANGELOG.md) for details.|
|Dec 16th, 2020. Kruise v0.7.0 is **RELEASED**! It provides a new CRD named AdvancedCronJob, promotes AdvancedStatefulSet to v1beta1 and a few features in other controllers, please check the [CHANGELOG](CHANGELOG.md) for details.|
|Oct 1st, 2020. Kruise v0.6.1 is **RELEASED**! It provides various features and bugfix, such as CloneSet lifecycle hook and UnitedDeployment supported CloneSet, please check the [CHANGELOG](CHANGELOG.md) for details.|
|Aug 19th, 2020. Kruise v0.6.0 is **RELEASED**! It updates Kubernetes dependency and switches to new controller runtime framework. It also supports a new controller called Advanced DaemonSet, please check the [CHANGELOG](CHANGELOG.md) for details.|
## Introduction
OpenKruise (official site: [https://openkruise.io](https://openkruise.io)) is now hosted by the [Cloud Native Computing Foundation](https://cncf.io/) (CNCF) as a Sandbox Level Project.
It consists of several controllers which extend and complement the [Kubernetes core controllers](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/) for workload management.
It consists of several controllers which extend and complement the [Kubernetes core controllers](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/) for workload and application management.
As of now, Kruise offers these workload controllers:
As of now, Kruise mainly offers these controllers:
- [CloneSet](https://openkruise.io/en-us/docs/cloneset.html): CloneSet is a workload that mainly focuses on managing stateless applications. It provides a rich set of features for more efficient, deterministic and controlled management, such as in-place update, specified Pod deletion, configurable priority/scatter based update, preUpdate/postUpdate hooks, etc. This [post](https://thenewstack.io/introducing-cloneset-production-grade-kubernetes-deployment-crd/) provides more details about why CloneSet is useful.
@ -29,16 +29,15 @@ As of now, Kruise offers these workload controllers:
- [SidecarSet](https://openkruise.io/en-us/docs/sidecarset.html): A controller that injects sidecar containers into the Pod spec based on the Pod selectors. The controller is also responsible for upgrading the sidecar containers.
- [Advanced DaemonSet](https://openkruise.io/en-us/docs/advanced_daemonset.html): An enhanced version of default [DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) with extra upgrade strategies such as partition, node selector, pause and surging.
- [UnitedDeployment](https://openkruise.io/en-us/docs/uniteddeployment.html): This controller manages application Pods spread in multiple fault domains by using multiple workloads.
- [BroadcastJob](https://openkruise.io/en-us/docs/broadcastjob.html): A job that runs Pods to completion across all the nodes in the cluster.
- [Advanced DaemonSet](https://openkruise.io/en-us/docs/advanced_daemonset.html): An enhanced version of default [DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) with extra upgrade strategies such as partition, node selector, pause and surging.
- [AdvancedCronJob](https://openkruise.io/en-us/docs/advancedcronjob.html): An extended CronJob controller, currently its template supports Job and BroadcastJob.
The project **roadmap** is actively updated in [here](https://github.com/openkruise/kruise/projects).
This [video](https://www.youtube.com/watch?v=elB7reZ6eAQ) demo by [Lachlan Evenson](https://github.com/lachie83) is a good introduction for new users.
- [ImagePullJob](https://openkruise.io/en-us/docs/imagepulljob.html): Help users download images on any nodes they want.
## Key Features
@ -54,22 +53,28 @@ This [video](https://www.youtube.com/watch?v=elB7reZ6eAQ) demo by [Lachlan Evens
A global workload can be defined over multiple fault domains, and the Kruise controller will spread a sub workload in each domain. You can manage the domain replicas, sub workload template and update strategies uniformly using the global workload.
- **Image pre-download**
Help users download images on any nodes they want.
- **...**
## Quick Start
For a Kubernetes cluster with its version higher than v1.13, you can simply install Kruise with helm v3.1.0+:
```bash
# Kubernetes 1.13 and 1.14
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz --disable-openapi-validation
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.8.0/kruise-chart.tgz --disable-openapi-validation
# Kubernetes 1.15 and newer versions
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.7.0/kruise-chart.tgz
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.8.0/kruise-chart.tgz
```
Note that installing this chart directly means it will use the default template values for the kruise-manager.
You may have to set your specific configurations when it is deployed into a production cluster or you want to enable/disable specific controllers.
You may have to set your specific configurations when it is deployed into a production cluster or you want to configure feature-gates.
For more details, see [quick-start](https://openkruise.io/en-us/docs/quick_start.html).
For more details, see [installation doc](https://openkruise.io/en-us/docs/installation.html).
## Documentation

1
apis/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
openapi_generated.go

View File

@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:openapi-gen=true
// +kubebuilder:object:generate=true
package pub

View File

@ -130,6 +130,7 @@ type AdvancedCronJobStatus struct {
}
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=acj

View File

@ -208,6 +208,7 @@ type JobCondition struct {
}
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=bcj

View File

@ -204,6 +204,7 @@ type CloneSetCondition struct {
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector

View File

@ -236,6 +236,7 @@ const (
)
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=daemon

View File

@ -55,7 +55,7 @@ func setDefaultSidecarContainer(sidecarContainer *SidecarContainer) {
func setSidecarSetUpdateStratety(strategy *SidecarSetUpdateStrategy) {
if strategy.Type == "" {
strategy.Type = NotUpdateSidecarSetStrategyType
strategy.Type = RollingUpdateSidecarSetStrategyType
}
if strategy.MaxUnavailable == nil {
maxUnavailable := intstr.FromInt(1)
@ -495,7 +495,7 @@ func SetDefaultsImageTagPullPolicy(obj *ImageTagPullPolicy) {
obj.TimeoutSeconds = utilpointer.Int32Ptr(600)
}
if obj.BackoffLimit == nil {
obj.TimeoutSeconds = utilpointer.Int32Ptr(3)
obj.BackoffLimit = utilpointer.Int32Ptr(3)
}
}

View File

@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:openapi-gen=true
// +groupName=apps.kruise.io
package v1alpha1

View File

@ -115,6 +115,7 @@ type ImagePullJobStatus struct {
}
// +genclient
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="TOTAL",type="integer",JSONPath=".status.desired",description="Number of all nodes matched by this job"

View File

@ -206,6 +206,7 @@ const (
// +genclient
// +genclient:nonNamespaced
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:subresource:status

View File

@ -168,6 +168,7 @@ type SidecarSetStatus struct {
// +genclient
// +genclient:nonNamespaced
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:subresource:status

View File

@ -228,6 +228,7 @@ const (
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector

View File

@ -254,6 +254,7 @@ type UpdateStatus struct {
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector

View File

@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:openapi-gen=true
// +groupName=apps.kruise.io
package v1beta1

View File

@ -240,6 +240,7 @@ const (
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector

View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

View File

@ -0,0 +1,16 @@
apiVersion: v1
name: kruise
description: Helm chart for kruise components
version: 0.8.0
icon: http://openkruise.io/img/kruise_white.png
keywords:
- kubernetes
- kruise
- workload
- statefulset
- sidecar
- job
- deployment
home: https://openkruise.io
sources:
- https://github.com/openkruise/kruise

View File

@ -0,0 +1,101 @@
# Kruise
## Install
Install with Helm 3:
OpenKruise only supports Kubernetes version >= `1.13+` because of CRD conversion.
Note that for Kubernetes 1.13 and 1.14, users must enable `CustomResourceWebhookConversion` feature-gate in kube-apiserver before install or upgrade Kruise.
```bash
# Kubernetes 1.13 and 1.14
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.8.0/kruise-chart.tgz --disable-openapi-validation
# Kubernetes 1.15 and newer versions
helm install kruise https://github.com/openkruise/kruise/releases/download/v0.8.0/kruise-chart.tgz
```
you will see follow:
```
NAME: kruise
LAST DEPLOYED: Tue Mar 2 12:03:51 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
```
## Uninstall
```bash
$ helm delete kruise
release "kruise" uninstalled
```
## Configuration
The following table lists the configurable parameters of the kruise chart and their default values.
| Parameter | Description | Default |
| ----------------------------------------- | ------------------------------------------------------------ | ----------------------------- |
| `featureGates` | Feature gates for Kruise, empty string means all enabled | `` |
| `manager.log.level` | Log level that kruise-manager printed | `4` |
| `manager.replicas` | Replicas of kruise-controller-manager deployment | `2` |
| `manager.image.repository` | Repository for kruise-manager image | `openkruise/kruise-manager` |
| `manager.image.tag` | Tag for kruise-manager image | `v0.8.0` |
| `manager.resources.limits.cpu` | CPU resource limit of kruise-manager container | `100m` |
| `manager.resources.limits.memory` | Memory resource limit of kruise-manager container | `256Mi` |
| `manager.resources.requests.cpu` | CPU resource request of kruise-manager container | `100m` |
| `manager.resources.requests.memory` | Memory resource request of kruise-manager container | `256Mi` |
| `manager.metrics.port` | Port of metrics served | `8080` |
| `manager.webhook.port` | Port of webhook served | `9443` |
| `manager.nodeAffinity` | Node affinity policy for kruise-manager pod | `{}` |
| `manager.nodeSelector` | Node labels for kruise-manager pod | `{}` |
| `manager.tolerations` | Tolerations for kruise-manager pod | `[]` |
| `daemon.log.level` | Log level that kruise-daemon printed | `4` |
| `daemon.port` | Port of metrics and healthz that kruise-daemon served | `10221` |
| `daemon.resources.limits.cpu` | CPU resource limit of kruise-daemon container | `50m` |
| `daemon.resources.limits.memory` | Memory resource limit of kruise-daemon container | `64Mi` |
| `daemon.resources.requests.cpu` | CPU resource request of kruise-daemon container | `0` |
| `daemon.resources.requests.memory` | Memory resource request of kruise-daemon container | `0` |
| `daemon.affinity` | Affinity policy for kruise-daemon pod | `{}` |
| `webhookConfiguration.failurePolicy.pods` | The failurePolicy for pods in mutating webhook configuration | `Ignore` |
| `webhookConfiguration.timeoutSeconds` | The timeoutSeconds for all webhook configuration | `30` |
| `crds.managed` | Kruise will not install CRDs with chart if this is false | `true` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```bash
$ helm install kruise https://... --set manager.log.level=5
...
```
### Optional: feature-gate
Feature-gate controls some influential features in Kruise:
| Name | Description | Default | Side effect (if closed) |
| ---------------------- | ------------------------------------------------------------ | ------- | --------------------------------------
| `PodWebhook` | Whether to open a webhook for Pod **create** | `true` | SidecarSet disabled |
| `KruiseDaemon` | Whether to deploy `kruise-daemon` DaemonSet | `true` | Image pulling disabled |
If you want to configure the feature-gate, just set the parameter when install or upgrade:
```bash
# one
$ helm install kruise https://... --set featureGates="PodWebhook=false"
...
# or more
$ helm install kruise https://... --set featureGates="PodWebhook=false\,KruiseDaemon=false"
...
```
### Optional: the local image for China
If you are in China and have problem to pull image from official DockerHub, you can use the registry hosted on Alibaba Cloud:
```bash
$ helm install kruise https://... --set manager.image.repository=openkruise-registry.cn-hangzhou.cr.aliyuncs.com/openkruise/kruise-manager
...
```

View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "kruise.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "kruise.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "kruise.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@ -0,0 +1,222 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: advancedcronjobs.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.schedule
description: The schedule of advanced cron job.
name: Schedule
type: string
- JSONPath: .status.type
description: Type of cron job.
name: Type
type: string
- JSONPath: .status.lastScheduleTime
description: The last time at which job was scheduled.
name: LastScheduleTime
type: date
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: AdvancedCronJob
listKind: AdvancedCronJobList
plural: advancedcronjobs
shortNames:
- acj
singular: advancedcronjob
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: AdvancedCronJob is the Schema for the advancedcronjobs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: AdvancedCronJobSpec defines the desired state of AdvancedCronJob
properties:
concurrencyPolicy:
description: 'Specifies how to treat concurrent executions of a Job.
Valid values are: - "Allow" (default): allows CronJobs to run concurrently;
- "Forbid": forbids concurrent runs, skipping next run if previous
run hasn''t finished yet; - "Replace": cancels currently running job
and replaces it with a new one'
enum:
- Allow
- Forbid
- Replace
type: string
failedJobsHistoryLimit:
description: The number of failed finished jobs to retain. This is a
pointer to distinguish between explicit zero and not specified.
format: int32
minimum: 0
type: integer
paused:
description: Paused will pause the cron job.
type: boolean
schedule:
description: The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
minLength: 0
type: string
startingDeadlineSeconds:
description: Optional deadline in seconds for starting the job if it
misses scheduled time for any reason. Missed jobs executions will
be counted as failed ones.
format: int64
minimum: 0
type: integer
successfulJobsHistoryLimit:
description: The number of successful finished jobs to retain. This
is a pointer to distinguish between explicit zero and not specified.
format: int32
minimum: 0
type: integer
template:
description: Specifies the job that will be created when executing a
CronJob.
properties:
broadcastJobTemplate:
description: Specifies the broadcastjob that will be created when
executing a BroadcastCronJob.
properties:
metadata:
description: Standard object's metadata of the jobs created
from this template.
type: object
spec:
description: Specification of the desired behavior of the broadcastjob.
properties:
completionPolicy:
description: CompletionPolicy indicates the completion policy
of the job. Default is Always CompletionPolicyType
properties:
activeDeadlineSeconds:
description: ActiveDeadlineSeconds specifies the duration
in seconds relative to the startTime that the job
may be active before the system tries to terminate
it; value must be positive integer. Only works for
Always type.
format: int64
type: integer
ttlSecondsAfterFinished:
description: ttlSecondsAfterFinished limits the lifetime
of a Job that has finished execution (either Complete
or Failed). If this field is set, ttlSecondsAfterFinished
after the Job finishes, it is eligible to be automatically
deleted. When the Job is being deleted, its lifecycle
guarantees (e.g. finalizers) will be honored. If this
field is unset, the Job won't be automatically deleted.
If this field is set to zero, the Job becomes eligible
to be deleted immediately after it finishes. This
field is alpha-level and is only honored by servers
that enable the TTLAfterFinished feature. Only works
for Always type
format: int32
type: integer
type:
description: Type indicates the type of the CompletionPolicy
Default is Always
type: string
type: object
failurePolicy:
description: FailurePolicy indicates the behavior of the
job, when failed pod is found.
properties:
restartLimit:
description: RestartLimit specifies the number of retries
before marking the pod failed.
format: int32
type: integer
type:
description: Type indicates the type of FailurePolicyType.
type: string
type: object
parallelism:
anyOf:
- type: integer
- type: string
description: Parallelism specifies the maximum desired number
of pods the job should run at any given time. The actual
number of pods running in steady state will be less than
this number when the work left to do is less than max
parallelism. Not setting this value means no limit.
x-kubernetes-int-or-string: true
paused:
description: Paused will pause the job.
type: boolean
template:
description: Template describes the pod that will be created
when executing a job.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
type: object
jobTemplate:
description: Specifies the job that will be created when executing
a CronJob.
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
required:
- schedule
- template
type: object
status:
description: AdvancedCronJobStatus defines the observed state of AdvancedCronJob
properties:
active:
description: A list of pointers to currently running jobs.
items:
description: ObjectReference contains enough information to let you
inspect or modify the referred object.
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
lastScheduleTime:
description: Information when was the last time the job was successfully
scheduled.
format: date-time
type: string
type:
type: string
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,211 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: broadcastjobs.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .status.desired
description: The desired number of pods. This is typically equal to the number
of nodes satisfied to run pods.
name: Desired
type: integer
- JSONPath: .status.active
description: The number of actively running pods.
name: Active
type: integer
- JSONPath: .status.succeeded
description: The number of pods which reached phase Succeeded.
name: Succeeded
type: integer
- JSONPath: .status.failed
description: The number of pods which reached phase Failed.
name: Failed
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: BroadcastJob
listKind: BroadcastJobList
plural: broadcastjobs
shortNames:
- bcj
singular: broadcastjob
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: BroadcastJob is the Schema for the broadcastjobs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: BroadcastJobSpec defines the desired state of BroadcastJob
properties:
completionPolicy:
description: CompletionPolicy indicates the completion policy of the
job. Default is Always CompletionPolicyType
properties:
activeDeadlineSeconds:
description: ActiveDeadlineSeconds specifies the duration in seconds
relative to the startTime that the job may be active before the
system tries to terminate it; value must be positive integer.
Only works for Always type.
format: int64
type: integer
ttlSecondsAfterFinished:
description: ttlSecondsAfterFinished limits the lifetime of a Job
that has finished execution (either Complete or Failed). If this
field is set, ttlSecondsAfterFinished after the Job finishes,
it is eligible to be automatically deleted. When the Job is being
deleted, its lifecycle guarantees (e.g. finalizers) will be honored.
If this field is unset, the Job won't be automatically deleted.
If this field is set to zero, the Job becomes eligible to be deleted
immediately after it finishes. This field is alpha-level and is
only honored by servers that enable the TTLAfterFinished feature.
Only works for Always type
format: int32
type: integer
type:
description: Type indicates the type of the CompletionPolicy Default
is Always
type: string
type: object
failurePolicy:
description: FailurePolicy indicates the behavior of the job, when failed
pod is found.
properties:
restartLimit:
description: RestartLimit specifies the number of retries before
marking the pod failed.
format: int32
type: integer
type:
description: Type indicates the type of FailurePolicyType.
type: string
type: object
parallelism:
anyOf:
- type: integer
- type: string
description: Parallelism specifies the maximum desired number of pods
the job should run at any given time. The actual number of pods running
in steady state will be less than this number when the work left to
do is less than max parallelism. Not setting this value means no limit.
x-kubernetes-int-or-string: true
paused:
description: Paused will pause the job.
type: boolean
template:
description: Template describes the pod that will be created when executing
a job.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- template
type: object
status:
description: BroadcastJobStatus defines the observed state of BroadcastJob
properties:
active:
description: The number of actively running pods.
format: int32
type: integer
completionTime:
description: Represents time when the job was completed. It is not guaranteed
to be set in happens-before order across separate operations. It is
represented in RFC3339 form and is in UTC.
format: date-time
type: string
conditions:
description: The latest available observations of an object's current
state.
items:
description: JobCondition describes current state of a job.
properties:
lastProbeTime:
description: Last time the condition was checked.
format: date-time
type: string
lastTransitionTime:
description: Last time the condition transit from one status to
another.
format: date-time
type: string
message:
description: Human readable message indicating details about last
transition.
type: string
reason:
description: (brief) reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of job condition, Complete or Failed.
type: string
required:
- status
- type
type: object
type: array
desired:
description: The desired number of pods, this is typically equal to
the number of nodes satisfied to run pods.
format: int32
type: integer
failed:
description: The number of pods which reached phase Failed.
format: int32
type: integer
phase:
description: The phase of the job.
type: string
startTime:
description: Represents time when the job was acknowledged by the job
controller. It is not guaranteed to be set in happens-before order
across separate operations. It is represented in RFC3339 form and
is in UTC.
format: date-time
type: string
succeeded:
description: The number of pods which reached phase Succeeded.
format: int32
type: integer
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,465 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: clonesets.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.replicas
description: The desired number of pods.
name: DESIRED
type: integer
- JSONPath: .status.updatedReplicas
description: The number of pods updated.
name: UPDATED
type: integer
- JSONPath: .status.updatedReadyReplicas
description: The number of pods updated and ready.
name: UPDATED_READY
type: integer
- JSONPath: .status.readyReplicas
description: The number of pods ready.
name: READY
type: integer
- JSONPath: .status.replicas
description: The number of currently all pods.
name: TOTAL
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: CloneSet
listKind: CloneSetList
plural: clonesets
shortNames:
- clone
singular: cloneset
scope: Namespaced
subresources:
scale:
labelSelectorPath: .status.labelSelector
specReplicasPath: .spec.replicas
statusReplicasPath: .status.replicas
status: {}
validation:
openAPIV3Schema:
description: CloneSet is the Schema for the clonesets API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CloneSetSpec defines the desired state of CloneSet
properties:
lifecycle:
description: Lifecycle defines the lifecycle hooks for Pods pre-delete,
in-place update.
properties:
inPlaceUpdate:
description: InPlaceUpdate is the hook before Pod to update and
after Pod has been updated.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
preDelete:
description: PreDelete is the hook before Pod to be deleted.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
type: object
minReadySeconds:
description: Minimum number of seconds for which a newly created pod
should be ready without any of its container crashing, for it to be
considered available. Defaults to 0 (pod will be considered available
as soon as it is ready)
format: int32
type: integer
replicas:
description: Replicas is the desired number of replicas of the given
Template. These are replicas in the sense that they are instantiations
of the same Template. If unspecified, defaults to 1.
format: int32
type: integer
revisionHistoryLimit:
description: RevisionHistoryLimit is the maximum number of revisions
that will be maintained in the CloneSet's revision history. The revision
history consists of all revisions not represented by a currently applied
CloneSetSpec version. The default value is 10.
format: int32
type: integer
scaleStrategy:
description: ScaleStrategy indicates the ScaleStrategy that will be
employed to create and delete Pods in the CloneSet.
properties:
podsToDelete:
description: PodsToDelete is the names of Pod should be deleted.
Note that this list will be truncated for non-existing pod names.
items:
type: string
type: array
type: object
selector:
description: 'Selector is a label query over pods that should match
the replica count. It must match the pod template''s labels. More
info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors'
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
template:
description: Template describes the pods that will be created.
type: object
x-kubernetes-preserve-unknown-fields: true
updateStrategy:
description: UpdateStrategy indicates the UpdateStrategy that will be
employed to update Pods in the CloneSet when a revision is made to
Template.
properties:
inPlaceUpdateStrategy:
description: InPlaceUpdateStrategy contains strategies for in-place
update.
properties:
gracePeriodSeconds:
description: GracePeriodSeconds is the timespan between set
Pod status to not-ready and update images in Pod spec when
in-place update a Pod.
format: int32
type: integer
type: object
maxSurge:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can be scheduled above
the desired replicas during the update. Value can be an absolute
number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute
number is calculated from percentage by rounding up. Defaults
to 0.'
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can be unavailable
during the update. Value can be an absolute number (ex: 5) or
a percentage of desired pods (ex: 10%). Absolute number is calculated
from percentage by rounding up by default. When maxSurge > 0,
absolute number is calculated from percentage by rounding down.
Defaults to 20%.'
x-kubernetes-int-or-string: true
partition:
anyOf:
- type: integer
- type: string
description: 'Partition is the desired number of pods in old revisions.
Value can be an absolute number (ex: 5) or a percentage of desired
pods (ex: 10%). Absolute number is calculated from percentage
by rounding up by default. It means when partition is set during
pods updating, (replicas - partition value) number of pods will
be updated. Default value is 0.'
x-kubernetes-int-or-string: true
paused:
description: Paused indicates that the CloneSet is paused. Default
value is false
type: boolean
priorityStrategy:
description: Priorities are the rules for calculating the priority
of updating pods. Each pod to be updated, will pass through these
terms and get a sum of weights.
properties:
orderPriority:
description: 'Order priority terms, pods will be sorted by the
value of orderedKey. For example: ``` orderPriority: - orderedKey:
key1 - orderedKey: key2 ``` First, all pods which have key1
in labels will be sorted by the value of key1. Then, the left
pods which have no key1 but have key2 in labels will be sorted
by the value of key2 and put behind those pods have key1.'
items:
description: UpdatePriorityOrder defines order priority.
properties:
orderedKey:
description: Calculate priority by value of this key.
Values of this key, will be sorted by GetInt(val). GetInt
method will find the last int in value, such as getting
5 in value '5', getting 10 in value 'sts-10'.
type: string
required:
- orderedKey
type: object
type: array
weightPriority:
description: Weight priority terms, pods will be sorted by the
sum of all terms weight.
items:
description: UpdatePriorityWeightTerm defines weight priority.
properties:
matchSelector:
description: MatchSelector is used to select by pod's
labels.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values
array must be non-empty. If the operator is
Exists or DoesNotExist, the values array must
be empty. This array is replaced during a
strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
weight:
description: Weight associated with matching the corresponding
matchExpressions, in the range 1-100.
format: int32
type: integer
required:
- matchSelector
- weight
type: object
type: array
type: object
scatterStrategy:
description: ScatterStrategy defines the scatter rules to make pods
been scattered when update. This will avoid pods with the same
key-value to be updated in one batch. - Note that pods will be
scattered after priority sort. So, although priority strategy
and scatter strategy can be applied together, we suggest to use
either one of them. - If scatterStrategy is used, we suggest to
just use one term. Otherwise, the update order can be hard to
understand.
items:
properties:
key:
type: string
value:
type: string
required:
- key
- value
type: object
type: array
type:
description: Type indicates the type of the CloneSetUpdateStrategy.
Default is ReCreate.
type: string
type: object
volumeClaimTemplates:
description: VolumeClaimTemplates is a list of claims that pods are
allowed to reference. Note that PVC will be deleted when its pod has
been deleted.
items:
description: PersistentVolumeClaim is a user's request for and claim
to a persistent volume
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
required:
- selector
- template
type: object
status:
description: CloneSetStatus defines the observed state of CloneSet
properties:
availableReplicas:
description: AvailableReplicas is the number of Pods created by the
CloneSet controller that have a Ready Condition for at least minReadySeconds.
format: int32
type: integer
collisionCount:
description: CollisionCount is the count of hash collisions for the
CloneSet. The CloneSet controller uses this field as a collision avoidance
mechanism when it needs to create the name for the newest ControllerRevision.
format: int32
type: integer
conditions:
description: Conditions represents the latest available observations
of a CloneSet's current state.
items:
description: CloneSetCondition describes the state of a CloneSet at
a certain point.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of CloneSet condition.
type: string
required:
- status
- type
type: object
type: array
currentRevision:
description: currentRevision, if not empty, indicates the current revision
version of the CloneSet.
type: string
labelSelector:
description: LabelSelector is label selectors for query over pods that
should match the replica count used by HPA.
type: string
observedGeneration:
description: ObservedGeneration is the most recent generation observed
for this CloneSet. It corresponds to the CloneSet's generation, which
is updated on mutation by the API Server.
format: int64
type: integer
readyReplicas:
description: ReadyReplicas is the number of Pods created by the CloneSet
controller that have a Ready Condition.
format: int32
type: integer
replicas:
description: Replicas is the number of Pods created by the CloneSet
controller.
format: int32
type: integer
updateRevision:
description: UpdateRevision, if not empty, indicates the latest revision
of the CloneSet.
type: string
updatedReadyReplicas:
description: UpdatedReadyReplicas is the number of Pods created by the
CloneSet controller from the CloneSet version indicated by updateRevision
and have a Ready Condition.
format: int32
type: integer
updatedReplicas:
description: UpdatedReplicas is the number of Pods created by the CloneSet
controller from the CloneSet version indicated by updateRevision.
format: int32
type: integer
required:
- availableReplicas
- readyReplicas
- replicas
- updatedReadyReplicas
- updatedReplicas
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,355 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: daemonsets.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .status.desiredNumberScheduled
description: The desired number of pods.
name: DesiredNumber
type: integer
- JSONPath: .status.currentNumberScheduled
description: The current number of pods.
name: CurrentNumber
type: integer
- JSONPath: .status.updatedNumberScheduled
description: The updated number of pods.
name: UpdatedNumberScheduled
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: DaemonSet
listKind: DaemonSetList
plural: daemonsets
shortNames:
- daemon
singular: daemonset
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: DaemonSet is the Schema for the daemonsets API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: DaemonSetSpec defines the desired state of DaemonSet
properties:
burstReplicas:
anyOf:
- type: integer
- type: string
description: BurstReplicas is a rate limiter for booting pods on a lot
of pods. The default value is 250
x-kubernetes-int-or-string: true
minReadySeconds:
description: The minimum number of seconds for which a newly created
DaemonSet pod should be ready without any of its container crashing,
for it to be considered available. Defaults to 0 (pod will be considered
available as soon as it is ready).
format: int32
type: integer
revisionHistoryLimit:
description: The number of old history to retain to allow rollback.
This is a pointer to distinguish between explicit zero and not specified.
Defaults to 10.
format: int32
type: integer
selector:
description: 'A label query over pods that are managed by the daemon
set. Must match in order to be controlled. It must match the pod template''s
labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors'
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
template:
description: 'An object that describes the pod that will be created.
The DaemonSet will create exactly one copy of this pod on every node
that matches the template''s node selector (or on every node if no
node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template'
type: object
x-kubernetes-preserve-unknown-fields: true
updateStrategy:
description: An update strategy to replace existing DaemonSet pods with
new pods.
properties:
rollingUpdate:
description: Rolling update config params. Present only if type
= "RollingUpdate".
properties:
maxSurge:
anyOf:
- type: integer
- type: string
description: 'Only when type=SurgingRollingUpdateType, it works.
The maximum number of DaemonSet pods that can be scheduled
above the desired number of pods during the update. Value
can be an absolute number (ex: 5) or a percentage of the total
number of DaemonSet pods at the start of the update (ex: 10%).
The absolute number is calculated from the percentage by rounding
up. This cannot be 0. The default value is 1. Example: when
this is set to 30%, at most 30% of the total number of nodes
that should be running the daemon pod (i.e. status.desiredNumberScheduled)
can have 2 pods running at any given time. The update starts
by starting replacements for at most 30% of those DaemonSet
pods. Once the new pods are available it then stops the existing
pods before proceeding onto other DaemonSet pods, thus ensuring
that at most 130% of the desired final number of DaemonSet pods
are running at all times during the update.'
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of DaemonSet pods that can
be unavailable during the update. Value can be an absolute
number (ex: 5) or a percentage of total number of DaemonSet
pods at the start of the update (ex: 10%). Absolute number
is calculated from percentage by rounding up. This cannot
be 0. Default value is 1. Example: when this is set to 30%,
at most 30% of the total number of nodes that should be running
the daemon pod (i.e. status.desiredNumberScheduled) can have
their pods stopped for an update at any given time. The update
starts by stopping at most 30% of those DaemonSet pods and
then brings up new DaemonSet pods in their place. Once the
new pods are available, it then proceeds onto other DaemonSet
pods, thus ensuring that at least 70% of original number of
DaemonSet pods are available at all times during the update.'
x-kubernetes-int-or-string: true
partition:
description: The number of DaemonSet pods remained to be old
version. Default value is 0. Maximum value is status.DesiredNumberScheduled,
which means no pod will be updated.
format: int32
type: integer
paused:
description: Indicates that the daemon set is paused and will
not be processed by the daemon set controller.
type: boolean
rollingUpdateType:
description: Type is to specify which kind of rollingUpdate.
type: string
selector:
description: A label query over nodes that are managed by the
daemon set RollingUpdate. Must match in order to be controlled.
It must match the node's labels.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists or
DoesNotExist, the values array must be empty. This
array is replaced during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is
"key", the operator is "In", and the values array contains
only "value". The requirements are ANDed.
type: object
type: object
type: object
type:
description: Type of daemon set update. Can be "RollingUpdate" or
"OnDelete". Default is RollingUpdate.
type: string
type: object
required:
- selector
- template
type: object
status:
description: DaemonSetStatus defines the observed state of DaemonSet
properties:
collisionCount:
description: Count of hash collisions for the DaemonSet. The DaemonSet
controller uses this field as a collision avoidance mechanism when
it needs to create the name for the newest ControllerRevision.
format: int32
type: integer
conditions:
description: Represents the latest available observations of a DaemonSet's
current state.
items:
description: DaemonSetCondition describes the state of a DaemonSet
at a certain point.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of DaemonSet condition.
type: string
required:
- status
- type
type: object
type: array
currentNumberScheduled:
description: 'The number of nodes that are running at least 1 daemon
pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/'
format: int32
type: integer
daemonSetHash:
description: DaemonSetHash is the controller-revision-hash, which represents
the latest version of the DaemonSet.
type: string
desiredNumberScheduled:
description: 'The total number of nodes that should be running the daemon
pod (including nodes correctly running the daemon pod). More info:
https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/'
format: int32
type: integer
numberAvailable:
description: The number of nodes that should be running the daemon pod
and have one or more of the daemon pod running and available (ready
for at least spec.minReadySeconds)
format: int32
type: integer
numberMisscheduled:
description: 'The number of nodes that are running the daemon pod, but
are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/'
format: int32
type: integer
numberReady:
description: The number of nodes that should be running the daemon pod
and have one or more of the daemon pod running and ready.
format: int32
type: integer
numberUnavailable:
description: The number of nodes that should be running the daemon pod
and have none of the daemon pod running and available (ready for at
least spec.minReadySeconds)
format: int32
type: integer
observedGeneration:
description: The most recent generation observed by the daemon set controller.
format: int64
type: integer
updatedNumberScheduled:
description: The total number of nodes that are running updated daemon
pod
format: int32
type: integer
required:
- currentNumberScheduled
- daemonSetHash
- desiredNumberScheduled
- numberMisscheduled
- numberReady
- updatedNumberScheduled
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,242 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: imagepulljobs.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .status.desired
description: Number of all nodes matched by this job
name: TOTAL
type: integer
- JSONPath: .status.active
description: Number of image pull task active
name: ACTIVE
type: integer
- JSONPath: .status.succeeded
description: Number of image pull task succeeded
name: SUCCEED
type: integer
- JSONPath: .status.failed
description: Number of image pull tasks failed
name: FAILED
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
- JSONPath: .status.message
description: Summary of status when job is failed
name: MESSAGE
type: string
group: apps.kruise.io
names:
kind: ImagePullJob
listKind: ImagePullJobList
plural: imagepulljobs
singular: imagepulljob
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: ImagePullJob is the Schema for the imagepulljobs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ImagePullJobSpec defines the desired state of ImagePullJob
properties:
completionPolicy:
description: CompletionPolicy indicates the completion policy of the
job. Default is Always CompletionPolicyType.
properties:
activeDeadlineSeconds:
description: ActiveDeadlineSeconds specifies the duration in seconds
relative to the startTime that the job may be active before the
system tries to terminate it; value must be positive integer.
Only works for Always type.
format: int64
type: integer
ttlSecondsAfterFinished:
description: ttlSecondsAfterFinished limits the lifetime of a Job
that has finished execution (either Complete or Failed). If this
field is set, ttlSecondsAfterFinished after the Job finishes,
it is eligible to be automatically deleted. When the Job is being
deleted, its lifecycle guarantees (e.g. finalizers) will be honored.
If this field is unset, the Job won't be automatically deleted.
If this field is set to zero, the Job becomes eligible to be deleted
immediately after it finishes. This field is alpha-level and is
only honored by servers that enable the TTLAfterFinished feature.
Only works for Always type
format: int32
type: integer
type:
description: Type indicates the type of the CompletionPolicy Default
is Always
type: string
type: object
image:
description: Image is the image to be pulled by the job
type: string
parallelism:
anyOf:
- type: integer
- type: string
description: Parallelism is the requested parallelism, it can be set
to any non-negative value. If it is unspecified, it defaults to 1.
If it is specified as 0, then the Job is effectively paused until
it is increased.
x-kubernetes-int-or-string: true
pullPolicy:
description: PullPolicy is an optional field to set parameters of the
pulling task. If not specified, the system will use the default values.
properties:
backoffLimit:
description: Specifies the number of retries before marking the
pulling task failed. Defaults to 3
format: int32
type: integer
timeoutSeconds:
description: Specifies the timeout of the pulling task. Defaults
to 600
format: int32
type: integer
type: object
pullSecrets:
description: ImagePullSecrets is an optional list of references to secrets
in the same namespace to use for pulling the image. If specified,
these secrets will be passed to individual puller implementations
for them to use. For example, in the case of docker, only DockerConfig
type secrets are honored.
items:
type: string
type: array
selector:
description: Selector is a query over nodes that should match the job.
nil to match all nodes.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
names:
description: Names specify a set of nodes to execute the job.
items:
type: string
type: array
type: object
required:
- completionPolicy
- image
type: object
status:
description: ImagePullJobStatus defines the observed state of ImagePullJob
properties:
active:
description: The number of actively running pulling tasks.
format: int32
type: integer
completionTime:
description: Represents time when the job was completed. It is not guaranteed
to be set in happens-before order across separate operations. It is
represented in RFC3339 form and is in UTC.
format: date-time
type: string
desired:
description: The desired number of pulling tasks, this is typically
equal to the number of nodes satisfied.
format: int32
type: integer
failed:
description: The number of pulling tasks which reached phase Failed.
format: int32
type: integer
failedNodes:
description: The nodes that failed to pull the image.
items:
type: string
type: array
message:
description: The text prompt for job running status.
type: string
startTime:
description: Represents time when the job was acknowledged by the job
controller. It is not guaranteed to be set in happens-before order
across separate operations. It is represented in RFC3339 form and
is in UTC.
format: date-time
type: string
succeeded:
description: The number of pulling tasks which reached phase Succeeded.
format: int32
type: integer
required:
- desired
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,273 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: nodeimages.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .status.desired
description: Number of all images on this node
name: DESIRED
type: integer
- JSONPath: .status.pulling
description: Number of image pull task active
name: PULLING
type: integer
- JSONPath: .status.succeeded
description: Number of image pull task succeeded
name: SUCCEED
type: integer
- JSONPath: .status.failed
description: Number of image pull tasks failed
name: FAILED
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: NodeImage
listKind: NodeImageList
plural: nodeimages
singular: nodeimage
scope: Cluster
subresources:
status: {}
validation:
openAPIV3Schema:
description: NodeImage is the Schema for the nodeimages API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: NodeImageSpec defines the desired state of NodeImage
properties:
images:
additionalProperties:
description: ImageSpec defines the pulling spec of an image
properties:
pullSecrets:
description: PullSecrets is an optional list of references to
secrets in the same namespace to use for pulling the image.
If specified, these secrets will be passed to individual puller
implementations for them to use. For example, in the case of
docker, only DockerConfig type secrets are honored.
items:
description: ReferenceObject comprises a resource name, with
a mandatory namespace, rendered as "<namespace>/<name>".
properties:
name:
type: string
namespace:
type: string
type: object
type: array
tags:
description: Tags is a list of versions of this image
items:
description: ImageTagSpec defines the pulling spec of an image
tag
properties:
createdAt:
description: Specifies the create time of this tag
format: date-time
type: string
ownerReferences:
description: List of objects depended by this object. If
this image is managed by a controller, then an entry in
this list will point to this controller.
items:
description: ObjectReference contains enough information
to let you inspect or modify the referred object.
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
pullPolicy:
description: PullPolicy is an optional field to set parameters
of the pulling task. If not specified, the system will
use the default values.
properties:
activeDeadlineSeconds:
description: ActiveDeadlineSeconds specifies the duration
in seconds relative to the startTime that the task
may be active before the system tries to terminate
it; value must be positive integer. if not specified,
the system will never terminate it.
format: int64
type: integer
backoffLimit:
description: Specifies the number of retries before
marking the pulling task failed. Defaults to 3
format: int32
type: integer
timeoutSeconds:
description: Specifies the timeout of the pulling task.
Defaults to 600
format: int32
type: integer
ttlSecondsAfterFinished:
description: TTLSecondsAfterFinished limits the lifetime
of a pulling task that has finished execution (either
Complete or Failed). If this field is set, ttlSecondsAfterFinished
after the task finishes, it is eligible to be automatically
deleted. If this field is unset, the task won't be
automatically deleted. If this field is set to zero,
the task becomes eligible to be deleted immediately
after it finishes.
format: int32
type: integer
type: object
tag:
description: Specifies the image tag
type: string
version:
description: "An opaque value that represents the internal
version of this tag that can be used by clients to determine
when objects have changed. May be used for optimistic
concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat
these values as opaque and passed unmodified back to the
server. \n Populated by the system. Read-only. Value must
be treated as opaque by clients and ."
format: int64
type: integer
required:
- tag
type: object
type: array
required:
- tags
type: object
description: Specifies images to be pulled on this node It can not be
more than 256 for each NodeImage
type: object
type: object
status:
description: NodeImageStatus defines the observed state of NodeImage
properties:
desired:
description: The desired number of pulling tasks, this is typically
equal to the number of images in spec.
format: int32
type: integer
failed:
description: The number of pulling tasks which reached phase Failed.
format: int32
type: integer
firstSyncStatus:
description: The first of all job has finished on this node. When a
node is added to the cluster, we want to know the time when the node's
image pulling is completed, and use it to trigger the operation of
the upper system.
properties:
message:
type: string
status:
description: SyncStatusPhase defines the node status
type: string
syncAt:
format: date-time
type: string
type: object
imageStatuses:
additionalProperties:
description: ImageStatus defines the pulling status of an image
properties:
tags:
description: Represents statuses of pulling tasks on this node
items:
description: ImageTagStatus defines the pulling status of an
image tag
properties:
completionTime:
description: Represents time when the pulling task was completed.
It is not guaranteed to be set in happens-before order
across separate operations. It is represented in RFC3339
form and is in UTC.
format: date-time
type: string
imageID:
description: Represents the ID of this image.
type: string
message:
description: Represents the summary informations of this
node
type: string
phase:
description: Represents the image pulling task phase.
type: string
progress:
description: Represents the pulling progress of this tag,
which is beetween 0-100. There is no guarantee of monotonic
consistency, and it may be a rollback due to retry during
pulling.
format: int32
type: integer
startTime:
description: Represents time when the pulling task was acknowledged
by the image puller. It is not guaranteed to be set in
happens-before order across separate operations. It is
represented in RFC3339 form and is in UTC.
format: date-time
type: string
tag:
description: Represents the image tag.
type: string
version:
description: Represents the internal version of this tag
that the daemon handled.
format: int64
type: integer
required:
- phase
- tag
type: object
type: array
required:
- tags
type: object
description: all statuses of active image pulling tasks
type: object
pulling:
description: The number of pulling tasks which are not finished.
format: int32
type: integer
succeeded:
description: The number of pulling tasks which reached phase Succeeded.
format: int32
type: integer
required:
- desired
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,351 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: sidecarsets.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .status.matchedPods
description: The number of pods matched.
name: MATCHED
type: integer
- JSONPath: .status.updatedPods
description: The number of pods matched and updated.
name: UPDATED
type: integer
- JSONPath: .status.readyPods
description: The number of pods matched and ready.
name: READY
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: SidecarSet
listKind: SidecarSetList
plural: sidecarsets
singular: sidecarset
scope: Cluster
preserveUnknownFields: false
subresources:
status: {}
validation:
openAPIV3Schema:
description: SidecarSet is the Schema for the sidecarsets API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: SidecarSetSpec defines the desired state of SidecarSet
properties:
containers:
description: Containers is the list of sidecar containers to be injected
into the selected pod
items:
description: SidecarContainer defines the container of Sidecar
properties:
podInjectPolicy:
description: The rules that injected SidecarContainer into Pod.spec.containers,
not takes effect in initContainers If BeforeAppContainer, the
SidecarContainer will be injected in front of the pod.spec.containers
otherwise it will be injected into the back. default BeforeAppContainerType
type: string
shareVolumePolicy:
description: If ShareVolumePolicy is enabled, the sidecar container
will share the other container's VolumeMounts in the pod(don't
contains the injected sidecar container).
properties:
type:
type: string
type: object
transferEnv:
description: TransferEnv will transfer env info from other container
SourceContainerName is pod.spec.container[x].name; EnvName is
pod.spec.container[x].Env.name
items:
properties:
envName:
type: string
sourceContainerName:
type: string
type: object
type: array
upgradeStrategy:
description: 'sidecarContainer upgrade strategy, include: ColdUpgrade,
HotUpgrade'
properties:
upgradeType:
type: string
type: object
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
initContainers:
description: Containers is the list of init containers to be injected
into the selected pod We will inject those containers by their name
in ascending order We only inject init containers when a new pod is
created, it does not apply to any existing pod
items:
description: SidecarContainer defines the container of Sidecar
properties:
podInjectPolicy:
description: The rules that injected SidecarContainer into Pod.spec.containers,
not takes effect in initContainers If BeforeAppContainer, the
SidecarContainer will be injected in front of the pod.spec.containers
otherwise it will be injected into the back. default BeforeAppContainerType
type: string
shareVolumePolicy:
description: If ShareVolumePolicy is enabled, the sidecar container
will share the other container's VolumeMounts in the pod(don't
contains the injected sidecar container).
properties:
type:
type: string
type: object
transferEnv:
description: TransferEnv will transfer env info from other container
SourceContainerName is pod.spec.container[x].name; EnvName is
pod.spec.container[x].Env.name
items:
properties:
envName:
type: string
sourceContainerName:
type: string
type: object
type: array
upgradeStrategy:
description: 'sidecarContainer upgrade strategy, include: ColdUpgrade,
HotUpgrade'
properties:
upgradeType:
type: string
type: object
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
namespace:
description: Namespace sidecarSet will only match the pods in the namespace
otherwise, match pods in all namespaces(in cluster)
type: string
selector:
description: selector is a label query over pods that should be injected
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
updateStrategy:
description: The sidecarset strategy to use to replace existing pods
with new ones.
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of SidecarSet pods that can be
unavailable during the update. Value can be an absolute number
(ex: 5) or a percentage of total number of SidecarSet pods at
the start of the update (ex: 10%). Absolute number is calculated
from percentage by rounding up. This cannot be 0. Default value
is 1.'
x-kubernetes-int-or-string: true
partition:
anyOf:
- type: integer
- type: string
description: Partition is the desired number of pods in old revisions.
It means when partition is set during pods updating, (replicas
- partition) number of pods will be updated. Default value is
0.
x-kubernetes-int-or-string: true
paused:
description: Paused indicates that the SidecarSet is paused to update
the injected pods, but it don't affect the webhook inject sidecar
container into the newly created pods. default is false
type: boolean
scatterStrategy:
description: ScatterStrategy defines the scatter rules to make pods
been scattered when update. This will avoid pods with the same
key-value to be updated in one batch. - Note that pods will be
scattered after priority sort. So, although priority strategy
and scatter strategy can be applied together, we suggest to use
either one of them. - If scatterStrategy is used, we suggest to
just use one term. Otherwise, the update order can be hard to
understand.
items:
properties:
key:
type: string
value:
type: string
required:
- key
- value
type: object
type: array
selector:
description: If selector is not nil, this upgrade will only update
the selected pods.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the
key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a
strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
type:
description: Type is NotUpdate, the SidecarSet don't update the
injected pods, it will only inject sidecar container into the
newly created pods. Type is RollingUpdate, the SidecarSet will
update the injected pods to the latest version on RollingUpdate
Strategy. default is RollingUpdate
type: string
type: object
volumes:
description: List of volumes that can be mounted by sidecar containers
items:
description: Volume represents a named volume in a pod that may be
accessed by any container in the pod.
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
type: object
status:
description: SidecarSetStatus defines the observed state of SidecarSet
properties:
matchedPods:
description: matchedPods is the number of Pods whose labels are matched
with this SidecarSet's selector and are created after sidecarset creates
format: int32
type: integer
observedGeneration:
description: observedGeneration is the most recent generation observed
for this SidecarSet. It corresponds to the SidecarSet's generation,
which is updated on mutation by the API Server.
format: int64
type: integer
readyPods:
description: readyPods is the number of matched Pods that have a ready
condition
format: int32
type: integer
updatedPods:
description: updatedPods is the number of matched Pods that are injected
with the latest SidecarSet's containers
format: int32
type: integer
updatedReadyPods:
description: updatedReadyPods is the number of matched pods that updated
and ready
format: int32
type: integer
required:
- matchedPods
- readyPods
- updatedPods
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,852 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: statefulsets.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.replicas
description: The desired number of pods.
name: DESIRED
type: integer
- JSONPath: .status.replicas
description: The number of currently all pods.
name: CURRENT
type: integer
- JSONPath: .status.updatedReplicas
description: The number of pods updated.
name: UPDATED
type: integer
- JSONPath: .status.readyReplicas
description: The number of pods ready.
name: READY
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: StatefulSet
listKind: StatefulSetList
plural: statefulsets
shortNames:
- sts
- asts
singular: statefulset
scope: Namespaced
conversion:
strategy: Webhook
webhookClientConfig:
caBundle: Cg==
service:
namespace: system
name: webhook-service
path: /convert
preserveUnknownFields: false
subresources:
scale:
labelSelectorPath: .status.labelSelector
specReplicasPath: .spec.replicas
statusReplicasPath: .status.replicas
status: {}
version: v1alpha1
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: StatefulSet is the Schema for the statefulsets API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: StatefulSetSpec defines the desired state of StatefulSet
properties:
podManagementPolicy:
description: podManagementPolicy controls how pods are created during
initial scale up, when replacing pods on nodes, or when scaling
down. The default policy is `OrderedReady`, where pods are created
in increasing order (pod-0, then pod-1, etc) and the controller
will wait until each pod is ready before continuing. When scaling
down, the pods are removed in the opposite order. The alternative
policy is `Parallel` which will create pods in parallel to match
the desired scale without waiting, and on scale down will delete
all pods at once.
type: string
replicas:
description: 'replicas is the desired number of replicas of the given
Template. These are replicas in the sense that they are instantiations
of the same Template, but individual replicas also have a consistent
identity. If unspecified, defaults to 1. TODO: Consider a rename
of this field.'
format: int32
type: integer
revisionHistoryLimit:
description: revisionHistoryLimit is the maximum number of revisions
that will be maintained in the StatefulSet's revision history. The
revision history consists of all revisions not represented by a
currently applied StatefulSetSpec version. The default value is
10.
format: int32
type: integer
selector:
description: 'selector is a label query over pods that should match
the replica count. It must match the pod template''s labels. More
info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors'
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
serviceName:
description: 'serviceName is the name of the service that governs
this StatefulSet. This service must exist before the StatefulSet,
and is responsible for the network identity of the set. Pods get
DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local
where "pod-specific-string" is managed by the StatefulSet controller.'
type: string
template:
description: template is the object that describes the pod that will
be created if insufficient replicas are detected. Each pod stamped
out by the StatefulSet will fulfill this Template, but have a unique
identity from the rest of the StatefulSet.
type: object
x-kubernetes-preserve-unknown-fields: true
updateStrategy:
description: updateStrategy indicates the StatefulSetUpdateStrategy
that will be employed to update Pods in the StatefulSet when a revision
is made to Template.
properties:
rollingUpdate:
description: RollingUpdate is used to communicate parameters when
Type is RollingUpdateStatefulSetStrategyType.
properties:
inPlaceUpdateStrategy:
description: InPlaceUpdateStrategy contains strategies for
in-place update.
properties:
gracePeriodSeconds:
description: GracePeriodSeconds is the timespan between
set Pod status to not-ready and update images in Pod
spec when in-place update a Pod.
format: int32
type: integer
type: object
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can be unavailable
during the update. Value can be an absolute number (ex:
5) or a percentage of desired pods (ex: 10%). Absolute number
is calculated from percentage by rounding down. Also, maxUnavailable
can just be allowed to work with Parallel podManagementPolicy.
Defaults to 1.'
x-kubernetes-int-or-string: true
minReadySeconds:
description: MinReadySeconds indicates how long will the pod
be considered ready after it's updated. MinReadySeconds
works with both OrderedReady and Parallel podManagementPolicy.
It affects the pod scale up speed when the podManagementPolicy
is set to be OrderedReady. Combined with MaxUnavailable,
it affects the pod update speed regardless of podManagementPolicy.
Default value is 0, max is 300.
format: int32
type: integer
partition:
description: 'Partition indicates the ordinal at which the
StatefulSet should be partitioned by default. But if unorderedUpdate
has been set: - Partition indicates the number of pods
with non-updated revisions when rolling update. - It means
controller will update $(replicas - partition) number of
pod. Default value is 0.'
format: int32
type: integer
paused:
description: Paused indicates that the StatefulSet is paused.
Default value is false
type: boolean
podUpdatePolicy:
description: PodUpdatePolicy indicates how pods should be
updated Default value is "ReCreate"
type: string
unorderedUpdate:
description: UnorderedUpdate contains strategies for non-ordered
update. If it is not nil, pods will be updated with non-ordered
sequence. Noted that UnorderedUpdate can only be allowed
to work with Parallel podManagementPolicy
properties:
priorityStrategy:
description: Priorities are the rules for calculating
the priority of updating pods. Each pod to be updated,
will pass through these terms and get a sum of weights.
properties:
orderPriority:
description: 'Order priority terms, pods will be sorted
by the value of orderedKey. For example: ``` orderPriority:
- orderedKey: key1 - orderedKey: key2 ``` First,
all pods which have key1 in labels will be sorted
by the value of key1. Then, the left pods which
have no key1 but have key2 in labels will be sorted
by the value of key2 and put behind those pods have
key1.'
items:
description: UpdatePriorityOrder defines order priority.
properties:
orderedKey:
description: Calculate priority by value of
this key. Values of this key, will be sorted
by GetInt(val). GetInt method will find the
last int in value, such as getting 5 in value
'5', getting 10 in value 'sts-10'.
type: string
required:
- orderedKey
type: object
type: array
weightPriority:
description: Weight priority terms, pods will be sorted
by the sum of all terms weight.
items:
description: UpdatePriorityWeightTerm defines weight
priority.
properties:
matchSelector:
description: MatchSelector is used to select
by pod's labels.
properties:
matchExpressions:
description: matchExpressions is a list
of label selector requirements. The requirements
are ANDed.
items:
description: A label selector requirement
is a selector that contains values,
a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key
that the selector applies to.
type: string
operator:
description: operator represents a
key's relationship to a set of values.
Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of
string values. If the operator is
In or NotIn, the values array must
be non-empty. If the operator is
Exists or DoesNotExist, the values
array must be empty. This array
is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value}
pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions,
whose key field is "key", the operator
is "In", and the values array contains
only "value". The requirements are ANDed.
type: object
type: object
weight:
description: Weight associated with matching
the corresponding matchExpressions, in the
range 1-100.
format: int32
type: integer
required:
- matchSelector
- weight
type: object
type: array
type: object
type: object
type: object
type:
description: Type indicates the type of the StatefulSetUpdateStrategy.
Default is RollingUpdate.
type: string
type: object
volumeClaimTemplates:
description: 'volumeClaimTemplates is a list of claims that pods are
allowed to reference. The StatefulSet controller is responsible
for mapping network identities to claims in a way that maintains
the identity of a pod. Every claim in this list must have at least
one matching (by name) volumeMount in one container in the template.
A claim in this list takes precedence over any volumes in the template,
with the same name. TODO: Define the behavior if a claim already
exists with the same name.'
items:
description: PersistentVolumeClaim is a user's request for and claim
to a persistent volume
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
required:
- selector
- template
type: object
status:
description: StatefulSetStatus defines the observed state of StatefulSet
properties:
availableReplicas:
description: AvailableReplicas is the number of Pods created by the
StatefulSet controller that have been ready for minReadySeconds.
format: int32
type: integer
collisionCount:
description: collisionCount is the count of hash collisions for the
StatefulSet. The StatefulSet controller uses this field as a collision
avoidance mechanism when it needs to create the name for the newest
ControllerRevision.
format: int32
type: integer
conditions:
description: Represents the latest available observations of a statefulset's
current state.
items:
description: StatefulSetCondition describes the state of a statefulset
at a certain point.
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
currentReplicas:
description: currentReplicas is the number of Pods created by the
StatefulSet controller from the StatefulSet version indicated by
currentRevision.
format: int32
type: integer
currentRevision:
description: currentRevision, if not empty, indicates the version
of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).
type: string
labelSelector:
description: LabelSelector is label selectors for query over pods
that should match the replica count used by HPA.
type: string
observedGeneration:
description: observedGeneration is the most recent generation observed
for this StatefulSet. It corresponds to the StatefulSet's generation,
which is updated on mutation by the API Server.
format: int64
type: integer
readyReplicas:
description: readyReplicas is the number of Pods created by the StatefulSet
controller that have a Ready Condition.
format: int32
type: integer
replicas:
description: replicas is the number of Pods created by the StatefulSet
controller.
format: int32
type: integer
updateRevision:
description: updateRevision, if not empty, indicates the version of
the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)
type: string
updatedReplicas:
description: updatedReplicas is the number of Pods created by the
StatefulSet controller from the StatefulSet version indicated by
updateRevision.
format: int32
type: integer
required:
- availableReplicas
- currentReplicas
- readyReplicas
- replicas
- updatedReplicas
type: object
type: object
served: true
storage: false
- name: v1beta1
schema:
openAPIV3Schema:
description: StatefulSet is the Schema for the statefulsets API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: StatefulSetSpec defines the desired state of StatefulSet
properties:
lifecycle:
description: Lifecycle defines the lifecycle hooks for Pods pre-delete,
in-place update.
properties:
inPlaceUpdate:
description: InPlaceUpdate is the hook before Pod to update and
after Pod has been updated.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
preDelete:
description: PreDelete is the hook before Pod to be deleted.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
type: object
podManagementPolicy:
description: podManagementPolicy controls how pods are created during
initial scale up, when replacing pods on nodes, or when scaling
down. The default policy is `OrderedReady`, where pods are created
in increasing order (pod-0, then pod-1, etc) and the controller
will wait until each pod is ready before continuing. When scaling
down, the pods are removed in the opposite order. The alternative
policy is `Parallel` which will create pods in parallel to match
the desired scale without waiting, and on scale down will delete
all pods at once.
type: string
replicas:
description: 'replicas is the desired number of replicas of the given
Template. These are replicas in the sense that they are instantiations
of the same Template, but individual replicas also have a consistent
identity. If unspecified, defaults to 1. TODO: Consider a rename
of this field.'
format: int32
type: integer
reserveOrdinals:
description: 'reserveOrdinals controls the ordinal numbers that should
be reserved, and the replicas will always be the expectation number
of running Pods. For a sts with replicas=3 and its Pods in [0, 1,
2]: - If you want to migrate Pod-1 and reserve this ordinal, just
set spec.reserveOrdinal to [1]. Then controller will delete Pod-1
and create Pod-3 (existing Pods will be [0, 2, 3]) - If you just
want to delete Pod-1, you should set spec.reserveOrdinal to [1]
and spec.replicas to 2. Then controller will delete Pod-1 (existing
Pods will be [0, 2])'
items:
type: integer
type: array
revisionHistoryLimit:
description: revisionHistoryLimit is the maximum number of revisions
that will be maintained in the StatefulSet's revision history. The
revision history consists of all revisions not represented by a
currently applied StatefulSetSpec version. The default value is
10.
format: int32
type: integer
selector:
description: 'selector is a label query over pods that should match
the replica count. It must match the pod template''s labels. More
info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors'
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
serviceName:
description: 'serviceName is the name of the service that governs
this StatefulSet. This service must exist before the StatefulSet,
and is responsible for the network identity of the set. Pods get
DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local
where "pod-specific-string" is managed by the StatefulSet controller.'
type: string
template:
description: template is the object that describes the pod that will
be created if insufficient replicas are detected. Each pod stamped
out by the StatefulSet will fulfill this Template, but have a unique
identity from the rest of the StatefulSet.
type: object
x-kubernetes-preserve-unknown-fields: true
updateStrategy:
description: updateStrategy indicates the StatefulSetUpdateStrategy
that will be employed to update Pods in the StatefulSet when a revision
is made to Template.
properties:
rollingUpdate:
description: RollingUpdate is used to communicate parameters when
Type is RollingUpdateStatefulSetStrategyType.
properties:
inPlaceUpdateStrategy:
description: InPlaceUpdateStrategy contains strategies for
in-place update.
properties:
gracePeriodSeconds:
description: GracePeriodSeconds is the timespan between
set Pod status to not-ready and update images in Pod
spec when in-place update a Pod.
format: int32
type: integer
type: object
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can be unavailable
during the update. Value can be an absolute number (ex:
5) or a percentage of desired pods (ex: 10%). Absolute number
is calculated from percentage by rounding down. Also, maxUnavailable
can just be allowed to work with Parallel podManagementPolicy.
Defaults to 1.'
x-kubernetes-int-or-string: true
minReadySeconds:
description: MinReadySeconds indicates how long will the pod
be considered ready after it's updated. MinReadySeconds
works with both OrderedReady and Parallel podManagementPolicy.
It affects the pod scale up speed when the podManagementPolicy
is set to be OrderedReady. Combined with MaxUnavailable,
it affects the pod update speed regardless of podManagementPolicy.
Default value is 0, max is 300.
format: int32
type: integer
partition:
description: 'Partition indicates the ordinal at which the
StatefulSet should be partitioned by default. But if unorderedUpdate
has been set: - Partition indicates the number of pods
with non-updated revisions when rolling update. - It means
controller will update $(replicas - partition) number of
pod. Default value is 0.'
format: int32
type: integer
paused:
description: Paused indicates that the StatefulSet is paused.
Default value is false
type: boolean
podUpdatePolicy:
description: PodUpdatePolicy indicates how pods should be
updated Default value is "ReCreate"
type: string
unorderedUpdate:
description: UnorderedUpdate contains strategies for non-ordered
update. If it is not nil, pods will be updated with non-ordered
sequence. Noted that UnorderedUpdate can only be allowed
to work with Parallel podManagementPolicy
properties:
priorityStrategy:
description: Priorities are the rules for calculating
the priority of updating pods. Each pod to be updated,
will pass through these terms and get a sum of weights.
properties:
orderPriority:
description: 'Order priority terms, pods will be sorted
by the value of orderedKey. For example: ``` orderPriority:
- orderedKey: key1 - orderedKey: key2 ``` First,
all pods which have key1 in labels will be sorted
by the value of key1. Then, the left pods which
have no key1 but have key2 in labels will be sorted
by the value of key2 and put behind those pods have
key1.'
items:
description: UpdatePriorityOrder defines order priority.
properties:
orderedKey:
description: Calculate priority by value of
this key. Values of this key, will be sorted
by GetInt(val). GetInt method will find the
last int in value, such as getting 5 in value
'5', getting 10 in value 'sts-10'.
type: string
required:
- orderedKey
type: object
type: array
weightPriority:
description: Weight priority terms, pods will be sorted
by the sum of all terms weight.
items:
description: UpdatePriorityWeightTerm defines weight
priority.
properties:
matchSelector:
description: MatchSelector is used to select
by pod's labels.
properties:
matchExpressions:
description: matchExpressions is a list
of label selector requirements. The requirements
are ANDed.
items:
description: A label selector requirement
is a selector that contains values,
a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key
that the selector applies to.
type: string
operator:
description: operator represents a
key's relationship to a set of values.
Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string
values:
description: values is an array of
string values. If the operator is
In or NotIn, the values array must
be non-empty. If the operator is
Exists or DoesNotExist, the values
array must be empty. This array
is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value}
pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions,
whose key field is "key", the operator
is "In", and the values array contains
only "value". The requirements are ANDed.
type: object
type: object
weight:
description: Weight associated with matching
the corresponding matchExpressions, in the
range 1-100.
format: int32
type: integer
required:
- matchSelector
- weight
type: object
type: array
type: object
type: object
type: object
type:
description: Type indicates the type of the StatefulSetUpdateStrategy.
Default is RollingUpdate.
type: string
type: object
volumeClaimTemplates:
description: 'volumeClaimTemplates is a list of claims that pods are
allowed to reference. The StatefulSet controller is responsible
for mapping network identities to claims in a way that maintains
the identity of a pod. Every claim in this list must have at least
one matching (by name) volumeMount in one container in the template.
A claim in this list takes precedence over any volumes in the template,
with the same name. TODO: Define the behavior if a claim already
exists with the same name.'
items:
description: PersistentVolumeClaim is a user's request for and claim
to a persistent volume
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
required:
- selector
- template
type: object
status:
description: StatefulSetStatus defines the observed state of StatefulSet
properties:
availableReplicas:
description: AvailableReplicas is the number of Pods created by the
StatefulSet controller that have been ready for minReadySeconds.
format: int32
type: integer
collisionCount:
description: collisionCount is the count of hash collisions for the
StatefulSet. The StatefulSet controller uses this field as a collision
avoidance mechanism when it needs to create the name for the newest
ControllerRevision.
format: int32
type: integer
conditions:
description: Represents the latest available observations of a statefulset's
current state.
items:
description: StatefulSetCondition describes the state of a statefulset
at a certain point.
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
currentReplicas:
description: currentReplicas is the number of Pods created by the
StatefulSet controller from the StatefulSet version indicated by
currentRevision.
format: int32
type: integer
currentRevision:
description: currentRevision, if not empty, indicates the version
of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).
type: string
labelSelector:
description: LabelSelector is label selectors for query over pods
that should match the replica count used by HPA.
type: string
observedGeneration:
description: observedGeneration is the most recent generation observed
for this StatefulSet. It corresponds to the StatefulSet's generation,
which is updated on mutation by the API Server.
format: int64
type: integer
readyReplicas:
description: readyReplicas is the number of Pods created by the StatefulSet
controller that have a Ready Condition.
format: int32
type: integer
replicas:
description: replicas is the number of Pods created by the StatefulSet
controller.
format: int32
type: integer
updateRevision:
description: updateRevision, if not empty, indicates the version of
the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)
type: string
updatedReplicas:
description: updatedReplicas is the number of Pods created by the
StatefulSet controller from the StatefulSet version indicated by
updateRevision.
format: int32
type: integer
required:
- availableReplicas
- currentReplicas
- readyReplicas
- replicas
- updatedReplicas
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,969 @@
{{- if .Values.crds.managed }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
name: uniteddeployments.apps.kruise.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.replicas
description: The desired number of pods.
name: DESIRED
type: integer
- JSONPath: .status.replicas
description: The number of currently all pods.
name: CURRENT
type: integer
- JSONPath: .status.updatedReplicas
description: The number of pods updated.
name: UPDATED
type: integer
- JSONPath: .status.readyReplicas
description: The number of pods ready.
name: READY
type: integer
- JSONPath: .metadata.creationTimestamp
description: CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC.
name: AGE
type: date
group: apps.kruise.io
names:
kind: UnitedDeployment
listKind: UnitedDeploymentList
plural: uniteddeployments
shortNames:
- ud
singular: uniteddeployment
scope: Namespaced
subresources:
scale:
labelSelectorPath: .status.selector
specReplicasPath: .spec.replicas
statusReplicasPath: .status.replicas
status: {}
validation:
openAPIV3Schema:
description: UnitedDeployment is the Schema for the uniteddeployments API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: UnitedDeploymentSpec defines the desired state of UnitedDeployment.
properties:
replicas:
description: Replicas is the total desired replicas of all the subsets.
If unspecified, defaults to 1.
format: int32
type: integer
revisionHistoryLimit:
description: Indicates the number of histories to be conserved. If unspecified,
defaults to 10.
format: int32
type: integer
selector:
description: Selector is a label query over pods that should match the
replica count. It must match the pod template's labels.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
type: object
template:
description: Template describes the subset that will be created.
properties:
advancedStatefulSetTemplate:
description: AdvancedStatefulSet template
properties:
metadata:
type: object
x-kubernetes-preserve-unknown-fields: true
spec:
description: StatefulSetSpec defines the desired state of StatefulSet
properties:
podManagementPolicy:
description: podManagementPolicy controls how pods are created
during initial scale up, when replacing pods on nodes,
or when scaling down. The default policy is `OrderedReady`,
where pods are created in increasing order (pod-0, then
pod-1, etc) and the controller will wait until each pod
is ready before continuing. When scaling down, the pods
are removed in the opposite order. The alternative policy
is `Parallel` which will create pods in parallel to match
the desired scale without waiting, and on scale down will
delete all pods at once.
type: string
replicas:
description: 'replicas is the desired number of replicas
of the given Template. These are replicas in the sense
that they are instantiations of the same Template, but
individual replicas also have a consistent identity. If
unspecified, defaults to 1. TODO: Consider a rename of
this field.'
format: int32
type: integer
revisionHistoryLimit:
description: revisionHistoryLimit is the maximum number
of revisions that will be maintained in the StatefulSet's
revision history. The revision history consists of all
revisions not represented by a currently applied StatefulSetSpec
version. The default value is 10.
format: int32
type: integer
selector:
description: 'selector is a label query over pods that should
match the replica count. It must match the pod template''s
labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors'
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
serviceName:
description: 'serviceName is the name of the service that
governs this StatefulSet. This service must exist before
the StatefulSet, and is responsible for the network identity
of the set. Pods get DNS/hostnames that follow the pattern:
pod-specific-string.serviceName.default.svc.cluster.local
where "pod-specific-string" is managed by the StatefulSet
controller.'
type: string
template:
description: template is the object that describes the pod
that will be created if insufficient replicas are detected.
Each pod stamped out by the StatefulSet will fulfill this
Template, but have a unique identity from the rest of
the StatefulSet.
type: object
x-kubernetes-preserve-unknown-fields: true
updateStrategy:
description: updateStrategy indicates the StatefulSetUpdateStrategy
that will be employed to update Pods in the StatefulSet
when a revision is made to Template.
properties:
rollingUpdate:
description: RollingUpdate is used to communicate parameters
when Type is RollingUpdateStatefulSetStrategyType.
properties:
inPlaceUpdateStrategy:
description: InPlaceUpdateStrategy contains strategies
for in-place update.
properties:
gracePeriodSeconds:
description: GracePeriodSeconds is the timespan
between set Pod status to not-ready and update
images in Pod spec when in-place update a
Pod.
format: int32
type: integer
type: object
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can
be unavailable during the update. Value can be
an absolute number (ex: 5) or a percentage of
desired pods (ex: 10%). Absolute number is calculated
from percentage by rounding down. Also, maxUnavailable
can just be allowed to work with Parallel podManagementPolicy.
Defaults to 1.'
x-kubernetes-int-or-string: true
minReadySeconds:
description: MinReadySeconds indicates how long
will the pod be considered ready after it's updated.
MinReadySeconds works with both OrderedReady and
Parallel podManagementPolicy. It affects the pod
scale up speed when the podManagementPolicy is
set to be OrderedReady. Combined with MaxUnavailable,
it affects the pod update speed regardless of
podManagementPolicy. Default value is 0, max is
300.
format: int32
type: integer
partition:
description: 'Partition indicates the ordinal at
which the StatefulSet should be partitioned by
default. But if unorderedUpdate has been set: -
Partition indicates the number of pods with non-updated
revisions when rolling update. - It means controller
will update $(replicas - partition) number of
pod. Default value is 0.'
format: int32
type: integer
paused:
description: Paused indicates that the StatefulSet
is paused. Default value is false
type: boolean
podUpdatePolicy:
description: PodUpdatePolicy indicates how pods
should be updated Default value is "ReCreate"
type: string
unorderedUpdate:
description: UnorderedUpdate contains strategies
for non-ordered update. If it is not nil, pods
will be updated with non-ordered sequence. Noted
that UnorderedUpdate can only be allowed to work
with Parallel podManagementPolicy
properties:
priorityStrategy:
description: Priorities are the rules for calculating
the priority of updating pods. Each pod to
be updated, will pass through these terms
and get a sum of weights.
properties:
orderPriority:
description: 'Order priority terms, pods
will be sorted by the value of orderedKey.
For example: ``` orderPriority: - orderedKey:
key1 - orderedKey: key2 ``` First, all
pods which have key1 in labels will be
sorted by the value of key1. Then, the
left pods which have no key1 but have
key2 in labels will be sorted by the value
of key2 and put behind those pods have
key1.'
items:
description: UpdatePriorityOrder defines
order priority.
properties:
orderedKey:
description: Calculate priority by
value of this key. Values of this
key, will be sorted by GetInt(val).
GetInt method will find the last
int in value, such as getting 5
in value '5', getting 10 in value
'sts-10'.
type: string
required:
- orderedKey
type: object
type: array
weightPriority:
description: Weight priority terms, pods
will be sorted by the sum of all terms
weight.
items:
description: UpdatePriorityWeightTerm
defines weight priority.
properties:
matchSelector:
description: MatchSelector is used
to select by pod's labels.
properties:
matchExpressions:
description: matchExpressions
is a list of label selector
requirements. The requirements
are ANDed.
items:
description: A label selector
requirement is a selector
that contains values, a key,
and an operator that relates
the key and values.
properties:
key:
description: key is the
label key that the selector
applies to.
type: string
operator:
description: operator represents
a key's relationship to
a set of values. Valid
operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an
array of string values.
If the operator is In
or NotIn, the values array
must be non-empty. If
the operator is Exists
or DoesNotExist, the values
array must be empty. This
array is replaced during
a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a
map of {key,value} pairs. A
single {key,value} in the matchLabels
map is equivalent to an element
of matchExpressions, whose key
field is "key", the operator
is "In", and the values array
contains only "value". The requirements
are ANDed.
type: object
type: object
weight:
description: Weight associated with
matching the corresponding matchExpressions,
in the range 1-100.
format: int32
type: integer
required:
- matchSelector
- weight
type: object
type: array
type: object
type: object
type: object
type:
description: Type indicates the type of the StatefulSetUpdateStrategy.
Default is RollingUpdate.
type: string
type: object
volumeClaimTemplates:
description: 'volumeClaimTemplates is a list of claims that
pods are allowed to reference. The StatefulSet controller
is responsible for mapping network identities to claims
in a way that maintains the identity of a pod. Every claim
in this list must have at least one matching (by name)
volumeMount in one container in the template. A claim
in this list takes precedence over any volumes in the
template, with the same name. TODO: Define the behavior
if a claim already exists with the same name.'
items:
description: PersistentVolumeClaim is a user's request
for and claim to a persistent volume
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
required:
- selector
- template
type: object
required:
- spec
type: object
cloneSetTemplate:
description: CloneSet template
properties:
metadata:
type: object
x-kubernetes-preserve-unknown-fields: true
spec:
description: CloneSetSpec defines the desired state of CloneSet
properties:
lifecycle:
description: Lifecycle defines the lifecycle hooks for Pods
pre-delete, in-place update.
properties:
inPlaceUpdate:
description: InPlaceUpdate is the hook before Pod to
update and after Pod has been updated.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
preDelete:
description: PreDelete is the hook before Pod to be
deleted.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
type: object
minReadySeconds:
description: Minimum number of seconds for which a newly
created pod should be ready without any of its container
crashing, for it to be considered available. Defaults
to 0 (pod will be considered available as soon as it is
ready)
format: int32
type: integer
replicas:
description: Replicas is the desired number of replicas
of the given Template. These are replicas in the sense
that they are instantiations of the same Template. If
unspecified, defaults to 1.
format: int32
type: integer
revisionHistoryLimit:
description: RevisionHistoryLimit is the maximum number
of revisions that will be maintained in the CloneSet's
revision history. The revision history consists of all
revisions not represented by a currently applied CloneSetSpec
version. The default value is 10.
format: int32
type: integer
scaleStrategy:
description: ScaleStrategy indicates the ScaleStrategy that
will be employed to create and delete Pods in the CloneSet.
properties:
podsToDelete:
description: PodsToDelete is the names of Pod should
be deleted. Note that this list will be truncated
for non-existing pod names.
items:
type: string
type: array
type: object
selector:
description: 'Selector is a label query over pods that should
match the replica count. It must match the pod template''s
labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors'
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
template:
description: Template describes the pods that will be created.
type: object
x-kubernetes-preserve-unknown-fields: true
updateStrategy:
description: UpdateStrategy indicates the UpdateStrategy
that will be employed to update Pods in the CloneSet when
a revision is made to Template.
properties:
inPlaceUpdateStrategy:
description: InPlaceUpdateStrategy contains strategies
for in-place update.
properties:
gracePeriodSeconds:
description: GracePeriodSeconds is the timespan
between set Pod status to not-ready and update
images in Pod spec when in-place update a Pod.
format: int32
type: integer
type: object
maxSurge:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can be
scheduled above the desired replicas during the update.
Value can be an absolute number (ex: 5) or a percentage
of desired pods (ex: 10%). Absolute number is calculated
from percentage by rounding up. Defaults to 0.'
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can be
unavailable during the update. Value can be an absolute
number (ex: 5) or a percentage of desired pods (ex:
10%). Absolute number is calculated from percentage
by rounding up by default. When maxSurge > 0, absolute
number is calculated from percentage by rounding down.
Defaults to 20%.'
x-kubernetes-int-or-string: true
partition:
anyOf:
- type: integer
- type: string
description: 'Partition is the desired number of pods
in old revisions. Value can be an absolute number
(ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding
up by default. It means when partition is set during
pods updating, (replicas - partition value) number
of pods will be updated. Default value is 0.'
x-kubernetes-int-or-string: true
paused:
description: Paused indicates that the CloneSet is paused.
Default value is false
type: boolean
priorityStrategy:
description: Priorities are the rules for calculating
the priority of updating pods. Each pod to be updated,
will pass through these terms and get a sum of weights.
properties:
orderPriority:
description: 'Order priority terms, pods will be
sorted by the value of orderedKey. For example:
``` orderPriority: - orderedKey: key1 - orderedKey:
key2 ``` First, all pods which have key1 in labels
will be sorted by the value of key1. Then, the
left pods which have no key1 but have key2 in
labels will be sorted by the value of key2 and
put behind those pods have key1.'
items:
description: UpdatePriorityOrder defines order
priority.
properties:
orderedKey:
description: Calculate priority by value of
this key. Values of this key, will be sorted
by GetInt(val). GetInt method will find
the last int in value, such as getting 5
in value '5', getting 10 in value 'sts-10'.
type: string
required:
- orderedKey
type: object
type: array
weightPriority:
description: Weight priority terms, pods will be
sorted by the sum of all terms weight.
items:
description: UpdatePriorityWeightTerm defines
weight priority.
properties:
matchSelector:
description: MatchSelector is used to select
by pod's labels.
properties:
matchExpressions:
description: matchExpressions is a list
of label selector requirements. The
requirements are ANDed.
items:
description: A label selector requirement
is a selector that contains values,
a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key
that the selector applies to.
type: string
operator:
description: operator represents
a key's relationship to a set
of values. Valid operators are
In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array
of string values. If the operator
is In or NotIn, the values array
must be non-empty. If the operator
is Exists or DoesNotExist, the
values array must be empty. This
array is replaced during a strategic
merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value}
pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions,
whose key field is "key", the operator
is "In", and the values array contains
only "value". The requirements are ANDed.
type: object
type: object
weight:
description: Weight associated with matching
the corresponding matchExpressions, in the
range 1-100.
format: int32
type: integer
required:
- matchSelector
- weight
type: object
type: array
type: object
scatterStrategy:
description: ScatterStrategy defines the scatter rules
to make pods been scattered when update. This will
avoid pods with the same key-value to be updated in
one batch. - Note that pods will be scattered after
priority sort. So, although priority strategy and
scatter strategy can be applied together, we suggest
to use either one of them. - If scatterStrategy is
used, we suggest to just use one term. Otherwise,
the update order can be hard to understand.
items:
properties:
key:
type: string
value:
type: string
required:
- key
- value
type: object
type: array
type:
description: Type indicates the type of the CloneSetUpdateStrategy.
Default is ReCreate.
type: string
type: object
volumeClaimTemplates:
description: VolumeClaimTemplates is a list of claims that
pods are allowed to reference. Note that PVC will be deleted
when its pod has been deleted.
items:
description: PersistentVolumeClaim is a user's request
for and claim to a persistent volume
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
required:
- selector
- template
type: object
required:
- spec
type: object
deploymentTemplate:
description: Deployment template
properties:
metadata:
type: object
spec:
description: DeploymentSpec is the specification of the desired
behavior of the Deployment.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- spec
type: object
statefulSetTemplate:
description: StatefulSet template
properties:
metadata:
type: object
x-kubernetes-preserve-unknown-fields: true
spec:
description: A StatefulSetSpec is the specification of a StatefulSet.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- spec
type: object
type: object
topology:
description: Topology describes the pods distribution detail between
each of subsets.
properties:
subsets:
description: Contains the details of each subset. Each element in
this array represents one subset which will be provisioned and
managed by UnitedDeployment.
items:
description: Subset defines the detail of a subset.
properties:
name:
description: Indicates subset name as a DNS_LABEL, which will
be used to generate subset workload name prefix in the format
'<deployment-name>-<subset-name>-'. Name should be unique
between all of the subsets under one UnitedDeployment.
type: string
nodeSelectorTerm:
description: Indicates the node selector to form the subset.
Depending on the node selector, pods provisioned could be
distributed across multiple groups of nodes. A subset's
nodeSelectorTerm is not allowed to be updated.
type: object
x-kubernetes-preserve-unknown-fields: true
replicas:
anyOf:
- type: integer
- type: string
description: Indicates the number of the pod to be created
under this subset. Replicas could also be percentage like
'10%', which means 10% of UnitedDeployment replicas of pods
will be distributed under this subset. If nil, the number
of replicas in this subset is determined by controller.
Controller will try to keep all the subsets with nil replicas
have average pods.
x-kubernetes-int-or-string: true
tolerations:
description: Indicates the tolerations the pods under this
subset have. A subset's tolerations is not allowed to be
updated.
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
required:
- name
type: object
type: array
type: object
updateStrategy:
description: UpdateStrategy indicates the strategy the UnitedDeployment
use to preform the update, when template is changed.
properties:
manualUpdate:
description: Includes all of the parameters a Manual update strategy
needs.
properties:
partitions:
additionalProperties:
format: int32
type: integer
description: Indicates number of subset partition.
type: object
type: object
type:
description: Type of UnitedDeployment update strategy. Default is
Manual.
type: string
type: object
required:
- selector
type: object
status:
description: UnitedDeploymentStatus defines the observed state of UnitedDeployment.
properties:
collisionCount:
description: Count of hash collisions for the UnitedDeployment. The
UnitedDeployment controller uses this field as a collision avoidance
mechanism when it needs to create the name for the newest ControllerRevision.
format: int32
type: integer
conditions:
description: Represents the latest available observations of a UnitedDeployment's
current state.
items:
description: UnitedDeploymentCondition describes current state of
a UnitedDeployment.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of in place set condition.
type: string
type: object
type: array
currentRevision:
description: CurrentRevision, if not empty, indicates the current version
of the UnitedDeployment.
type: string
observedGeneration:
description: ObservedGeneration is the most recent generation observed
for this UnitedDeployment. It corresponds to the UnitedDeployment's
generation, which is updated on mutation by the API Server.
format: int64
type: integer
readyReplicas:
description: The number of ready replicas.
format: int32
type: integer
replicas:
description: Replicas is the most recently observed number of replicas.
format: int32
type: integer
subsetReplicas:
additionalProperties:
format: int32
type: integer
description: Records the topology detail information of the replicas
of each subset.
type: object
updateStatus:
description: Records the information of update progress.
properties:
currentPartitions:
additionalProperties:
format: int32
type: integer
description: Records the current partition.
type: object
updatedRevision:
description: Records the latest revision.
type: string
type: object
updatedReadyReplicas:
description: The number of ready current revision replicas for this
UnitedDeployment.
format: int32
type: integer
updatedReplicas:
description: The number of pods in current version.
format: int32
type: integer
required:
- currentRevision
- replicas
- updatedReplicas
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end }}

View File

@ -0,0 +1,189 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: kruise-system
---
apiVersion: v1
kind: Service
metadata:
name: kruise-webhook-service
namespace: kruise-system
spec:
ports:
- port: 443
targetPort: {{ .Values.manager.webhook.port }}
selector:
control-plane: controller-manager
---
apiVersion: v1
kind: Secret
metadata:
name: kruise-webhook-certs
namespace: kruise-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
control-plane: controller-manager
name: kruise-controller-manager
namespace: kruise-system
spec:
replicas: {{ .Values.manager.replicas }}
selector:
matchLabels:
control-plane: controller-manager
minReadySeconds: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 100%
template:
metadata:
labels:
control-plane: controller-manager
spec:
containers:
- args:
- --enable-leader-election
- --metrics-addr={{ .Values.manager.metrics.addr }}:{{ .Values.manager.metrics.port }}
- --health-probe-addr=:{{ .Values.manager.healthProbe.port }}
- --logtostderr=true
- --v={{ .Values.manager.log.level }}
- --feature-gates={{ .Values.featureGates }}
command:
- /manager
image: {{ .Values.manager.image.repository }}:{{.Values.manager.image.tag}}
imagePullPolicy: Always
name: manager
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: WEBHOOK_PORT
value: "{{ .Values.manager.webhook.port }}"
- name: WEBHOOK_CONFIGURATION_FAILURE_POLICY_PODS
value: {{ .Values.webhookConfiguration.failurePolicy.pods }}
ports:
- containerPort: {{ .Values.manager.webhook.port }}
name: webhook-server
protocol: TCP
- containerPort: {{ .Values.manager.metrics.port }}
name: metrics
protocol: TCP
- containerPort: {{ .Values.manager.healthProbe.port }}
name: health
protocol: TCP
readinessProbe:
httpGet:
path: readyz
port: {{ .Values.manager.healthProbe.port }}
resources:
{{- toYaml .Values.manager.resources | nindent 12 }}
terminationGracePeriodSeconds: 10
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: control-plane
operator: In
values:
- controller-manager
topologyKey: kubernetes.io/hostname
weight: 100
{{- with .Values.manager.nodeAffinity }}
nodeAffinity:
{{ toYaml . | indent 10 }}
{{- end }}
{{- if .Values.manager.nodeSelector }}
nodeSelector:
{{ toYaml .Values.manager.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.manager.tolerations }}
tolerations:
{{ toYaml .Values.manager.tolerations | indent 8 }}
{{- end }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kruise-daemon
namespace: kruise-system
{{ if contains "KruiseDaemon=false" .Values.featureGates }}{{ else }}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kruise-daemon
namespace: kruise-system
labels:
control-plane: daemon
spec:
selector:
matchLabels:
control-plane: daemon
minReadySeconds: 3
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 10
template:
metadata:
labels:
control-plane: daemon
spec:
{{- if .Values.daemon.affinity }}
affinity:
{{ toYaml .Values.daemon.affinity | indent 8 }}
{{- end }}
containers:
- command:
- /kruise-daemon
args:
- --logtostderr=true
- --v=4
- --addr=:{{ .Values.daemon.port }}
image: {{ .Values.manager.image.repository }}:{{.Values.manager.image.tag}}
imagePullPolicy: Always
name: daemon
env:
- name: NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: {{ .Values.daemon.port }}
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
{{- toYaml .Values.daemon.resources | nindent 12 }}
volumeMounts:
- mountPath: /hostvarrun
name: runtime-socket
readOnly: true
tolerations:
- operator: Exists
hostNetwork: true
terminationGracePeriodSeconds: 10
serviceAccountName: kruise-daemon
volumes:
- hostPath:
path: /var/run
type: ""
name: runtime-socket
{{- end }}

View File

@ -0,0 +1,470 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kruise-leader-election-role
namespace: kruise-system
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: kruise-manager-role
rules:
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- controllerrevisions
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments/status
verbs:
- get
- patch
- update
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- replicasets/status
verbs:
- get
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- statefulsets/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- advancedcronjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- advancedcronjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- broadcastjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- broadcastjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- clonesets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- clonesets/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- daemonsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- daemonsets/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- imagepulljobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- imagepulljobs/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- nodeimages
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- nodeimages/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- sidecarsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- sidecarsets/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- statefulsets/status
verbs:
- get
- patch
- update
- apiGroups:
- apps.kruise.io
resources:
- uniteddeployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- uniteddeployments/status
verbs:
- get
- patch
- update
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: kruise-daemon-role
rules:
- apiGroups:
- apps.kruise.io
resources:
- nodeimages
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.kruise.io
resources:
- nodeimages/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kruise-leader-election-rolebinding
namespace: kruise-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kruise-leader-election-role
subjects:
- kind: ServiceAccount
name: default
namespace: kruise-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kruise-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kruise-manager-role
subjects:
- kind: ServiceAccount
name: default
namespace: kruise-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kruise-daemon-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kruise-daemon-role
subjects:
- kind: ServiceAccount
name: kruise-daemon
namespace: kruise-system

View File

@ -0,0 +1,384 @@
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
creationTimestamp: null
name: kruise-mutating-webhook-configuration
annotations:
template: ""
webhooks:
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-advancedcronjob
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: madvancedcronjob.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- advancedcronjobs
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-broadcastjob
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: mbroadcastjob.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- broadcastjobs
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-cloneset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: mcloneset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- clonesets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-daemonset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: mdaemonset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- daemonsets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-imagepulljob
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: mimagepulljob.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- imagepulljobs
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-nodeimage
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: mnodeimage.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- nodeimages
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-pod
failurePolicy: {{ .Values.webhookConfiguration.failurePolicy.pods }}
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: mpod.kb.io
namespaceSelector:
matchExpressions:
- key: control-plane
operator: DoesNotExist
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-sidecarset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: msidecarset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- sidecarsets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-statefulset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: mstatefulset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- statefulsets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-apps-kruise-io-v1alpha1-uniteddeployment
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: muniteddeployment.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- uniteddeployments
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
creationTimestamp: null
name: kruise-validating-webhook-configuration
annotations:
template: ""
webhooks:
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-advancedcronjob
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vadvancedcronjob.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- advancedcronjobs
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-broadcastjob
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vbroadcastjob.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- broadcastjobs
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-cloneset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vcloneset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- clonesets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-daemonset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vdaemonset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- daemonsets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-imagepulljob
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vimagepulljob.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- imagepulljobs
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-nodeimage
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vnodeimage.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- nodeimages
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-sidecarset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vsidecarset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- sidecarsets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-statefulset
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vstatefulset.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- statefulsets
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-apps-kruise-io-v1alpha1-uniteddeployment
failurePolicy: Fail
timeoutSeconds: {{ .Values.webhookConfiguration.timeoutSeconds }}
name: vuniteddeployment.kb.io
rules:
- apiGroups:
- apps.kruise.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- uniteddeployments

View File

@ -0,0 +1,56 @@
# Default values for kruise.
crds:
managed: true
featureGates: ""
manager:
# settings for log print
log:
# log level for kruise-manager
level: "4"
replicas: 2
image:
repository: openkruise/kruise-manager
tag: v0.8.0
webhook:
port: 9876
metrics:
port: 8080
healthProbe:
port: 8000
# resources of kruise-manager container
resources:
limits:
cpu: 100m
memory: 256Mi
requests:
cpu: 100m
memory: 256Mi
nodeAffinity: {}
nodeSelector: {}
tolerations: []
webhookConfiguration:
failurePolicy:
pods: Ignore
timeoutSeconds: 30
daemon:
log:
# log level for kruise-daemon
level: "4"
port: 10221
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: "0"
memory: "0"

2
go.mod
View File

@ -15,6 +15,7 @@ require (
github.com/docker/docker v1.4.2-0.20180612054059-a9fbbdc8dd87
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
github.com/go-openapi/spec v0.19.2
github.com/gogo/googleapis v1.4.0 // indirect
github.com/gorilla/mux v1.7.3
github.com/onsi/ginkgo v1.12.1
@ -40,6 +41,7 @@ require (
k8s.io/component-base v0.16.6
k8s.io/cri-api v0.16.6
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf
k8s.io/kubernetes v1.16.6
k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19
sigs.k8s.io/controller-runtime v0.5.7

1
go.sum
View File

@ -762,6 +762,7 @@ k8s.io/kube-aggregator v0.16.6/go.mod h1:lRjo9e3xeyF8tjkIKEX+pErNOdE4yTazx9VPO6z
k8s.io/kube-controller-manager v0.16.6/go.mod h1:7ovDaVMCHc4TBOQHzfb5w2XCib7rjx+QCMZTRVQteD4=
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJDVK9qPLhM+sRHYanNKw0EQ=
k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20210216185858-15cd8face8d6 h1:37dOBBPjjBJGIfD+BlzVcjICVLX6fDDIwt5H1UnhXXM=
k8s.io/kube-proxy v0.16.6/go.mod h1:l7jgZcYyjERYxALU/EizkMx/JmIhN2Ff/f/aR/azFKg=
k8s.io/kube-scheduler v0.16.6/go.mod h1:ohT2kmuQnNex0cDUYvXBAdMKHlneruoD4KOacEDpPq4=
k8s.io/kubectl v0.16.6/go.mod h1:ybKdxxoYuQLRqsmBFylvgyFPeVmmRYUbxk134JCiNoM=

View File

@ -0,0 +1,100 @@
/*
Copyright 2021 The Kruise Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"strings"
"github.com/go-openapi/spec"
appspub "github.com/openkruise/kruise/apis/apps/pub"
appsv1alpha1 "github.com/openkruise/kruise/apis/apps/v1alpha1"
appsv1beta1 "github.com/openkruise/kruise/apis/apps/v1beta1"
"k8s.io/kube-openapi/pkg/common"
)
// Generate OpenAPI spec definitions for Kruise Resources
func main() {
generateSwaggerJSON()
}
func generateSwaggerJSON() {
version := "v0.1.0"
if len(os.Args) > 1 {
version = os.Args[1]
if !strings.HasPrefix(version, "v") {
version = "v" + version
}
}
oAPIDefsAppsPub := appspub.GetOpenAPIDefinitions(func(name string) spec.Ref {
return spec.MustCreateRef("#/definitions/" + common.EscapeJsonPointer(swaggify(name)))
})
oAPIDefsAppsV1alpha1 := appsv1alpha1.GetOpenAPIDefinitions(func(name string) spec.Ref {
return spec.MustCreateRef("#/definitions/" + common.EscapeJsonPointer(swaggify(name)))
})
oAPIDefsAppsV1beta1 := appsv1beta1.GetOpenAPIDefinitions(func(name string) spec.Ref {
return spec.MustCreateRef("#/definitions/" + common.EscapeJsonPointer(swaggify(name)))
})
defs := spec.Definitions{}
for defName, val := range oAPIDefsAppsPub {
defs[swaggify(defName)] = val.Schema
}
for defName, val := range oAPIDefsAppsV1alpha1 {
defs[swaggify(defName)] = val.Schema
}
for defName, val := range oAPIDefsAppsV1beta1 {
defs[swaggify(defName)] = val.Schema
}
swagger := spec.Swagger{
SwaggerProps: spec.SwaggerProps{
Swagger: "2.0",
Definitions: defs,
Paths: &spec.Paths{Paths: map[string]spec.PathItem{}},
Info: &spec.Info{
InfoProps: spec.InfoProps{
Title: "Kruise",
Version: version,
},
},
},
}
jsonBytes, err := json.MarshalIndent(swagger, "", " ")
if err != nil {
log.Fatal(err.Error())
}
fmt.Println(string(jsonBytes))
}
// swaggify converts the github package
// e.g.:
// github.com/openkruise/kruise/pkg/apis/apps/v1alpha1.SidecarSet
// to:
// kruise.apps.v1alpha1.SidecarSet
func swaggify(name string) string {
name = strings.Replace(name, "github.com/openkruise/kruise/apis", "kruise", -1)
parts := strings.Split(name, "/")
hostParts := strings.Split(parts[0], ".")
// reverses something like k8s.io to io.k8s
for i, j := 0, len(hostParts)-1; i < j; i, j = i+1, j-1 {
hostParts[i], hostParts[j] = hostParts[j], hostParts[i]
}
parts[0] = strings.Join(hostParts, ".")
return strings.Join(parts, ".")
}

View File

@ -19,4 +19,7 @@ limitations under the License.
// This package imports things required by build scripts, to force `go mod` to see them as dependencies
package hack
import _ "k8s.io/code-generator"
import (
_ "k8s.io/code-generator"
_ "k8s.io/kube-openapi/cmd/openapi-gen"
)

View File

@ -66,7 +66,7 @@ const (
// Add creates a new ImagePullJob Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller
// and Start it when the Manager is Started.
func Add(mgr manager.Manager) error {
if !utildiscovery.DiscoverGVK(controllerKind) || !utilfeature.DefaultFeatureGate.Enabled(features.ImagePulling) {
if !utildiscovery.DiscoverGVK(controllerKind) || !utilfeature.DefaultFeatureGate.Enabled(features.KruiseDaemon) {
return nil
}
return add(mgr, newReconciler(mgr))

View File

@ -73,7 +73,7 @@ const (
// Add creates a new NodeImage Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller
// and Start it when the Manager is Started.
func Add(mgr manager.Manager) error {
if !utildiscovery.DiscoverGVK(controllerKind) || !utilfeature.DefaultFeatureGate.Enabled(features.ImagePulling) {
if !utildiscovery.DiscoverGVK(controllerKind) || !utilfeature.DefaultFeatureGate.Enabled(features.KruiseDaemon) {
return nil
}
return add(mgr, newReconciler(mgr))

View File

@ -27,8 +27,8 @@ import (
)
const (
// ImagePulling enables controllers for NodeImage and ImagePullJob.
ImagePulling featuregate.Feature = "ImagePulling"
// KruiseDaemon enables the features relied on kruise-daemon, such as image pulling and container restarting.
KruiseDaemon featuregate.Feature = "KruiseDaemon"
// PodWebhook enables webhook for Pods creations. This is also related to SidecarSet.
PodWebhook featuregate.Feature = "PodWebhook"
@ -36,7 +36,7 @@ const (
var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
PodWebhook: {Default: true, PreRelease: featuregate.Beta},
ImagePulling: {Default: true, PreRelease: featuregate.Beta},
KruiseDaemon: {Default: true, PreRelease: featuregate.Beta},
}
func init() {

View File

@ -17,12 +17,14 @@ limitations under the License.
package discovery
import (
"fmt"
"time"
"github.com/openkruise/kruise/apis"
"github.com/openkruise/kruise/pkg/client"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/util/retry"
"k8s.io/klog"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
@ -30,7 +32,14 @@ import (
var (
internalScheme = runtime.NewScheme()
isNotNotFound = func(err error) bool { return !errors.IsNotFound(err) }
errKindNotFound = fmt.Errorf("kind not found in group version resources")
backOff = wait.Backoff{
Steps: 4,
Duration: 500 * time.Millisecond,
Factor: 5.0,
Jitter: 0.1,
}
)
func init() {
@ -44,31 +53,31 @@ func DiscoverGVK(gvk schema.GroupVersionKind) bool {
}
discoveryClient := genericClient.DiscoveryClient
var resourceList *metav1.APIResourceList
err := retry.OnError(retry.DefaultBackoff, isNotNotFound, func() error {
var err error
resourceList, err = discoveryClient.ServerResourcesForGroupVersion(gvk.GroupVersion().String())
if err != nil && !errors.IsNotFound(err) {
klog.Infof("Failed to get groupVersionKind %v: %v", gvk, err)
startTime := time.Now()
err := retry.OnError(backOff, func(err error) bool { return true }, func() error {
resourceList, err := discoveryClient.ServerResourcesForGroupVersion(gvk.GroupVersion().String())
if err != nil {
return err
}
return err
for _, r := range resourceList.APIResources {
if r.Kind == gvk.Kind {
return nil
}
}
return errKindNotFound
})
if err != nil {
if errors.IsNotFound(err) {
klog.Infof("Not found groupVersionKind %v: %v", gvk, err)
if err == errKindNotFound {
klog.Warningf("Not found kind %s in group version %s, waiting time %s", gvk.Kind, gvk.GroupVersion().String(), time.Since(startTime))
return false
}
// This might be caused by abnormal apiserver or etcd, ignore it
return true
klog.Errorf("Failed to find resources in group version %s: %v, waiting time %s", gvk.GroupVersion().String(), err, time.Since(startTime))
}
for _, r := range resourceList.APIResources {
if r.Kind == gvk.Kind {
return true
}
}
return false
return true
}
func DiscoverObject(obj runtime.Object) bool {

View File

@ -45,8 +45,8 @@ func (h *ImagePullJobCreateUpdateHandler) Handle(ctx context.Context, req admiss
if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
if !utilfeature.DefaultFeatureGate.Enabled(features.ImagePulling) {
return admission.Errored(http.StatusForbidden, fmt.Errorf("feature-gate %s is not enabled", features.ImagePulling))
if !utilfeature.DefaultFeatureGate.Enabled(features.KruiseDaemon) {
return admission.Errored(http.StatusForbidden, fmt.Errorf("feature-gate %s is not enabled", features.KruiseDaemon))
}
if err := validate(obj); err != nil {

View File

@ -49,8 +49,8 @@ func (h *NodeImageCreateUpdateHandler) Handle(ctx context.Context, req admission
if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
if !utilfeature.DefaultFeatureGate.Enabled(features.ImagePulling) {
return admission.Errored(http.StatusForbidden, fmt.Errorf("feature-gate %s is not enabled", features.ImagePulling))
if !utilfeature.DefaultFeatureGate.Enabled(features.KruiseDaemon) {
return admission.Errored(http.StatusForbidden, fmt.Errorf("feature-gate %s is not enabled", features.KruiseDaemon))
}
if err := validate(obj); err != nil {

View File

@ -30,7 +30,7 @@ func TestMutatingSidecarSetFn(t *testing.T) {
}
appsv1alpha1.SetDefaultsSidecarSet(sidecarSet)
_ = setHashSidecarSet(sidecarSet)
if sidecarSet.Spec.UpdateStrategy.Type != appsv1alpha1.NotUpdateSidecarSetStrategyType {
if sidecarSet.Spec.UpdateStrategy.Type != appsv1alpha1.RollingUpdateSidecarSetStrategyType {
t.Fatalf("update strategy not initialized")
}
if *sidecarSet.Spec.UpdateStrategy.Partition != intstr.FromInt(0) {

View File

@ -135,6 +135,8 @@ func (s *secretCertWriter) read() (*generator.Artifacts, error) {
err := s.Client.Get(context.TODO(), *s.Secret, secret)
if apierrors.IsNotFound(err) {
return nil, notFoundError{err}
} else if err != nil {
return nil, err
}
certs := secretToCerts(secret)
if certs != nil && certs.CACert != nil && certs.CAKey != nil {

29
scripts/generate_openapi.sh Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
go mod vendor
retVal=$?
if [ $retVal -ne 0 ]; then
exit $retVal
fi
set -e
TMP_DIR=$(mktemp -d)
mkdir -p "${TMP_DIR}"/src/github.com/openkruise/kruise
cp -r ./{apis,hack,vendor} "${TMP_DIR}"/src/github.com/openkruise/kruise/
(cd "${TMP_DIR}"/src/github.com/openkruise/kruise; \
GOPATH=${TMP_DIR} GO111MODULE=off go run vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go \
-O openapi_generated -i ./apis/apps/pub -p github.com/openkruise/kruise/apis/apps/pub -h ./hack/boilerplate.go.txt \
--report-filename ./violation_exceptions.list)
(cd "${TMP_DIR}"/src/github.com/openkruise/kruise; \
GOPATH=${TMP_DIR} GO111MODULE=off go run vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go \
-O openapi_generated -i ./apis/apps/v1alpha1 -p github.com/openkruise/kruise/apis/apps/v1alpha1 -h ./hack/boilerplate.go.txt \
--report-filename ./violation_exceptions.list)
(cd "${TMP_DIR}"/src/github.com/openkruise/kruise; \
GOPATH=${TMP_DIR} GO111MODULE=off go run vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go \
-O openapi_generated -i ./apis/apps/v1beta1 -p github.com/openkruise/kruise/apis/apps/v1beta1 -h ./hack/boilerplate.go.txt \
--report-filename ./violation_exceptions.list)
cp -f "${TMP_DIR}"/src/github.com/openkruise/kruise/apis/apps/pub/openapi_generated.go ./apis/apps/pub
cp -f "${TMP_DIR}"/src/github.com/openkruise/kruise/apis/apps/v1alpha1/openapi_generated.go ./apis/apps/v1alpha1
cp -f "${TMP_DIR}"/src/github.com/openkruise/kruise/apis/apps/v1beta1/openapi_generated.go ./apis/apps/v1beta1

View File

@ -0,0 +1,57 @@
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package generates openAPI definition file to be used in open API spec generation on API servers. To generate
// definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. To
// exclude a type from a tagged package, add "+k8s:openapi-gen=false" tag to the type comment lines.
package main
import (
"flag"
"log"
generatorargs "k8s.io/kube-openapi/cmd/openapi-gen/args"
"k8s.io/kube-openapi/pkg/generators"
"github.com/spf13/pflag"
"k8s.io/klog"
)
func main() {
klog.InitFlags(nil)
genericArgs, customArgs := generatorargs.NewDefaults()
genericArgs.AddFlags(pflag.CommandLine)
customArgs.AddFlags(pflag.CommandLine)
flag.Set("logtostderr", "true")
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()
if err := generatorargs.Validate(genericArgs); err != nil {
log.Fatalf("Arguments validation error: %v", err)
}
// Generates the code for the OpenAPIDefinitions.
if err := genericArgs.Execute(
generators.NameSystems(),
generators.DefaultNameSystem(),
generators.Packages,
); err != nil {
log.Fatalf("OpenAPI code generation error: %v", err)
}
}

1
vendor/modules.txt vendored
View File

@ -933,6 +933,7 @@ k8s.io/klog/klogr
# k8s.io/klog/v2 v2.0.0
k8s.io/klog/v2
# k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf
k8s.io/kube-openapi/cmd/openapi-gen
k8s.io/kube-openapi/cmd/openapi-gen/args
k8s.io/kube-openapi/pkg/common
k8s.io/kube-openapi/pkg/generators