-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add --enable=automation-service-broker #19409
Conversation
/assign @derekwaynecarr |
InstallTemplate: bootstrap.MustAsset("install/ansibleservicebroker/deploy-automation-broker-apb.yaml"), | ||
} | ||
|
||
err := component.MakeReady( |
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.
Just
return component.MakeReady(...
namespace: "${NAMESPACE}" | ||
|
||
- apiVersion: batch/v1 | ||
kind: Job |
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.
Are you sure this is Job, looking at the .spec
this should rather be DeploymentConfig.
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.
This container will run once and exit. It launches the broker in the ansible-service-broker namespace.
You end up with:
NAMESPACE NAME READY STATUS RESTARTS AGE
ansible-service-broker ansible-service-broker-1-kldc6 1/1 Running 0 22h
automation-broker-apb automation-broker-apb-8hr8r 0/1 Completed 1 22h
Doesn't a job make more sense for this?
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.
Job is fine, what I'm saying is that the definition you have in the yaml is not a valid job. See https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ for an example job, what you have in here is a mixture of a job and deployment.
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.
Thank you. I misunderstood. I'll clean it up.
/test gcp |
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.
This lgtm, please squash your changes and you're good to go.
/test extended_conformance_install |
containers: | ||
- image: docker.io/automationbroker/automation-broker-apb:latest | ||
name: automation-broker-apb | ||
command: [ "entrypoint.sh", "provision", "-e", "broker_name=automation-service-broker", "-e", "create_broker_namespace=true" ] |
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.
you could use args:
instead of command so you don't have to specify entrypoint.sh
.
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.
Is there a reason why we are going with automation-service-broker
instead of automation-broker
(default)?
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.
If you are taking the $NAMESPACE
as an argument you may want to add -e broker_namespace=${NAMESPACE}
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.
ACK on first.
Second, that's what I was told to set it to to be similar to template-service-broker.
Third, as mentioned above the NAMESPACE is where the apb is running not the broker.
- apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: automation-broker-apb |
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.
You may want to specifically run this job in the ${NAMESPACE}
where the automation-broker-apb
service account will live.
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 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.
You may want to specifically run this job in the ${NAMESPACE} where the automation-broker-apb service account will live.
I second this. I think it's best to be very specific.
/test extended_conformance_install |
2 similar comments
/test extended_conformance_install |
/test extended_conformance_install |
@soltysh sorry for the delay. The changes have been squashed and are passing again. Thanks! |
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.
/lgtm
/approve
In testing I found the deadline was too short and the job would sometimes be ended before had a chance to complete. I've upped the time a bit to compensate. |
/test gcp |
/test extended_conformance_install |
2 similar comments
/test extended_conformance_install |
/test extended_conformance_install |
/test gcp |
1 similar comment
/test gcp |
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.
/lgtm
@deads2k @bparees @smarterclayton @derekwaynecarr would one of you have a few mins to review/approve this PR to help us get deployment of automation broker integrated with 'oc'? |
- description: Namespace of the project that is being deploy | ||
displayname: broker client cert key | ||
name: NAMESPACE | ||
value: "automation-broker-apb" |
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.
We reserve openshift-***
. You should use a namespace under there.
@openshift/api-review this is our first external-ish component. How shall we reserve names?
metadata: | ||
name: automation-broker-apb | ||
roleRef: | ||
name: cluster-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.
Thank you for making this very clear. Do you have a link to where this was litigated before?
@sdodson do you install this with ansible? Do you grant this permission?
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.
It looks like the current implementation creates a clusterrole. I'm not sure how closely this new work aligns with the older implementation in openshift-ansible.
name: automation-broker-apb | ||
namespace: "${NAMESPACE}" | ||
|
||
- apiVersion: rbac.authorization.k8s.io/v1beta1 |
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.
use v1 if you please
namespace: "${NAMESPACE}" | ||
|
||
- apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
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.
This should be split into install-rbac.yaml
since bindings are reconciled. The rest should be in install.yaml
for consistency.
containers: | ||
- image: docker.io/automationbroker/automation-broker-apb:latest | ||
name: automation-broker-apb | ||
args: [ "provision", "-e", "broker_name=automation-service-broker", "-e", "create_broker_namespace=true" ] |
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.
"create_broker_namespace=true" looks weird. What does that do?
} | ||
glog.V(2).Infof("instantiating automation service broker template with parameters %v", params) | ||
|
||
component := componentinstall.Template{ |
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 we're going to require the WaitCondition
value.
@mfojtik probably worth updating to enforce. I can't think of a reason not to.
I'm not familiar with what it does, but it appears to fit nicely. On the authorship side, how was it? @jmontleon @jwmatthews To make the boundary clear, we'll keep it compiling, but if there are functional breaks over time you'll be responsible for your component. |
@deads2k thank you for the review. As to owning functional breakage, sounds good to me, our team will own the functional issues that pop up. |
@deads2k Thank you for the review. I have:
I think this addresses all your comments except possibly, "Do you have a link to where this was litigated before?" Do we need to follow up with someone to permit the clusterrolebinding to be created? The job actually runs a containerized ansible role[1] that we created install the automation broker on an openshift cluster. The broker itself does require a clusterrolebinding [2], and it's my understanding that we need this permission in order to create this and (possibly other resources) using the container. We also fully expected and understand that we will be on the hook to maintain this going forward. Re: authorship I found it pretty straight forward to look at the existing options (service-catalog, template-service-broker, etc.) and work from there. I think I had it at least functioning within a day. |
A cluster up record! :) |
metadata: | ||
name: automation-broker-apb | ||
roleRef: | ||
name: cluster-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.
Please make these permissions match https://github.com/openshift/openshift-ansible/blob/master/roles/ansible_service_broker/tasks/install.yml#L30-L90 .
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.
hmmm... perhaps I misunderstood what's happening. This is basically an installer pod?
Alright, I cleared up my confusion with @jwmatthews . This gets cluster-admin because the job is actually installing the components. A few details to note that are not bugs with cluster-up
This looks like a good starting point. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, jmontleon, soltysh 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 |
/test cmd |
@deads2k is remove possible now? We have a deprovision playbook in the container that will remove the broker and other resources it creates as well so it might be pretty trivial for us to implement it today if so. |
/test unit |
It won't be possible in v3.10. It may be possible in 3.11. I mentioned it so that you wouldn't be surprised if we contacted all component owners and asked them for one. |
No description provided.