

GitHub - openkruise/kruise: Automate application workloads management on Kuberne...
source link: https://github.com/openkruise/kruise
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
OpenKruise/Kruise
Kruise is the core of the OpenKruise project. It is a set of controllers which extends and complements Kubernetes core controllers on workload management.
Today, Kruise offers three workload controllers:
-
Advanced StatefulSet: An enhanced version of default StatefulSet with extra functionalities such as
inplace-update
. -
BroadcastJob: A job that runs Pods to completion across all the nodes in the cluster.
-
SidecarSet: A controller that injects sidecar containers into the Pod spec based on selectors.
Please see documents for more technical information.
Please find the project roadmap here.
Several tutorials are provided to demonstrate how to use the workload controllers.
Getting started
Install with YAML files
Install CRDs
kubectl apply -f https://raw.githubusercontent.com/kruiseio/kruise/master/config/crds/apps_v1alpha1_broadcastjob.yaml
kubectl apply -f https://raw.githubusercontent.com/kruiseio/kruise/master/config/crds/apps_v1alpha1_sidecarset.yaml
kubectl apply -f https://raw.githubusercontent.com/kruiseio/kruise/master/config/crds/apps_v1alpha1_statefulset.yaml
Note that ALL three CRDs need to be installed for kruise-controller to run properly.
Install kruise-controller-manager
kubectl apply -f https://raw.githubusercontent.com/kruiseio/kruise/master/config/manager/all_in_one.yaml
Or run from the repo root directory:
kustomize build config/default | kubectl apply -f -
To Install Kustomize, check kustomize website.
Note that use Kustomize 1.0.11. Version 2.0.3 has compatibility issues with kube-builder
The official kruise-controller-manager image is hosted under docker hub.
Usage examples
Advanced StatefulSet
apiVersion: apps.kruise.io/v1alpha1 kind: StatefulSet metadata: name: sample spec: replicas: 3 serviceName: fake-service selector: matchLabels: app: sample template: metadata: labels: app: sample spec: readinessGates: # A new condition must be added to ensure the pod remain at NotReady state while the in-place update is happening - conditionType: InPlaceUpdateReady containers: - name: main image: nginx:alpine podManagementPolicy: Parallel # allow parallel updates, works together with maxUnavailable updateStrategy: type: RollingUpdate rollingUpdate: # Do in-place update if possible, currently only image update is supported for in-place update podUpdatePolicy: InPlaceIfPossible # Allow parallel updates with max number of unavailable instances equals to 2 maxUnavailable: 2
Broadcast Job
Run a BroadcastJob that each Pod computes pi, with ttlSecondsAfterFinished
set to 30. The job
will be deleted in 30 seconds after the job is finished.
apiVersion: apps.kruise.io/v1alpha1 kind: BroadcastJob metadata: name: broadcastjob-ttl spec: template: spec: containers: - name: pi image: perl command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] restartPolicy: Never completionPolicy: type: Always ttlSecondsAfterFinished: 30
SidecarSet
The yaml file below describes a SidecarSet that contains a sidecar container named sidecar1
# sidecarset.yaml apiVersion: apps.kruise.io/v1alpha1 kind: SidecarSet metadata: name: test-sidecarset spec: selector: # select the pods to be injected with sidecar containers matchLabels: app: nginx containers: - name: sidecar1 image: centos:7 command: ["sleep", "999d"] # do nothing at all
Developer Guide
There's a Makefile
in the root folder which describes the options to build and install. Here are some common ones:
Build the controller manager binary
make manager
Run the tests
make test
Build the docker image, by default the image name is openkruise/kruise-manager:v1alpha1
export IMG=<your_image_name> && make docker-build
Push the image
export IMG=<your_image_name> && make docker-push
or just
docker push <your_image_name>
Generate manifests e.g. CRD, RBAC YAML files etc.
make manifests
To develop/debug kruise controller manager locally, please check the debug guide.
Community
If you have any questions or want to contribute, you are welcome to communicate most things via GitHub issues or pull requests.
Other active communication channels:
- Slack: channel address
- Mailing List: todo
- Dingtalk Group(钉钉讨论群)
Copyright
Certain implementation relies on existing code from Kubernetes and the credit goes to original Kubernetes authors.
Recommend
-
15
作者 | 酒祝 阿里云技术专家 背景 OpenKruise 是阿里云开源的大规...
-
25
前言 《云原生生态周报》由阿里云容器平台联合蚂蚁金服共同发布,每周一期。众多一线社区专家与您一起“跟踪动态,读懂社区”,分享云原生社区项目进展、活动发布、精选博客等信息。以下是第四十七期云原生生态周报的内容。
-
33
作者 | 王思宇(酒祝) 前言 OpenKruise 是阿里云开源的大规模应用自动化管理引擎,在功能上对标了...
-
27
1. 对于可变基础设施的思考 1.1 kubernetes中的可变与不可变基础设施 在云原生逐渐盛行的现在,不可变基础设施的理念已经逐渐深入人心。不可变基础设施最早是由Chad Fowler于2013年提出的,其核心思想...
-
8
OpenKruise OpenKruise 是 Kubernetes 的一个标准扩展,它可以配合原生 Kubernetes 使用,并为管理应用容器、sidecar、镜像分发等方面提供更加强大和高效的能力。 核心功能 原地升级
-
7
作者 | 王思宇(酒祝) 背景 OpenKruise 项目地址:https://github.com/openkruise/kruise
-
7
-
4
作者 | 王思宇(酒祝) Photo Creidt@ 王思宇(酒祝)
-
7
作者| 赵明山(立衡) OpenKruise 是阿里云开源的云原生应用自动化管理套件,也是当前托管在 Cloud Native Computing Foundation ( CNCF ) 下的 Sandbox 项目。它来自阿里巴巴多年来容器化、云原生的技术沉淀,是阿里内部生产环境大规模...
-
5
xlskubectl — a spreadsheet to control your Kubernetes cluster xlskubectl integrates Google Spreadsheet with Kubernetes. You can finally administer your cluster from the same spreadsheet that you use to track your expenses.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK