Setup a private and highly available Gitlab server with Oracle Kubernetes in under 5 minutes

Assumes you have a working and fully functional Oracle Kubernetes Engine(OKE). If you want to setup OKE, refer this article


Functional OKE Cluster — Oracle Kubernetes Engine

Install OCI Flex Volume Provisioners and Drivers

The flex-volume provisioners allow Kubernetes to be infrastructure aware and automatically create persistent volume claims with this storage class and Oracle Cloud takes care of spinning up the necessary infrastructure underneath and attaching them to appropriate Worker Nodes as needed.

Create a config.yaml from the directory you are running the installation commands

Copy the kubeconfig file of your cluster and rename the file as kubeconfig

Run the following commands

Install Gitlab through Helm

  1. Make a separate directory for the helm chart
  2. Navigate to directory and execute
helm repo add gitlab https://charts.gitlab.io/ 
helm repo update
helm fetch stable/gitlab-ce
tar -xvzf gitlab-ce-<version>
cd gitlab-ce-<version>
vim values.yaml

Change values based on this values.yaml file

Then run the command

helm install --namespace my-gitlab-namespace --name gitlab stable/gitlab-ce -f values.yaml 

Voila you have your Gitlab instance ready

NAME:   gitlab
LAST DEPLOYED: Thu Nov 8 13:53:00 2018
NAMESPACE: mygitlab
STATUS: DEPLOYED
RESOURCES:
==> v1/Secret
NAME AGE
gitlab-postgresql 2s
gitlab-redis 2s
gitlab-gitlab-ce 2s
==> v1/ConfigMap
gitlab-gitlab-ce 2s
==> v1/PersistentVolumeClaim
gitlab-postgresql 2s
gitlab-redis 2s
gitlab-gitlab-ce-data 2s
gitlab-gitlab-ce-etc 2s
==> v1/Service
gitlab-postgresql 2s
gitlab-redis 2s
gitlab-gitlab-ce 2s
==> v1beta1/Deployment
gitlab-postgresql 2s
gitlab-redis 2s
gitlab-gitlab-ce 2s
==> v1/Pod(related)
NAME                                READY  STATUS   RESTARTS  AGE
gitlab-postgresql-787d487c89-b6ffs 0/1 Pending 0 2s
gitlab-redis-6fd4bb6fc6-ftjcd 0/1 Pending 0 2s
gitlab-gitlab-ce-8689967b95-fd7zp 0/1 Pending 0 2s
NOTES:
##############################################################################
This chart has been deprecated in favor of the official GitLab chart:
http://docs.gitlab.com/ce/install/kubernetes/gitlab_omnibus.html
##############################################################################
1. Get your GitLab URL by running:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc -w gitlab-gitlab-ce'
export SERVICE_IP=$(kubectl get svc --namespace mygitlab gitlab-gitlab-ce -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP/
2. Set your admin user's password on your first visit to your install. Then
login as:
Username: root
Password: <whatever value you entered>
3. Point a DNS entry at your install to ensure that your specified
external URL is reachable:
http://gitlab.vamsiramakrishnan.com/