Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in configure-multiple-schedulers.md #8540

Merged
merged 5 commits into from
Jun 4, 2018

Conversation

yujunz
Copy link
Contributor

@yujunz yujunz commented May 15, 2018

  • 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

- 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
```
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 15, 2018
@k8sio-netlify-preview-bot
Copy link
Collaborator

k8sio-netlify-preview-bot commented May 15, 2018

Deploy preview for kubernetes-io-master-staging ready!

Built with commit 7bed674

https://deploy-preview-8540--kubernetes-io-master-staging.netlify.com

@Bradamant3
Copy link
Contributor

/assign

Copy link
Contributor

@Bradamant3 Bradamant3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're waiting on tech review, one markup correction please. Thank you!

@@ -123,6 +123,14 @@ $ kubectl edit clusterrole system:kube-scheduler
- update
```

my-scheduler runs as the “default” service account in the “kube-system” namespace. To allow it run with super-user access, grant cluster-admin permissions to the “default” service account in the “kube-system” namespace.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/"default"/default
s/"kube-system"/kube-system

in other words, replace quotation marks with backticks so that these strings are formatted as code. We use quotation marks in the docs only for strings where strings must be programmatically denoted as such. (There are many violations, but we're trying to clean up ;) )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Bradamant3
Copy link
Contributor

/approve for doc review

@kubernetes/sig-scheduling-pr-reviews are y'all the right ones for tech review?

@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label May 30, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Bradamant3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 30, 2018
``` shell
kubectl create clusterrolebinding my-scheduler-cluster-admin \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why we are not using the system:kube-scheduler clusterole?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, you should not give elevated privileges of cluster-admin to default unless absolutely needed. Did you add my-scheduler to resourceNames of kube-scheduler clusterrole?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, added. And I also agree that binding cluster-admin is not a good idea.

Changed to system:kube-scheduler

@@ -44,7 +44,7 @@ For more details, please read the GCR
[documentation](https://cloud.google.com/container-registry/docs/).

```shell
docker build -t my-kube-scheduler:1.0 .
docker build -t gcr.io/my-gcp-project/my-kube-scheduler:1.0 .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, if you are pushing it to google cloud container registry. If you are pushing to google container registry the build command seems correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next line in the document is $ gcloud docker -- push gcr.io/my-gcp-project/my-kube-scheduler:1.0

It will result in the following error:

The push refers to repository [gcr.io/my-gcp-project/my-kube-scheduler]
An image does not exist locally with the tag: gcr.io/my-gcp-project/my-kube-scheduler

@Bradamant3
Copy link
Contributor

@tengqm does this look OK now?

``` shell
kubectl create clusterrolebinding my-scheduler-kube-scheduler \
--clusterrole=system:kube-scheduler \
--serviceaccount=kube-system:default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could work but ... it is creating another security issue. I'm not a fan of changing the built in accounts. Instead I'd suggest we create a new service account for this.

@yujunz yujunz force-pushed the patch-1 branch 3 times, most recently from bd5504a to 32a6784 Compare June 4, 2018 08:43
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 4, 2018
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 4, 2018
apiVersion: v1
kind: ServiceAccount
metadata:
name: my-scheduler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a valid service account name, though ... funny

Copy link
Contributor

@tengqm tengqm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2018
@k8s-ci-robot k8s-ci-robot merged commit d037453 into kubernetes:master Jun 4, 2018
@yujunz yujunz deleted the patch-1 branch June 5, 2018 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants