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

Enable Eirini to run on a BOSH VM #8

Merged

Conversation

jenspinney
Copy link
Contributor

This PR enables Eirini to run on a BOSH-managed VM. Recently, Eirini was modified to be able to run outside the k8s cluster (see cloudfoundry/eirini#52). This PR hooks that ability into the bosh release so that Eirini can run on a BOSH VM.

This is accomplished by generating a kube config file from the following new spec properties:

  • opi.k8s.host_url
  • opi.k8s.node_ca
  • opi.k8s.service_account.name
  • opi.k8s.service_account.token

If those values are specified, kube config and CA certificate files are generated on the BOSH VM and hooked into the opi config.

This PR also bumps the Eirini submodule to be able to take advantage of the out-of-cluster support.

jenspinney and others added 3 commits May 1, 2019 16:02
Previously, Eirini needed to run from within the k8s cluster where
workloads were scheduled. Recently, a change was made to the Eirini
source to allow a kube.conf file to be specified, allowing Eirini to run
outside of the target cluster (e.g., from a BOSH VM)

This commit adds the following spec properties:
- opi.k8s.host_url
- opi.k8s.node_ca
- opi.k8s.service_account.name
- opi.k8s.service_account.token

and generates kube.conf and CA certificate files on the BOSH VM from these values.

Signed-off-by: Jaskanwal Pawar <jpawar@pivotal.io>
This bump of Eirini is required to allow Eirini to run outside the k8s cluster
@jimmykarily
Copy link
Collaborator

Thank you @jenspinney for this PR! I tried to use this bosh release without setting any of the new properties and I get failures like:

/usr/local/rvm/gems/ruby-2.4.0/gems/bosh-template-2.2.0/lib/bosh/template/evaluation_context.rb:95:in `p': Can't find property '["opi.k8s.node_ca"]' (Bosh::Template::UnknownProperty)

I guess there are some more if statements needed to make all of them optional when they are not needed. I will check again next week but in the meantime maybe you can find where ifs are missing.

- Should only render when the property which contains its value is
actually set
@jspawar
Copy link
Contributor

jspawar commented May 3, 2019

@jimmykarily Woops, sorry about that. There is a template file corresponding to the value of opi.k8s.node_ca. Committed a change to the PR to render that value conditionally like the rest of our stuff, should be good to go for you now.

Also, this latest commit bumped Eirini submodule again to be in line with current HEAD of master

Thanks,
Jwal

@jimmykarily
Copy link
Collaborator

Works now, thanks! Merging.

@jimmykarily jimmykarily merged commit 10ebcd2 into cloudfoundry-community:master May 6, 2019
@jimmykarily
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants