1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | apiVersion: v1 kind: ServiceAccount metadata: name: zero-scheduler namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: zero-scheduler-as-kube-scheduler subjects: - kind: ServiceAccount name: zero-scheduler namespace: kube-system roleRef: kind: ClusterRole name: system:kube-scheduler apiGroup: rbac.authorization.k8s.io --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: zero-scheduler-as-volume-scheduler subjects: - kind: ServiceAccount name: zero-scheduler namespace: kube-system roleRef: kind: ClusterRole name: system:volume-scheduler apiGroup: rbac.authorization.k8s.io --- apiVersion: v1 kind: ConfigMap metadata: name: zero-scheduler-config namespace: kube-system data: zero-scheduler-config.yaml: | apiVersion: kubescheduler.config.k8s.io/v1beta2 kind: KubeSchedulerConfiguration profiles: - schedulerName: zero-scheduler leaderElection: leaderElect: false --- apiVersion: apps/v1 kind: Deployment metadata: labels: component: scheduler tier: control-plane name: zero-scheduler namespace: kube-system spec: selector: matchLabels: component: scheduler tier: control-plane replicas: 1 template: metadata: labels: component: scheduler tier: control-plane version: second spec: serviceAccountName: zero-scheduler containers: - command: - /usr/local/bin/kube-scheduler - --config=/etc/kubernetes/zero-scheduler/zero-scheduler-config.yaml image: <set-your-scheduler-image or k8s.gcr.io/kube-scheduler:v1.24.0> livenessProbe: httpGet: path: /healthz port: 10259 scheme: HTTPS initialDelaySeconds: 15 name: kube-second-scheduler readinessProbe: httpGet: path: /healthz port: 10259 scheme: HTTPS resources: requests: cpu: '0.1' securityContext: privileged: false volumeMounts: - name: config-volume mountPath: /etc/kubernetes/zero-scheduler hostNetwork: false hostPID: false volumes: - name: config-volume configMap: name: zero-scheduler-config | cs |
1 2 3 4 5 6 7 8 9 10 11 | apiVersion: v1 kind: Pod metadata: labels: run: nginx name: nginx spec: containers: - image: nginx name: nginx schedulerName: zero-scheduler | cs |