<commit_before>---
title: Deploying a Containerized Gitlab Instance with Kubernetes
author: jbrooks
date: 2015-01-15 23:42:33 UTC
tags: docker, kubernetes, centos, gitlab
published: false
comments: true
---

Back in November, I wrote about how to [try out Kubernetes](http://www.projectatomic.io/blog/2014/11/testing-kubernetes-with-an-atomic-host/), the open source system for managing containerized applications across multiple hosts, using Atomic Hosts. In that post, I walked through a deployment of the Kubernetes project's multicontainer "Hello World" application. 

This time, I thought I'd explore running a more real-world application on Kubernetes, while looking into a few alternate methods of spinning up a Kubernetes cluster.

For the application, I picked Gitlab, an open source code collaboration platform that resembles and works like the popular Github service. I run a Gitlab instance internally here at work, and I wanted to explore moving that application from its current, virtual machine-based home, toward a shiny new containerized future.

READMORE

### Gitlab, Dockerized
The Gitlab project [provides a Dockerfile](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/docker) for creating a containerized "Omnibus" instance of the application that smushes together a Redis key-value store, Postgres database, and Nginx web server into a single container. However, since Docker best practices dictate that individual application elements be deployed as separate containers, I turned to a [multi-container installation option](https://github.com/sameersbn/docker-gitlab) created by community member [<NAME>](https://twitter.com/sameersbn).

I set out first to convert Sameer's implementation from Ubuntu to [CentOS](https://github.com/jasonbrooks/docker-gitlab), which wasn't too terribly complicated and mostly involved translating Debian-style package names to their RPM-world equivalents. The trickiest bits of the conversion involved editing the bash scripts used to install Gitlab from source and perform configuration chores in the Gitlab container. Looking ahead, I'm interested in taking a look at Ansible as an alternative to these somewhat-ungainly bash scripts.

For the Redis and Postgres containers required by Gitlab, I simply reached for a pair of off-the-shelf Dockerfiles provided by the CentOS project in its [CentOS-Dockerfiles](https://github.com/CentOS/CentOS-Dockerfiles) repository.

### Assembling a Kubernetes Cluster

Once I had a Dockerized, CentOS-based set of containers to work with, I turned to bringing up a Kubernetes cluster. The [Ansible+Atomic method](http://www.projectatomic.io/blog/2014/11/testing-kubernetes-with-an-atomic-host/) I wrote about last time still works fine, but I wanted to explore a couple other Kubernetes deployment options.

I looked into three new methods for turning up a Kubernetes cluster: [Vagrant](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/vagrant.md), [OpenStack Heat](https://github.com/larsks/heat-kubernetes), and Google's [Container Engine](https://cloud.google.com/container-engine/).<commit_msg>Jason's post with a few style corrections in the headers.<commit_after>---
title: Deploying a Containerized Gitlab Instance with Kubernetes
author: jbrooks
date: 2015-01-15 23:42:33 UTC
tags: 
- docker 
- kubernetes 
- centos
- gitlab
categories:
- Blog
published: true
comments: true
---

Back in November, I wrote about how to [try out Kubernetes](http://www.projectatomic.io/blog/2014/11/testing-kubernetes-with-an-atomic-host/), the open source system for managing containerized applications across multiple hosts, using Atomic Hosts. In that post, I walked through a deployment of the Kubernetes project's multicontainer "Hello World" application. 

This time, I thought I'd explore running a more real-world application on Kubernetes, while looking into a few alternate methods of spinning up a Kubernetes cluster.

For the application, I picked Gitlab, an open source code collaboration platform that resembles and works like the popular Github service. I run a Gitlab instance internally here at work, and I wanted to explore moving that application from its current, virtual machine-based home, toward a shiny new containerized future.

READMORE

### Gitlab, Dockerized
The Gitlab project [provides a Dockerfile](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/docker) for creating a containerized "Omnibus" instance of the application that smushes together a Redis key-value store, Postgres database, and Nginx web server into a single container. However, since Docker best practices dictate that individual application elements be deployed as separate containers, I turned to a [multi-container installation option](https://github.com/sameersbn/docker-gitlab) created by community member [<NAME>](https://twitter.com/sameersbn).

I set out first to convert Sameer's implementation from Ubuntu to [CentOS](https://github.com/jasonbrooks/docker-gitlab), which wasn't too terribly complicated and mostly involved translating Debian-style package names to their RPM-world equivalents. The trickiest bits of the conversion involved editing the bash scripts used to install Gitlab from source and perform configuration chores in the Gitlab container. Looking ahead, I'm interested in taking a look at Ansible as an alternative to these somewhat-ungainly bash scripts.

For the Redis and Postgres containers required by Gitlab, I simply reached for a pair of off-the-shelf Dockerfiles provided by the CentOS project in its [CentOS-Dockerfiles](https://github.com/CentOS/CentOS-Dockerfiles) repository.

### Assembling a Kubernetes Cluster

Once I had a Dockerized, CentOS-based set of containers to work with, I turned to bringing up a Kubernetes cluster. The [Ansible+Atomic method](http://www.projectatomic.io/blog/2014/11/testing-kubernetes-with-an-atomic-host/) I wrote about last time still works fine, but I wanted to explore a couple other Kubernetes deployment options.

I looked into three new methods for turning up a Kubernetes cluster: [Vagrant](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/vagrant.md), [OpenStack Heat](https://github.com/larsks/heat-kubernetes), and Google's [Container Engine](https://cloud.google.com/container-engine/).
{'fraction_non_alphanumeric': 0.07237464522232734, 'fraction_numerical': 0.008199306212551246, 'mean_word_length': 5.206457925636008, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 16, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6652012', 'n_tokens_mistral': 1695, 'n_tokens_neox': 1546, 'n_words': 742}