Automated GitLab Deployment on GKE
We have an opportunity with some of the newer tools that are out, to automate much of the deployment of GitLab. This is a great way to install for customers willing to operate GitLab on a cloud provider, but it can be an ever better experience for people looking for a quick way to test out GitLab and all of its capabilities.
There are a couple of interesting aspects of GCP that can make for a great trial and enterprise solution:
- They have a great free trial offer: $300, 1 year. And even better, no charges unless you specifically choose to continue after the trial period ends.
- They have probably the best Kubernetes experiences out of all of the major cloud providers. AWS does not have direct support for k8s, and Azure tends to be a little slower to provision and not as up to date on releases.
- GCP includes Deployment Manager, a way to script installation and provisioning of resources. (Including GKE)
- Deployment Manager scripts can be connected to Google Cloud Launcher, providing a simple way to kick off installations of third party products like GitLab.
Google offers a great free trial, offering $300 of services over the span of 1 year. Even better, they will not charge you unless you specifically agree to continue past the trial phase. So there is no chance of accidental billing with straggling services that may still be running. This is much better than other free trial offers, like that of AWS where it may not always be clear what is and isn't free.
While we can start with manual trial creation, it would be even more interesting if we could automate or simplify the trial setup process as well.
Google Container Engine (GKE)
Google offers direct support for Kubernetes, through their GKE product. This is a fully productized implementation of Kubernetes running on top of their Compute Engine. Since this is a first class citizen of the GCP platform, it is much easier to get started with and use than competing platforms. For example on AWS you need to utilize third party solutions like kops or CloudFormation in order to run a k8s cluster. Even when using those, it is still prone to issues and contains unnecessary complexity.
For someone looking for a trial, GKE is the easiest place to begin and should be where we direct people unless they really need to use a competing cloud platform.
Deployment Manager is GCP's method of automating the creation and update of all components that GCP supports. This includes things like VM's, storage, DNS names, and networking but also includes support for GKE as well. These scripts are largely YAML and a scripting language (python or jinja) and can be parameterized as well to provide some methods of configuring or customizing within the larger script.
Once these have been written, you can expect to have reliable deployments on GCP as well as reliable upgrades.
As an example, here is a Deployment Manager script for deploying a GKE cluster: https://github.com/GoogleCloudPlatform/deploymentmanager-samples/tree/master/examples/v2/gke
Google Cloud Launcher
Google Cloud Launcher is a way to deploy third party products that have been templated on GCP. This can be a simple VM image like we are have today, or it can also be a fully fledged Deployment Manager script. When choosing to deploy a service, it can also prompt for some basic configuration information. For example what size hardware to run on, whether certain features should be enabled, or even perhaps an initial password.
A video which goes into more detail on this is available here: https://youtu.be/LaGpoOgGip0?t=32m58s
Note that this video is the Launcher with a deployment manager script underneath.
Enterprise Deployment on GCP
Leveraging Deployment Manager we can:
- Create a Cloud SQL DB
- Deploy GitLab, Redis using Omnibus package on GCP
- Create a GKE cluster
- Deploy GitLab Runner on GKE
- Connect GitLab to GKE cluster
Running GitLab on a VM in GCP allows more traditional management, like automated snapshots for backups, etc.
As we make progress on our cloud native charts, we can then switch to running GitLab itself within GKE as well.
As GCP continues to improve and additional features become available, we can look to extend this to an even more robust enterprise solution. The main gap would be HA, which would require gitaly to be ready for local storage and Cloud SQL HA](https://cloudplatform.googleblog.com/2017/08/Cloud-SQL-for-PostgreSQL-updated-with-new-extensions.html).