root@ubuntu:~# kubectl get all -n volcano-system
NAME READY STATUS RESTARTS AGE
pod/volcano-admission-6cc49fdc5-5zgzs 1/1 Running 0 43h
pod/volcano-admission-init-qgh9b 0/1 Completed 0 43h
pod/volcano-controllers-5f5c4f4785-8dbgl 1/1 Running 0 43h
pod/volcano-scheduler-7f48dddb8f-8g6b5 1/1 Running 0 43h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/volcano-admission-service ClusterIP 10.103.9.198 <none> 443/TCP 43h
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/volcano-admission 1/1 1 1 43h
deployment.apps/volcano-controllers 1/1 1 1 43h
deployment.apps/volcano-scheduler 1/1 1 1 43h
NAME DESIRED CURRENT READY AGE
replicaset.apps/volcano-admission-6cc49fdc5 1 1 1 43h
replicaset.apps/volcano-controllers-5f5c4f4785 1 1 1 43h
replicaset.apps/volcano-scheduler-7f48dddb8f 1 1 1 43h
NAME COMPLETIONS DURATION AGE
job.batch/volcano-admission-init 1/1 89s 43h
root@ubuntu:~#
root@ubuntu:~# cat <<EOF | kubectl apply -f -
> apiVersion: scheduling.volcano.sh/v1beta1
> kind: Queue
> metadata:
> name: test
> spec:
> weight: 1
> reclaimable: false
> capability:
> cpu: 2
> EOF
queue.scheduling.volcano.sh/test created
root@ubuntu:~#
root@ubuntu:~# cat <<EOF | kubectl apply -f -
> apiVersion: batch.volcano.sh/v1alpha1
> kind: Job
> metadata:
> name: job-1
> spec:
> minAvailable: 1
> schedulerName: volcano
> queue: test
> policies:
> - event: PodEvicted
> action: RestartJob
> tasks:
> - replicas: 1
> name: nginx
> policies:
> - event: TaskCompleted
> action: CompleteJob
> template:
> spec:
> containers:
> - command:
> - sleep
> - 10m
> image: nginx:latest
> name: nginx
> resources:
> requests:
> cpu: 1
> limits:
> cpu: 1
> restartPolicy: Never
> EOF
job.batch.volcano.sh/job-1 created
root@ubuntu:~
root@ubuntu:~# kubectl get podgroup job-1 -o yaml
Error from server (NotFound): podgroups.scheduling.incubator.k8s.io "job-1" not found
root@ubuntu:~# kubectl apply -f podgroup.yaml
unable to recognize "podgroup.yaml": no matches for kind "PodGroup" in version "scheduling.sigs.k8s.io/v2alpha2"
error validating "podgroup.yaml": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false
root@ubuntu:~# cat podgroup.yaml
apiVersion: scheduling.sigs.k8s.io/v2alpha2
kind: PodGroup
metadata:
name: nginx
spec:
scheduleTimeoutSeconds: 10
minMember: 3
---
# Add a label to mark the pod belongs to a group
labels:
pod-group.scheduling.sigs.k8s.io: nginx
root@ubuntu:~#
如何使用Volcano CRD资源