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

Add --enable=automation-service-broker #19409

Merged
merged 1 commit into from
May 16, 2018
Merged

Add --enable=automation-service-broker #19409

merged 1 commit into from
May 16, 2018

Conversation

jmontleon
Copy link
Contributor

No description provided.

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 18, 2018
@jmontleon
Copy link
Contributor Author

/assign @derekwaynecarr

InstallTemplate: bootstrap.MustAsset("install/ansibleservicebroker/deploy-automation-broker-apb.yaml"),
}

err := component.MakeReady(
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2018
@jmontleon jmontleon changed the title Add --enable=ansible-service-broker Add --enable=automation-service-broker Apr 19, 2018
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2018
@jmontleon
Copy link
Contributor Author

/test gcp

Copy link
Contributor

@soltysh soltysh left a 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.

@jmontleon
Copy link
Contributor Author

/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" ]
Copy link
Member

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.

Copy link
Member

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)?

Copy link
Member

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}

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

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.

@jmontleon
Copy link
Contributor Author

/test extended_conformance_install

2 similar comments
@jmontleon
Copy link
Contributor Author

/test extended_conformance_install

@jmontleon
Copy link
Contributor Author

/test extended_conformance_install

@jmontleon
Copy link
Contributor Author

@soltysh sorry for the delay. The changes have been squashed and are passing again. Thanks!

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Apr 30, 2018
@jmontleon
Copy link
Contributor Author

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.

@jmontleon
Copy link
Contributor Author

/test gcp

@jmontleon
Copy link
Contributor Author

/test extended_conformance_install

2 similar comments
@jmontleon
Copy link
Contributor Author

/test extended_conformance_install

@jmontleon
Copy link
Contributor Author

/test extended_conformance_install

@jmontleon
Copy link
Contributor Author

/test gcp

1 similar comment
@jmontleon
Copy link
Contributor Author

/test gcp

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2018
@jwmatthews
Copy link
Member

@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"
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Member

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.

https://github.com/openshift/openshift-ansible/blob/master/roles/ansible_service_broker/tasks/install.yml#L30-L90

name: automation-broker-apb
namespace: "${NAMESPACE}"

- apiVersion: rbac.authorization.k8s.io/v1beta1
Copy link
Contributor

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
Copy link
Contributor

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" ]
Copy link
Contributor

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{
Copy link
Contributor

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.

@deads2k
Copy link
Contributor

deads2k commented May 14, 2018

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.

@jwmatthews
Copy link
Member

@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.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 15, 2018
@jmontleon
Copy link
Contributor Author

@deads2k Thank you for the review. I have:

  • moved the namespace to openshift-automation-service-broker
  • used v1 for the clusterrolebinding resource
  • renamed the template to install.yaml
  • split the clusterrolebinding into a separate install-rbac.yaml template
  • removed "create_broker_namespace=true" as we don't actually need it (it will create the namespace for the broker if it doesn't exist)
  • add a wait condition for the job completion.

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.

  1. https://github.com/automationbroker/automation-broker-apb
  2. https://github.com/automationbroker/automation-broker-apb/blob/master/templates/broker-auth.clusterrolebinding.yaml

@deads2k
Copy link
Contributor

deads2k commented May 15, 2018

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.

https://github.com/automationbroker/automation-broker-apb
https://github.com/automationbroker/automation-broker-apb/blob/master/templates/broker-auth.clusterrolebinding.yaml

A cluster up record! :)

metadata:
name: automation-broker-apb
roleRef:
name: cluster-admin
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

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?

@deads2k
Copy link
Contributor

deads2k commented May 15, 2018

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

  1. Components can be installed in any order. There is no concept of a "prereq", so you may be called in any order. Including in parallel with or before the service catalog. Going forward, we're expecting operators to manage the coming and going of prereqs.

  2. Components must be idempotent. We are likely to call you multiple times.

  3. Components are likely to be asked for a "remove" at some point. It isn't a requirement today.

This looks like a good starting point.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2018
@openshift-ci-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 15, 2018
@jmontleon
Copy link
Contributor Author

/test cmd

@jmontleon
Copy link
Contributor Author

@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.

@jmontleon
Copy link
Contributor Author

/test unit

@deads2k
Copy link
Contributor

deads2k commented May 15, 2018

@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.

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.

@openshift-merge-robot openshift-merge-robot merged commit 9dae233 into openshift:master May 16, 2018
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants