Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Add gitlab-ce chart to stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
gtaylor committed Nov 6, 2016
1 parent 3e1b7cf commit 5f001e5
Show file tree
Hide file tree
Showing 14 changed files with 517 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stable/gitlab-ce/.helmignore
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
16 changes: 16 additions & 0 deletions stable/gitlab-ce/Chart.yaml
@@ -0,0 +1,16 @@
name: gitlab-ce
version: 0.1.0
description: GitLab Community Edition
keywords:
- git
- ci
- deploy
- issue tracker
- code review
- wiki
sources:
- https://hub.docker.com/r/gitlab/gitlab-ce/
- https://docs.gitlab.com/omnibus/
maintainers:
- name: Greg Taylor
email: gtaylor@gc-taylor.com
67 changes: 67 additions & 0 deletions stable/gitlab-ce/README.md
@@ -0,0 +1,67 @@
# GitLab Community Edition

[GitLab Community Edition](https://about.gitlab.com/) is an application to code, test, and deploy code together. It provides Git repository management with fine grained access controls, code reviews, issue tracking, activity feeds, wikis, and continuous integration.

## Introduction

This chart stands up a GitLab Community Edition install. This includes:

- A [GitLab Omnibus](https://docs.gitlab.com/omnibus/) Pod
- Redis
- Postgresql

## Prerequisites

- _At least_ 3 GB of RAM available on your cluster, in chunks of 1 GB
- Kubernetes 1.4+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure
- The ability to point a DNS entry or URL at your GitLab install

## Installing the Chart

To install the chart with the release name `my-release` run:

```bash
$ helm install --name my-release \
--set externalUrl=http://your-domain.com/ stable/gitlab-ce
```

Note that you _must_ pass in externalUrl, or you'll end up with a non-functioning release.

> **Tip**: List all releases using `helm list`
## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```bash
$ helm delete my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

Refer to [values.yaml](values.yaml) for the full run-down on defaults. These are a mixture of Kubernetes and GitLab-related directives.

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```bash
$ helm install --name my-release \
--set externalUrl=http://your-domain.com/,gitlabRootPassword=pass1234 \
stable/gitlab-ce
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```bash
$ helm install --name my-release -f values.yaml stable/gitlab-ce
```

> **Tip**: You can use the default [values.yaml](values.yaml)
## Persistence

By default, persistence of GitLab data and configuration happens using PVCs. If you know that you'll need a larger amount of space, make _sure_ to look at the `persistence` section in [values.yaml](values.yaml).

> *"If you disable persistence, the contents of your volume(s) will only last as long as the Pod does. Upgrading or changing certain settings may lead to data loss without persistence."*
9 changes: 9 additions & 0 deletions stable/gitlab-ce/requirements.lock
@@ -0,0 +1,9 @@
dependencies:
- name: redis
repository: http://storage.googleapis.com/kubernetes-charts
version: 0.4.1
- name: postgresql
repository: http://storage.googleapis.com/kubernetes-charts
version: 0.1.1
digest: sha256:15072cb8756660047cf5f13e61d29c810e796e91c7a9e9a56927d7430de34226
generated: 2016-11-04T23:15:05.755476969-07:00
7 changes: 7 additions & 0 deletions stable/gitlab-ce/requirements.yaml
@@ -0,0 +1,7 @@
dependencies:
- name: redis
version: 0.4.1
repository: http://storage.googleapis.com/kubernetes-charts
- name: postgresql
version: 0.1.1
repository: http://storage.googleapis.com/kubernetes-charts
53 changes: 53 additions & 0 deletions stable/gitlab-ce/templates/NOTES.txt
@@ -0,0 +1,53 @@
{{- if default "" .Values.externalUrl }}
1. Get your GitLab URL by running:

{{- if contains "NodePort" .Values.serviceType }}

export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP/

{{- else if contains "LoadBalancer" .Values.serviceType }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc -w {{ template "fullname" . }}'

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP/
{{- else if contains "ClusterIP" .Values.serviceType }}

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8080:80
{{- end }}

{{- if default "" .Values.gitlabRootPassword }}

2. Login as the root user:

Username: admin
Password: {{ .Values.gitlabRootPassword }}
{{ else }}

2. Set your admin user's password on your first visit to your install. Then
login as:

Username: admin
Password: <whatever value you entered>
{{- end }}

3. Point a DNS entry at your install to ensure that your specified
external URL is reachable:

{{ default "UNSPECIFIED" .Values.externalUrl }}

{{- else -}}
##############################################################################
## ERROR: You did not specify an externalUrl in your 'helm install' call. ##
##############################################################################

This deployment will be incomplete until you provide the URL that your
GitLab install will be reachable to your users under:

helm upgrade {{ .Release.Name }} \
--set externalUrl=http://your-domain.com stable/gitlab-ce
{{- end -}}
32 changes: 32 additions & 0 deletions stable/gitlab-ce/templates/_helpers.tpl
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- end -}}

{{/*
Create a default fully qualified postgresql name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "postgresql.fullname" -}}
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 24 -}}
{{- end -}}

{{/*
Create a default fully qualified redis name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "redis.fullname" -}}
{{- printf "%s-%s" .Release.Name "redis" | trunc 24 -}}
{{- end -}}
33 changes: 33 additions & 0 deletions stable/gitlab-ce/templates/configmap.yaml
@@ -0,0 +1,33 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
## This is used by GitLab Omnibus as the primary means of configuration.
## ref: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
##
gitlab_omnibus_config: |
external_url ENV['EXTERNAL_URL'];
root_pass = ENV['GITLAB_ROOT_PASSWORD'];
gitlab_rails['initial_root_password'] = root_pass unless root_pass.to_s == '';
postgresql['enable'] = false;
gitlab_rails['db_host'] = ENV['DB_HOST'];
gitlab_rails['db_password'] = ENV['DB_PASSWORD'];
gitlab_rails['db_username'] = ENV['DB_USER'];
gitlab_rails['db_database'] = ENV['DB_DATABASE'];
redis['enable'] = false;
gitlab_rails['redis_host'] = ENV['REDIS_HOST'];
gitlab_rails['redis_password'] = ENV['REDIS_PASSWORD'];
unicorn['worker_processes'] = 2;
manage_accounts['enable'] = true;
manage_storage_directories['manage_etc'] = false;
gitlab_shell['auth_file'] = '/gitlab-data/ssh/authorized_keys';
git_data_dir '/gitlab-data/git-data';
gitlab_rails['shared_path'] = '/gitlab-data/shared';
gitlab_rails['uploads_directory'] = '/gitlab-data/uploads';
gitlab_ci['builds_directory'] = '/gitlab-data/builds';
15 changes: 15 additions & 0 deletions stable/gitlab-ce/templates/data-pvc.yaml
@@ -0,0 +1,15 @@
{{- if .Values.persistence.gitlabData.enabled }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-data
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.gitlabData.storageClass | quote }}
spec:
accessModes:
- {{ .Values.persistence.gitlabData.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.gitlabData.size | quote }}
{{- end }}
118 changes: 118 additions & 0 deletions stable/gitlab-ce/templates/deployment.yaml
@@ -0,0 +1,118 @@
{{- if default "" .Values.externalUrl }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
replicas: 1
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: {{ template "fullname" . }}
image: {{ .Values.image }}
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
env:
## General GitLab Configs
##
# This is a free-form env var that GitLab Omnibus uses to configure
# everything. We're passing this in from a configmap and pulling some
# of the values from the env vars defined below. This is done to
# avoid leaving secrets visible in kubectl.
- name: GITLAB_OMNIBUS_CONFIG
valueFrom:
configMapKeyRef:
name: {{ template "fullname" . }}
key: gitlab_omnibus_config
- name: GITLAB_ROOT_PASSWORD
{{- if default "" .Values.gitlabRootPassword }}
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: gitlab-root-password
{{ end }}
- name: EXTERNAL_URL
value: {{ default "" .Values.externalUrl | quote }}
## DB configuration
##
- name: DB_HOST
value: {{ template "postgresql.fullname" . }}
- name: DB_USER
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: db-user
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: db-password
- name: DB_DATABASE
value: {{ .Values.postgresql.postgresDatabase | quote }}
## Redis configuration
##
- name: REDIS_HOST
value: {{ template "redis.fullname" . }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: redis-password
ports:
- name: ssh
containerPort: 22
- name: http
containerPort: 80
- name: https
containerPort: 443
livenessProbe:
httpGet:
path: /help
port: http
# This pod takes a very long time to start up. Be cautious when
# lowering this value to avoid Pod death during startup.
initialDelaySeconds: 200
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 10
readinessProbe:
httpGet:
path: /help
port: http
initialDelaySeconds: 30
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
volumeMounts:
- name: gitlab-etc
mountPath: /etc/gitlab
- name: gitlab-data
mountPath: /gitlab-data
resources:
{{ toYaml .Values.resources | indent 10 }}
volumes:
- name: gitlab-etc
{{- if .Values.persistence.gitlabEtc.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}-etc
{{- else }}
emptyDir: {}
{{- end }}
- name: gitlab-data
{{- if .Values.persistence.gitlabData.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}-data
{{- else }}
emptyDir: {}
{{- end }}
{{ else }}
{{ end }}
15 changes: 15 additions & 0 deletions stable/gitlab-ce/templates/etc-pvc.yaml
@@ -0,0 +1,15 @@
{{- if .Values.persistence.gitlabEtc.enabled }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-etc
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.gitlabEtc.storageClass | quote }}
spec:
accessModes:
- {{ .Values.persistence.gitlabEtc.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.gitlabEtc.size | quote }}
{{- end }}

0 comments on commit 5f001e5

Please sign in to comment.