Skip to content

Commit

Permalink
KubeCon 2019 China Demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Ma committed Jun 27, 2019
1 parent ab4e709 commit 73d8f91
Show file tree
Hide file tree
Showing 22 changed files with 1,063 additions and 0 deletions.
101 changes: 101 additions & 0 deletions docs/samples/kubecon-2019-china/deploys/controllers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: vk-controllers
namespace: volcano

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: vk-controllers
namespace: volcano
rules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create", "get", "list", "watch", "delete"]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["create", "get", "list", "watch", "delete", "update"]
- apiGroups: ["batch.volcano.sh"]
resources: ["jobs"]
verbs: ["get", "list", "watch", "update", "delete"]
- apiGroups: ["batch.volcano.sh"]
resources: ["jobs/status"]
verbs: ["update", "patch"]
- apiGroups: ["bus.volcano.sh"]
resources: ["commands"]
verbs: ["get", "list", "watch", "delete"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "list", "watch", "update", "patch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["create", "get", "list", "watch", "update", "bind", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "create"]
- apiGroups: [""]
resources: ["services"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: ["scheduling.incubator.k8s.io"]
resources: ["podgroups", "queues", "queues/status"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: ["scheduling.k8s.io"]
resources: ["priorityclasses"]
verbs: ["get", "list", "watch", "create", "delete"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: vk-controllers-role
namespace: volcano
subjects:
- kind: ServiceAccount
name: vk-controllers
namespace: volcano
roleRef:
kind: ClusterRole
name: vk-controllers
apiGroup: rbac.authorization.k8s.io

---
kind: Deployment
apiVersion: apps/v1
metadata:
name: vk-controllers
namespace: volcano
labels:
app: volcano-controller
spec:
replicas: 1
selector:
matchLabels:
app: volcano-controller
template:
metadata:
labels:
app: volcano-controller
spec:
serviceAccount: vk-controllers
imagePullSecrets:
- name: default-secret
containers:
- name: vk-controllers
image: swr.cn-north-1.myhuaweicloud.com/hwstaff_z00383385/vk-controllers:latest
args:
- --alsologtostderr
- -v=3
- 2>&1
imagePullPolicy: "IfNotPresent"
resources:
requests:
cpu: "1000m"
memory: "2048Mi"
limits:
cpu: "1000m"
memory: "2048Mi"
6 changes: 6 additions & 0 deletions docs/samples/kubecon-2019-china/deploys/default-queue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: scheduling.incubator.k8s.io/v1alpha1
kind: Queue
metadata:
name: default
spec:
weight: 1
137 changes: 137 additions & 0 deletions docs/samples/kubecon-2019-china/deploys/scheduler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: vk-scheduler-configmap
namespace: volcano
data:
kube-batch.conf: |
actions: "enqueue, allocate, backfill"
tiers:
- plugins:
- name: priority
- name: gang
- name: conformance
- plugins:
- name: drf
- name: predicates
- name: proportion
- name: nodeorder
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: vk-scheduler
namespace: volcano
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: vk-scheduler
namespace: volcano
rules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create", "get", "list", "watch", "delete"]
- apiGroups: ["batch.volcano.sh"]
resources: ["jobs"]
verbs: ["get", "list", "watch", "update", "delete"]
- apiGroups: ["batch.volcano.sh"]
resources: ["jobs/status"]
verbs: ["update", "patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "list", "watch", "update", "patch"]
- apiGroups: [""]
resources: ["pods", "pods/status"]
verbs: ["create", "get", "list", "watch", "update", "bind", "updateStatus", "delete"]
- apiGroups: [""]
resources: ["pods/binding"]
verbs: ["create"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["list", "watch"]
- apiGroups: ["scheduling.incubator.k8s.io"]
resources: ["podgroups"]
verbs: ["list", "watch", "update"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["list", "watch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list", "watch"]
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
verbs: ["list", "watch"]
- apiGroups: ["scheduling.incubator.k8s.io"]
resources: ["queues"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: ["scheduling.k8s.io"]
resources: ["priorityclasses"]
verbs: ["get", "list", "watch"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: vk-scheduler-role
namespace: volcano
subjects:
- kind: ServiceAccount
name: vk-scheduler
namespace: volcano
roleRef:
kind: ClusterRole
name: vk-scheduler
apiGroup: rbac.authorization.k8s.io

---
kind: Deployment
apiVersion: apps/v1
metadata:
name: vk-scheduler
namespace: volcano
labels:
app: volcano-scheduler
spec:
replicas: 1
selector:
matchLabels:
app: volcano-scheduler
template:
metadata:
labels:
app: volcano-scheduler
spec:
serviceAccount: vk-scheduler
imagePullSecrets:
- name: default-secret
containers:
- name: vk-scheduler
image: swr.cn-north-1.myhuaweicloud.com/hwstaff_z00383385/vk-kube-batch:latest
args:
- --alsologtostderr
- --scheduler-conf=/volcano.scheduler/kube-batch.conf
- --scheduler-name=volcano
- -v=3
- 2>&1
imagePullPolicy: "IfNotPresent"
resources:
requests:
cpu: "1000m"
memory: "2048Mi"
limits:
cpu: "1000m"
memory: "2048Mi"
volumeMounts:
- name: scheduler-config
mountPath: /volcano.scheduler
volumes:
- name: scheduler-config
configMap:
name: vk-scheduler-configmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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

26 changes: 26 additions & 0 deletions docs/samples/kubecon-2019-china/drf/nginx-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx-1
labels:
app: nginx-1
spec:
# modify replicas according to your case
replicas: 8
selector:
matchLabels:
app: nginx-1
template:
metadata:
labels:
app: nginx-1
spec:
schedulerName: volcano
containers:
- name: nginx-1
image: nginx
resources:
requests:
cpu: "1000m"
limits:
cpu: "1000m"
26 changes: 26 additions & 0 deletions docs/samples/kubecon-2019-china/drf/nginx-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx-2
labels:
app: nginx-2
spec:
# modify replicas according to your case
replicas: 8
selector:
matchLabels:
app: nginx-2
template:
metadata:
labels:
app: nginx-2
spec:
schedulerName: volcano
containers:
- name: nginx-2
image: nginx
resources:
requests:
cpu: "1000m"
limits:
cpu: "1000m"
25 changes: 25 additions & 0 deletions docs/samples/kubecon-2019-china/drf/nginx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx
labels:
app: nginx
spec:
# modify replicas according to your case
replicas: 8
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
resources:
requests:
cpu: "1000m"
limits:
cpu: "1000m"
Loading

0 comments on commit 73d8f91

Please sign in to comment.