kube-batch(一)安装
安装
官方:https://github.com/kubernetes-sigs/kube-batch
下载镜像
安装
官方:https://github.com/kubernetes-sigs/kube-batch
下载镜像
使用v0.5
docker pull kubesigs/kube-batch:v0.5
两种安装方式
- 第一种:使用yaml安装
- 第二种:使用helm安装
第一种:使用yaml 安装方式
【Step1】创建 CRD
kubectl create -f scheduling_v1alpha1_podgroup.yaml
kubectl create -f scheduling_v1alpha2_podgroup.yaml
kubectl create -f scheduling_v1alpha1_queue.yaml
kubectl create -f scheduling_v1alpha2_queue.yaml
scheduling_v1alpha1_podgroup.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: podgroups.scheduling.incubator.k8s.io
annotations:
"helm.sh/hook": "crd-install"
spec:
group: scheduling.incubator.k8s.io
names:
kind: PodGroup
plural: podgroups
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
minMember:
format: int32
type: integer
queue:
type: string
priorityClassName:
type: string
type: object
status:
properties:
succeeded:
format: int32
type: integer
failed:
format: int32
type: integer
running:
format: int32
type: integer
type: object
type: object
version: v1alpha1
scheduling_v1alpha2_podgroup.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: podgroups.scheduling.sigs.dev
spec:
group: scheduling.sigs.dev
names:
kind: PodGroup
plural: podgroups
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
minMember:
format: int32
type: integer
queue:
type: string
priorityClassName:
type: string
type: object
status:
properties:
succeeded:
format: int32
type: integer
failed:
format: int32
type: integer
running:
format: int32
type: integer
type: object
type: object
version: v1alpha2
scheduling_v1alpha1_queue.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: queues.scheduling.incubator.k8s.io
annotations:
"helm.sh/hook": "crd-install"
spec:
group: scheduling.incubator.k8s.io
names:
kind: Queue
plural: queues
scope: Cluster
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
weight:
format: int32
type: integer
type: object
type: object
version: v1alpha1
scheduling_v1alpha2_queue.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: queues.scheduling.sigs.dev
spec:
group: scheduling.sigs.dev
names:
kind: Queue
plural: queues
scope: Cluster
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
weight:
format: int32
type: integer
type: object
status:
properties:
unknown:
format: int32
type: integer
pending:
format: int32
type: integer
running:
format: int32
type: integer
type: object
type: object
version: v1alpha2
【Step2】 创建deployment
kubectl create -f deployment.yaml
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-batch
labels:
chart: kube-batch-kube-batch
spec:
replicas: 1
selector:
matchLabels:
app: kube-batch
template:
metadata:
labels:
app: kube-batch
spec:
containers:
- name: kube-batch
image: 10.220.54.6:8088/kuai/kube-batch:v0.5
args: ["--logtostderr", "--v", "3"]
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: 2000m
memory: 2048Mi
requests:
cpu: 2000m
memory: 2048Mi
【Step3】创建Queue
apiVersion: scheduling.incubator.k8s.io/v1alpha1
kind: Queue
metadata:
name: default
spec:
weight: 1
第二种:使用helm 安装方式
【Step1】 下载kube-batch
#mkdir -p $GOPATH/src/github.com/kubernetes-sigs/
#cd $GOPATH/src/github.com/kubernetes-sigs/
#git clone http://github.com/kubernetes-sigs/kube-batch
【Step2】通过helm部署kube-batch
#helm install $GOPATH/src/github.com/kubernetes-sigs/kube-batch/deployment/kube-batch --namespace kube-system
【Step3】查看是否安装成功后
#helm list
使用v0.5
docker pull kubesigs/kube-batch:v0.5
两种安装方式
- 第一种:使用yaml安装
- 第二种:使用helm安装
第一种:使用yaml 安装方式
【Step1】创建 CRD
kubectl create -f scheduling_v1alpha1_podgroup.yaml
kubectl create -f scheduling_v1alpha2_podgroup.yaml
kubectl create -f scheduling_v1alpha1_queue.yaml
kubectl create -f scheduling_v1alpha2_queue.yaml
scheduling_v1alpha1_podgroup.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: podgroups.scheduling.incubator.k8s.io
annotations:
"helm.sh/hook": "crd-install"
spec:
group: scheduling.incubator.k8s.io
names:
kind: PodGroup
plural: podgroups
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
minMember:
format: int32
type: integer
queue:
type: string
priorityClassName:
type: string
type: object
status:
properties:
succeeded:
format: int32
type: integer
failed:
format: int32
type: integer
running:
format: int32
type: integer
type: object
type: object
version: v1alpha1
scheduling_v1alpha2_podgroup.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: podgroups.scheduling.sigs.dev
spec:
group: scheduling.sigs.dev
names:
kind: PodGroup
plural: podgroups
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
minMember:
format: int32
type: integer
queue:
type: string
priorityClassName:
type: string
type: object
status:
properties:
succeeded:
format: int32
type: integer
failed:
format: int32
type: integer
running:
format: int32
type: integer
type: object
type: object
version: v1alpha2
scheduling_v1alpha1_queue.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: queues.scheduling.incubator.k8s.io
annotations:
"helm.sh/hook": "crd-install"
spec:
group: scheduling.incubator.k8s.io
names:
kind: Queue
plural: queues
scope: Cluster
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
weight:
format: int32
type: integer
type: object
type: object
version: v1alpha1
scheduling_v1alpha2_queue.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: queues.scheduling.sigs.dev
spec:
group: scheduling.sigs.dev
names:
kind: Queue
plural: queues
scope: Cluster
validation:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
weight:
format: int32
type: integer
type: object
status:
properties:
unknown:
format: int32
type: integer
pending:
format: int32
type: integer
running:
format: int32
type: integer
type: object
type: object
version: v1alpha2
【Step2】 创建deployment
kubectl create -f deployment.yaml
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-batch
labels:
chart: kube-batch-kube-batch
spec:
replicas: 1
selector:
matchLabels:
app: kube-batch
template:
metadata:
labels:
app: kube-batch
spec:
containers:
- name: kube-batch
image: 10.220.54.6:8088/kuai/kube-batch:v0.5
args: ["--logtostderr", "--v", "3"]
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: 2000m
memory: 2048Mi
requests:
cpu: 2000m
memory: 2048Mi
【Step3】创建Queue
apiVersion: scheduling.incubator.k8s.io/v1alpha1
kind: Queue
metadata:
name: default
spec:
weight: 1
第二种:使用helm 安装方式
【Step1】 下载kube-batch
#mkdir -p $GOPATH/src/github.com/kubernetes-sigs/
#cd $GOPATH/src/github.com/kubernetes-sigs/
#git clone http://github.com/kubernetes-sigs/kube-batch
【Step2】通过helm部署kube-batch
#helm install $GOPATH/src/github.com/kubernetes-sigs/kube-batch/deployment/kube-batch --namespace kube-system
【Step3】查看是否安装成功后
#helm list
不要小瞧女程序员
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· winform 绘制太阳,地球,月球 运作规律
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· Manus的开源复刻OpenManus初探
· 写一个简单的SQL生成工具