As a "Platform Operator" I want a stable platform to deploy tooling.

We all like to make our lives easier in technology with tooling (well most of us do), be that CI/CD/monitoring/scans/git repos, however, how can we deploy these functions in a way that makes our lives easier? If you ask this same question to a group of architects/engineer you will get a long list of answers, my answer is…Bosh!
The reason for Bosh is covered in this blog post.
At this stage I do not want to be prescriptive of which tools are needed, just that I need something to make my deployment of these tools easier. OK, thats a bit miss-leading, I ultimately need to stand up Concourse for some CI/CD pipeline fun and already know that Bosh is a good fit due to a previous role :-)
Where do I start? Based on experience, I know that many options exist for this. Things like bosh-init, Bosh Bootloader (BBL), BUCC all exist to help with this. They each have their pros and cons, however, my preferred method at the moment is bosh-deployment which will allow me to use any IaaS, it has useful options for things like no Internet/or proxy access to the Internet and is also pretty generic rather than focussing on deploying a specific tool (like concourse).
vSphere Deployment
To start off with I want to work in an on-prem environment using vSphere. So my first step would be to get a jumpbox (in my case I picked an Ubuntu image) up and running with the following things installed;
I will also assume that the vSphere environment is up and running and you have the required topology, credentials, firewalls already defined.
Now I can just follow the bosh-deployment instructions and if it no longer quite works, refer to the official docs.
Firstly create a working directory for the bosh deployment
|
|
Then pull down the bosh-deployment repo
|
|
The repo contains a good baseline manifest/template on how to get bosh up and running and will just need to pass a few parameters. Remember what I said about making my life easier? I am a firm believer of not always reinventing the wheel and I look to reuse things where applicable.
The create-env option is used. It will take the manifest we have and implement the desired configuration. A key file is created that bosh create-env needs to keep track of resources created for future alterations. We also need to use something called a manifest operation to tell bosh to use the vSphere CPI and also define what variables need to be passed in. What does this look like? The -h flag can guide us;
|
|
Now we have the background, lets just get something running (the below is an example and you should reflect the settings for your own environment);
|
|
Commit the state thats created and the manifest files to git (or some other safe location that multiple people can access).
What happens if I want to see what the deployment manifest will look like without making the deployment? Well, bosh int is your best friend.
|
|
Logging in
After the deployment has finished you should be able to login to your director;
|
|
|
|
Alternatively you can set export BOSH_ENVIRONMENT=o-bosh once instead of using –environment flag for each command. You could always make use of direnv.
Internet Restrictions
In the majority of enterprise customers I have deployed bosh direct, Internet access has been a bit of an issue. This means a couple of things;
- Default DNS servers are Google
- Bosh ‘stuff’ is on the Internet
To get around the Google DNS issue you can simply use an operation file to alter the default settings
|
|
The default mainfest trys to pull files (stellcells, releases etc.) from the Internet. The bosh release location can be found in bosh.yml;
|
|
To solve this I have created a few operations files (PR) to overide these settings here.
To make use of these you need to include the opertions files in your deployment and also specify the lcations of the files.
|
|
Other operation options
If you browse the GitHub repo you will find a number of operations files that can be used to add UAA/Credhub/Syslog etc. functionality. They are mostly in the /, /misc or /experimental directories.
The operations file concept is pretty cool because it means that you can use a base line deployment template and then add/remplace functionality as required.
Tidier way to Deploy
I have found that to make deployments more reusable, the above command can be seperated into two discrete components;
- Deployment Script
- Variable file
This means that you can use the same deployment script for all deployments and just point to the variables file for the specific environment you are working on.
Deployement Script
|
|
Variables file
The variables file is just plain old Yaml.
|
|
Each environment should have its own file and these should be stored in a git repo or backed up file system (you may want to use git-crypt if using a git repo).
Next
You now have a great place to deploy other services to make your life easy, once you upload a cloud-config that is.