Fix errors in configure-multiple-schedulers.md (#8540)
* Fix errors in configure-multiple-schedulers.md - Failed to push docker image - Errors found in my-scheduler logs ``` ... E0515 06:36:28.180428 1 reflector.go:205] k8s.io/kubernetes/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1beta1.ReplicaSet: replicasets.extensions is forbidden: User "system:serviceaccount:kube-system:default" cannot list replicasets.extensions at the cluster scope ``` * Replace double quote with backticks for code strings * Use `system:kube-scheduler` instead of `cluster-admin` * Create dedicated service account for `my-scheduler`
This commit is contained in:
committed by
k8s-ci-robot
parent
5c3fa99234
commit
d03745376c
@@ -44,7 +44,7 @@ For more details, please read the GCR
|
|||||||
[documentation](https://cloud.google.com/container-registry/docs/).
|
[documentation](https://cloud.google.com/container-registry/docs/).
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker build -t my-kube-scheduler:1.0 .
|
docker build -t gcr.io/my-gcp-project/my-kube-scheduler:1.0 .
|
||||||
gcloud docker -- push gcr.io/my-gcp-project/my-kube-scheduler:1.0
|
gcloud docker -- push gcr.io/my-gcp-project/my-kube-scheduler:1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -63,6 +63,9 @@ config. Save it as `my-scheduler.yaml`:
|
|||||||
An important thing to note here is that the name of the scheduler specified as an
|
An important thing to note here is that the name of the scheduler specified as an
|
||||||
argument to the scheduler command in the container spec should be unique. This is the name that is matched against the value of the optional `spec.schedulerName` on pods, to determine whether this scheduler is responsible for scheduling a particular pod.
|
argument to the scheduler command in the container spec should be unique. This is the name that is matched against the value of the optional `spec.schedulerName` on pods, to determine whether this scheduler is responsible for scheduling a particular pod.
|
||||||
|
|
||||||
|
Note also that we created a dedicated service account `my-scheduler` and bind the cluster role
|
||||||
|
`system:kube-scheduler` to it so that it can acquire the same privileges as `kube-scheduler`.
|
||||||
|
|
||||||
Please see the
|
Please see the
|
||||||
[kube-scheduler documentation](/docs/admin/kube-scheduler/) for
|
[kube-scheduler documentation](/docs/admin/kube-scheduler/) for
|
||||||
detailed description of other command line arguments.
|
detailed description of other command line arguments.
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: my-scheduler
|
||||||
|
namespace: kube-system
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: my-scheduler-as-kube-scheduler
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: my-scheduler
|
||||||
|
namespace: kube-system
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kube-scheduler
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -19,6 +38,7 @@ spec:
|
|||||||
tier: control-plane
|
tier: control-plane
|
||||||
version: second
|
version: second
|
||||||
spec:
|
spec:
|
||||||
|
serviceAccountName: my-scheduler
|
||||||
containers:
|
containers:
|
||||||
- command:
|
- command:
|
||||||
- /usr/local/bin/kube-scheduler
|
- /usr/local/bin/kube-scheduler
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ func TestExampleObjectSchemas(t *testing.T) {
|
|||||||
"memory-defaults-pod": {&api.Pod{}},
|
"memory-defaults-pod": {&api.Pod{}},
|
||||||
"memory-defaults-pod-2": {&api.Pod{}},
|
"memory-defaults-pod-2": {&api.Pod{}},
|
||||||
"memory-defaults-pod-3": {&api.Pod{}},
|
"memory-defaults-pod-3": {&api.Pod{}},
|
||||||
"my-scheduler": {&extensions.Deployment{}},
|
"my-scheduler": {&api.ServiceAccount{}, &rbac.ClusterRoleBinding{}, &extensions.Deployment{}},
|
||||||
"namespace-dev": {&api.Namespace{}},
|
"namespace-dev": {&api.Namespace{}},
|
||||||
"namespace-prod": {&api.Namespace{}},
|
"namespace-prod": {&api.Namespace{}},
|
||||||
"persistent-volume-label-initializer-config": {&admissionregistration.InitializerConfiguration{}},
|
"persistent-volume-label-initializer-config": {&admissionregistration.InitializerConfiguration{}},
|
||||||
|
|||||||
Reference in New Issue
Block a user