jhunt / k8s-boshrelease

A BOSH Release for deploying Kubernetes clusters
MIT License
13 stars 9 forks source link

k8s BOSH Release

This is a BOSH release for spinning Kubernetes, using BOSH to orchestrate the "physical" nodes that comprise the various roles of a Kubernetes cluster (control and worker).

Rationale

I am aware of other efforts to BOSH-ify Kubernetes, like kubo. This project does not aim to replace those other projects in any way, and if you find joy in using those projects, please continue using them.

Deployments

If you are looking for production-worthy deployment manifests that follow the same pattern as bosh-deployment and cf-deployment,. check out k8s-deployment!

This repository comes with some sample manifests to illustrate how one might configure a k8s deployment in the wild.

These are found in the manifests/ directory, and can be deployed without further pre-processing.

Deployment Dependency

In order to perform activites on the pods which require DNS lookups, such as kubectl exec or kubectl pods, BOSH DNS must be deployed. The easiest way of doing this is by adding BOSH DNS to your Runtime Config. An example of a Runtime Config with BOSH DNS can be found here at bosh.io.

Post Deployment

Once Kubernetes is deployed you will likely want to connect to it with kubectl from a jumpbox or laptop but you need a configuration for that. Fortunately there is a jumpbox script which generates the configuration. From one of the control instances run the following as root:

. /var/vcap/jobs/jumpbox/envrc

This will generate a long-lived cluster cert, user client cert and client key and make these available in a kubeconfig. You are now authenticated and kubectl is in your $PATH.

Get the contents of the config, while still logged into the BOSH SSH session, run:

cat $KUBECONFIG

On your jumpbox or anywhere else you need a kubectl configuration file, write out the contents to a file (such as my-bosh-deployed-k8s) and then source the file:

export KUBECONFIG=$PWD/my-bosh-deployed-k8s

Contributing

If you find this, and manage to get it to work for you, great! I'd love to hear from you, of your successes and struggles.

If you find a bug, or something doesn't work quite right, please open an issue in the GitHub tracker! Remember, we have a code of conduct.

If you are thinking of contributing code, please read the Contribution Guidelines and follow them. Particularly, please open GitHub isssues and allow your change to be discussed before submitting a pull request. "Drive-by" PRs may be closed without much discussion.