<div dir="ltr">Ryan,<div><br></div><div>My understanding of wanting to run APBs with extra privileges from our broker is that this is a feature we would like to support down the line. As an aside, it seems worth pointing out that you can workaround this issue by using docker run like:</div><div><br></div><div><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:13.6px;word-wrap:normal;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46);margin-top:0px;margin-bottom:0px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:13.6px;padding:0px;margin:0px;background:transparent;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">docker run --rm --net=host \
-v $HOME/.kube:/opt/apb/.kube:z \
-u $UID \
${APB_NAME} ${APB_ACTION:-'provision'} \
--extra-vars "namespace=mycoolnamespace" \
--extra-vars "etc=etc"</code></pre></div><div><br></div><div>Notes on this command:</div><div><ol><li><font size="2">You need to be using your host's network stack (--net=host)</font></li><li><font size="2">Passing your kube config allows the APB to run at your permission level (ie. if you are an cluster-admin you can do what you want).</font></li><li><font size="2">APB_NAME in this case would be kubevirt-apb</font></li><li><font size="2">You may or may not need the namespace argument, I just know that a lot of our existing APBs assume that the namespace already exists</font></li></ol><div>I am a huge fan of the idea of using APBs to manage a cluster outside the service-catalog/service-broker context. However, I am also excited about pursuing the extra privileged APBs in our broker and how we will meet that use case, so this is not meant to take away from that discussion.</div><div><br></div><div>Thanks,</div><div>David </div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 31, 2018 at 6:13 AM John Matthews <<a href="mailto:jmatthew@redhat.com">jmatthew@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Mo, <div><br></div><div>Do you have any thoughts on the issue Ryan mentions below on being unable to create a rolebinding that is cluster-admin?</div><div>For background, this is for enabling the Broker to deploy APBs that will modify cluster infrastructure...not a typical application/service but special APBs that require extra privileges.</div></div><div dir="ltr"><div><br></div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 30, 2018 at 9:56 PM, Ryan Hallisey <span dir="ltr"><<a href="mailto:rhallise@redhat.com" target="_blank">rhallise@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Karim,<br>
<br>
I think I have a workaround patch that will get provision working for<br>
the kubevirt-apb. Instructions for how to test it are in the commit<br>
message.<br>
<br>
<a href="https://github.com/rthallisey/ansible-service-broker/commit/f27e0538959c43d47d2ff80bba1e894f2249ad62" rel="noreferrer" target="_blank">https://github.com/rthallisey/ansible-service-broker/commit/f27e0538959c43d47d2ff80bba1e894f2249ad62</a><br>
<br>
To summarize for folks what I think is happening. We need the apb to<br>
have the cluster-admin role so it can create cluster-roles. To do<br>
this, set sandbox_role: cluster-admin, auto_escalate: true, and make<br>
the asb user cluster-admin. Then when you provision, you'll hit this<br>
issue: <a href="https://github.com/openshift/ansible-service-broker/issues/711" rel="noreferrer" target="_blank">https://github.com/openshift/ansible-service-broker/issues/711</a>.<br>
The rolebinding fails to create with the error:<br>
<a href="http://rolebindings.rbac.authorization.k8s.io" rel="noreferrer" target="_blank">rolebindings.rbac.authorization.k8s.io</a><br>
"apb-9c21c424-7091-4bc1-b5c5-0caa08aeec39" is forbidden: attempt to<br>
grant extra privileges.<br>
It seems that we can't create a rolebinding that is cluster-admin.<br>
I'm still exploring for the reason why it fails, but my theory is that<br>
the cluster-admin role gives access outside the scope of a role so it<br>
requires a clusterrolebinding. With the clusterrolebinding created<br>
with cluster-admin permissions, I was able to create cluster-resources<br>
from the apb.<br>
<br>
Thanks,<br>
-Ryan<br>
<br>
_______________________________________________<br>
Ansible-service-broker mailing list<br>
<a href="mailto:Ansible-service-broker@redhat.com" target="_blank">Ansible-service-broker@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/ansible-service-broker" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/ansible-service-broker</a><br>
</blockquote></div><br></div></div></div>
_______________________________________________<br>
Ansible-service-broker mailing list<br>
<a href="mailto:Ansible-service-broker@redhat.com" target="_blank">Ansible-service-broker@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/ansible-service-broker" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/ansible-service-broker</a><br>
</blockquote></div>