-
Notifications
You must be signed in to change notification settings - Fork 4.7k
enable service catalog in oc cluster up #14630
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
Conversation
c866c7a
to
e4a3875
Compare
@csrwng @pmorie @deads2k @smarterclayton @jwforres @jim-minter i'm moving my service catalog enabling PR over here because my other branch got killed by rebasing on top of aggregator behavior that seems to have broken things (i'm not saying the aggregator is broken, but i wanted to go back to something that worked w/ my existing code since i don't know what changes i may need to make to adapt to whatever changed recently). (yes i could have stomped the other branch instead of doing this). Anyway, i think this represents a mostly final state of the roles/permissions/etc. open items:
if you want to run this:
|
metadata: | ||
name: service-catalog-controller | ||
|
||
- kind: ClusterRoleBinding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the controversial one.
userNames: | ||
- system:serviceaccount:service-catalog:service-catalog-controller | ||
|
||
- kind: ClusterRole |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow controller to manage podpresets in user's namespaces.
userNames: | ||
- system:serviceaccount:service-catalog:service-catalog-controller | ||
|
||
- kind: ClusterRole |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow controller to update sc object statuses
- system:serviceaccount:service-catalog:service-catalog-controller | ||
|
||
|
||
- kind: PolicyBinding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow controller to access endpoints for etcd logic.
userNames: | ||
- system:serviceaccount:service-catalog:service-catalog-controller | ||
|
||
- kind: PolicyBinding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow api server to read configmaps in kube-system namespace for delegated auth support
userNames: | ||
- system:serviceaccount:service-catalog:default | ||
|
||
- kind: ClusterRoleBinding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow apiserver to do delegated auth
- system:serviceaccount:service-catalog:default | ||
|
||
|
||
- kind: ClusterRole |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow any user to view available serviceclasses (cluster resource)
let's discuss as requested :) |
I'm not actually sure where that's being discussed, please do you have a link? |
Yikes - as part of an oc cluster up card? |
Is this just indicating that the service-catalog-user-role should be annotated with "authorization.openshift.io/system-only" ? Also is it ruled out just to add the appropriate rules into the existing view and edit roles and save the migration work? (We did that recently on the template service broker side to save the additional complexity, btw) Expanding on this - it seems hard work that this PR is (a) doing some RBAC changes in bootstrappolicy and some in a template (it's half in, half out), and (b) has an implication on migration. Is it possible to either move the ServiceCatalogUserRoleName bits into view and edit within bootstrap policy, or maybe to live oc patch these into view and edit from a separate yaml file sitting in examples/service-catalog? |
metadata: | ||
name: namespace-viewer | ||
rules: | ||
- apiGroups: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in several places in this file, I wonder whether this must be
- apiGroups:
- ""
(note additional second line). I wonder whether as it stands what you have means "all API groups" rather than "just kubernetes core"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure but i'll add it.
- kind: ClusterRole | ||
apiVersion: v1 | ||
metadata: | ||
name: secret-admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClusterRoles can contain multiple rules - is it possible to squash all these clusterroles down to approximately 'this cluster role A has everything for a sc controller' and 'this cluster role B has everything for a sc apiserver', then 2 clusterrolebindings against these clusterroles + any other clusterrolebindings required (e.g. template-broker-caller-binding)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a rule can contain multiple resources and I think a cartesian product is used internally. Thus 2 rules can be condensed when they are equal in all respects except the resources (and don't need to be separated for different bindings). I think secret-admin and podpreset-admin are cases in point - they don't need to be separate rules on a clusterrole, but can be 2 resources in 1 rule in 1 clusterrole.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll take a crack at it.
On Jun 14, 2017 5:46 AM, "Jim Minter" <[email protected]> wrote:
let's discuss as requested :)
Is this just indicating that the service-catalog-user-role should be
annotated with "authorization.openshift.io/system-only" ?
Yes exactly. If the role should not appear to end users in the Project
membership page role dropdown then it needs to be added to the list that
gets the annotation. For most infrastructure things the answer is that it
should not.
Also is it ruled out just to add the appropriate rules into the existing
view and edit roles and save the migration work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14630 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABZk7Qvj7itQzPk39_3R6J-g7CIdMkFUks5sD6wIgaJpZM4N5ZOB>
.
|
- system:serviceaccount:service-catalog:service-catalog-controller | ||
|
||
|
||
- kind: PolicyBinding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the PolicyBinding objects can go away when #14547 merges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's correct
name: service-catalog | ||
objects: | ||
|
||
- kind: ServiceAccount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nice to have) would it be possible to have a named SA for the api server as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i figured we might as well use the default SA for something but yeah, i can rework it.
|
||
import ( | ||
"bytes" | ||
// "crypto/tls" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the // imports ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and maybe some of the newlines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the catch. been a lot of iterating on this one.
don't know if there are any knock-on effects of this PR on |
@@ -709,6 +722,92 @@ func (h *Helper) updateConfig(configDir string, opt *StartOptions) error { | |||
cfg.AdmissionConfig.PluginConfig[defaultsapi.BuildDefaultsPlugin] = buildDefaultsConfig | |||
} | |||
|
|||
if opt.ServiceCatalog { | |||
cfg.TemplateServiceBrokerConfig = &configapi.TemplateServiceBrokerConfig{ | |||
TemplateNamespaces: []string{"openshift"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a const openshiftNamespace but it might be located in the wrong package (pkg/bootstrap/docker) - maybe not this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no time like the present. will update.
it's broken until #14594 makes it through the queue. |
it's being discussed here: #14623
since i'm adding the default project role as part of this work (because it is needed for the oc cluster up feature to work), my understanding is i don't really have a choice but to also add the migration for it at this point.
well it's indicating the discussion should happen. i haven't decided myself if that's the right fix or not, that's why i wanted to talk to @jwforres first.
that's a great question. @deads2k can we do that?
moving the SCuserRole to be part of view/edit seems plausible if @deads2k is ok with it. as for live patching into view and edit, specifically for oc cluster up, i'd rather just do the right thing now than do that for oc cluster up for now and have to revisit this when someone wants to enable TSB on a real cluster. |
right, well i wasn't sure if i'd qualify it as an infrastructure thing or not. SC instances+bindings (what this lets you create/view) are pretty user facing. This is effectively "user can use the service catalog" permission. I'm happy to mark it system if that's what we agree on though. (and even happier to just roll into into edit and forget about it) |
I really dislike the idea of granting permissions to alpha/unsupported features in stock roles because they will never be removed in a normal upgrade flow. If something changes and types become restricted or some such, there is no "normal" way to fix up an existing, non-alpha installation. |
please point me to the migration logic i need to edit. |
It doesn't exist. You'd have to write something from scratch. The reconcile commands never run with tightening on and it isn't selective because that carries a high risk of breaking existing clusters. I don't think you should modify admin, edit, or view roles to include unsupported resources. |
Oh, and we don't directly own reconcile command after 3.6 since we'll be using the RBAC technique. |
I talked to @smarterclayton and i'm going to go w/ the patch approach @jim-minter suggested. |
@jim-minter i think i've addressed all your comments, ptal? @smarterclayton @deads2k pending review from @jim-minter and @csrwng this is ready to go except for removing the "grant anonymous access to the TSB" binding (and the associated caveat text on the enablement flag help). |
a5ccae9
to
16e447a
Compare
[test] |
67c65c4
to
d5f4a2f
Compare
@smarterclayton message added:
|
5284fe0
to
1caf0fb
Compare
Why not `oc adm policy add-cluster-role-to-group
system:openshift:templateservicebroker-client
system:unauthenticated system:authenticated`?
…On Thu, Jun 15, 2017 at 12:06 AM, OpenShift Bot ***@***.***> wrote:
continuous-integration/openshift-jenkins/test Running (
https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2253/)
(Base Commit: 811a267
<811a267>
)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14630 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_pzNoLeuGxUnb3eCwqsVHPdix-WCDks5sEK2pgaJpZM4N5ZOB>
.
|
because that would be way too easy for our users.... i'll update it. |
@smarterclayton updated. |
added changes for #14676 as a new commit. May need to drop the cherry-picked commits before merging depending on whether @deads2k's PR changes before it merges. @smarterclayton final sign off on the TSB warning message/instructions? |
Messages are fine |
[merge][severity:blocker] |
continuous-integration/openshift-jenkins/merge Waiting: You are in the build queue at position: 6 |
Evaluated for origin merge up to 4cd9479 |
flake #14708 |
Evaluated for origin test up to 0a2cf7c |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2348/) (Base Commit: cc06db0) (PR Branch Commit: 0a2cf7c) |
No description provided.