Skip to content

Latest commit

 

History

History
163 lines (136 loc) · 4.08 KB

File metadata and controls

163 lines (136 loc) · 4.08 KB

Setting up gitlab from scratch

Preparing to use the Gitlab Chart

We found some decent documentation over

https://gitlab.com/charts/gitlab/blob/master/doc/installation/README.md

and ended up at:

https://gitlab.com/charts/gitlab/blob/master/doc/cloud/gke.md#scripted-cluster-creation-on-gke

Helm

curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.10.0-linux-amd64.tar.gz | tar xvz -f - --strip-components 1 -C /usr/local/bin

The Source

git clone git@gitlab.com:charts/gitlab.git ~/gitlab

GKE Setup Script

You’ll need to customize this with an project of your own.

cd ~/gitlab
export PROJECT=recodenz
./scripts/gke_bootstrap_script.sh up

Grab the external IP

export PROJECT=recodenz
export CLUSTER_NAME=gitlab-cluster
export REGION=us-central1
gcloud compute addresses create ${CLUSTER_NAME}-external-ip --region $REGION --project $PROJECT
export PROJECT=recodenz
export CLUSTER_NAME=gitlab-cluster
export REGION=us-central1
gcloud compute addresses describe ${CLUSTER_NAME}-external-ip --region $REGION --project $PROJECT --format='value(address)'

Deploy Using the Gitlab Chart

Get Chart for gitlab

helm repo add gitlab https://charts.gitlab.io/
helm repo update

Configure the Chart

# Global chart properties
global:
  hosts:
    domain: recode.ii.nz
    externalIP: 35.193.219.220
  # Outgoing email server settings
  smtp:
    enabled: true
    address: smtp.mailgun.org
    port: 2525
    user_name: "postmaster@recode.ii.nz"
    password:
      secret: "FOOBARBAZ"
      key: password
    #domain: recode.ii.nz
    authentication: "plain"
    starttls_auto: false
    openssl_verify_mode: "peer"
# Email persona used in email sent by GitLab
  email:
   from: 'gitlab@recode.ii.nz'
   display_name: GitLab@recode.ii.nz
   reply_to: 'hh@ii.coop'
   subject_suffix: ' | ii.nz'
  time_zone: NZST
  timeout: 600
certmanager-issuer:
  email: recode@ii.nz
gitlab:
  migrations:
    image:
      repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-rails-ce
  sidekiq:
    image:
      repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-sidekiq-ce
  sidekiq:
    image:
     repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-unicorn-ce
  sidekiq:
    image:
      repository: registry.gitlab.com/gitlab-org/build/cng/gitlab-workhorse-ce
  omniauth:
    enabled: yes
    autoSignInWithProvider: 
    allowSingleSignOn: ['github', 'google_oauth2']
    blockAutoCreatedUsers: false
    providers:
      - key: 'github'
        app_id: "babeface"
        app_secret: "deadbeef"
      - key: 'google_oauth2'
        app_id: "babeface"
        app_secret: "deadbeef"
    syncProfileAttributes: ['email']

Deploy Gitlab on Kubernetes

helm upgrade --install gitlab gitlab/gitlab --values ../recode.gitlab.yaml

Monitor the Progress of your gitlab installation

See how the run

helm status gitlab

Get root password

kubectl get secret gitlab-gitlab-initial-root-password -ojsonpath={.data.password} | base64 --decode ; echo

email

SMTP OUTGOING

Footnotes