Skip to content

Commit

Permalink
gitlab deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Feb 3, 2017
1 parent 53c3fd7 commit 73eb9a6
Show file tree
Hide file tree
Showing 12 changed files with 388 additions and 0 deletions.
1 change: 1 addition & 0 deletions gitlab/ci
Submodule ci added at 5974e2
27 changes: 27 additions & 0 deletions gitlab/gitlab-runner/gitlab-runner-docker-configmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: gitlab-runner-docker
namespace: gitlab
data:
config.toml: |
concurrent = 4
check_interval = 1
[[runners]]
name = "gitlab-docker-runner"
url = "http://gitlab.gitlab/ci"
token = "a2c668d104311cac37c5615701f9e9"
executor = "docker"
[runners.docker]
tls_verify = false
image = "python:3.5"
privileged = true
disable_cache = false
volumes = ["/cache"]
[runners.cache]
Type = "s3"
ServerAddress = "http://minio.gitlab/"
AccessKey = "NAQDF9PGV6IN6OUA1AWQ"
SecretKey = "aqaDEnG1bMHJ9y4L3KjstZzMcG9d7vRgSJg28B1X"
BucketName = "runner"
37 changes: 37 additions & 0 deletions gitlab/gitlab-runner/gitlab-runner-docker-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gitlab-runner-docker
namespace: gitlab
spec:
replicas: 1
template:
metadata:
labels:
name: docker-runner
app: gitlab-runner
spec:
containers:
- name: gitlab-runner-docker
image: gitlab/gitlab-runner:v1.8.0
imagePullPolicy: Always
resources:
limits:
memory: 500Mi
cpu: 600m
requests:
memory: 500Mi
cpu: 600m
volumeMounts:
- name: config
mountPath: /etc/gitlab-runner
- name: var-run-docker-sock
mountPath: /var/run/docker.sock
volumes:
- name: var-run-docker-sock
hostPath:
path: /var/run/docker.sock
- name: config
configMap:
name: gitlab-runner-docker

4 changes: 4 additions & 0 deletions gitlab/gitlab/_gitlab-namespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: Namespace
apiVersion: v1
metadata:
name: gitlab
128 changes: 128 additions & 0 deletions gitlab/gitlab/gitlab-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gitlab
namespace: gitlab
spec:
replicas: 1
template:
metadata:
labels:
name: gitlab
app: gitlab
spec:
containers:
- name: gitlab
image: sameersbn/gitlab:8.12.7
imagePullPolicy: Always
env:
- name: TZ
value: Europe/Stockholm
- name: GITLAB_TIMEZONE
value: Stockholm
- name: DEBUG
value: "false"

- name: GITLAB_SECRETS_DB_KEY_BASE
value: P26qS5+Csz50Dkd0DLM2oN9owVBFg0PB
- name: GITLAB_SECRETS_SECRET_KEY_BASE
value: KVaMTKLAIElEp0s4L02c1O9JCP0Rfapb
- name: GITLAB_SECRETS_OTP_KEY_BASE
value: nXJJ358Qnci0yF9qpAsLrF2vImaoFR03

- name: GITLAB_ROOT_PASSWORD
value: root
- name: GITLAB_ROOT_EMAIL
value: root@example.com

- name: GITLAB_HOST
value: git.example.com
- name: GITLAB_PORT
value: "80"
- name: GITLAB_SSH_HOST
value: "ssh-git.example.com"
- name: GITLAB_SSH_PORT
value: "1022"

- name: GITLAB_NOTIFY_ON_BROKEN_BUILDS
value: "true"
- name: GITLAB_NOTIFY_PUSHER
value: "false"

- name: GITLAB_BACKUP_SCHEDULE
value: daily
- name: GITLAB_BACKUP_TIME
value: 01:00

- name: DB_TYPE
value: postgres
- name: DB_HOST
value: gitlab-postgresql
- name: DB_PORT
value: "5432"
- name: DB_USER
value: gitlab
- name: DB_PASS
value: +BP52QIxpT/flVCMpL3KXA==
- name: DB_NAME
value: gitlab_production

- name: REDIS_HOST
value: gitlab-redis
- name: REDIS_PORT
value: "6379"

- name: SMTP_ENABLED
value: "false"
- name: SMTP_DOMAIN
value: ""
- name: SMTP_HOST
value: ""
- name: SMTP_PORT
value: ""
- name: SMTP_USER
value: ""
- name: SMTP_PASS
value: ""
- name: SMTP_STARTTLS
value: "true"
- name: SMTP_AUTHENTICATION
value: login

- name: IMAP_ENABLED
value: "false"
- name: IMAP_HOST
value: imap.gmail.com
- name: IMAP_PORT
value: "993"
- name: IMAP_USER
value: mailer@example.com
- name: IMAP_PASS
value: password
- name: IMAP_SSL
value: "true"
- name: IMAP_STARTTLS
value: "false"
ports:
- name: http
containerPort: 80
- name: ssh
containerPort: 22
volumeMounts:
- mountPath: /home/git/data
name: data
livenessProbe:
httpGet:
path: /users/sign_in
port: 80
initialDelaySeconds: 180
timeoutSeconds: 15
readinessProbe:
httpGet:
path: /users/sign_in
port: 80
initialDelaySeconds: 15
timeoutSeconds: 1
volumes:
- name: data
emptyDir: {}
20 changes: 20 additions & 0 deletions gitlab/gitlab/gitlab-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: gitlab
namespace: gitlab
labels:
name: gitlab
spec:
type: NodePort
selector:
name: gitlab
ports:
- name: http
port: 80
nodePort: 30088
targetPort: http
- name: ssh
port: 1022
nodePort: 30089
targetPort: ssh
54 changes: 54 additions & 0 deletions gitlab/gitlab/postgresql-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gitlab-postgresql
namespace: gitlab
spec:
replicas: 1
template:
metadata:
labels:
name: gitlab-postgresql
spec:
containers:
- name: postgresql
image: sameersbn/postgresql:9.5-3
imagePullPolicy: Always
env:
- name: DB_USER
value: gitlab
- name: DB_PASS
value: +BP52QIxpT/flVCMpL3KXA==
- name: DB_NAME
value: gitlab_production
- name: DB_EXTENSION
value: pg_trgm
ports:
- name: postgres
containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql
name: data
livenessProbe:
exec:
command:
- pg_isready
- -h
- localhost
- -U
- postgres
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
exec:
command:
- pg_isready
- -h
- localhost
- -U
- postgres
initialDelaySeconds: 5
timeoutSeconds: 1
volumes:
- name: data
emptyDir: {}
14 changes: 14 additions & 0 deletions gitlab/gitlab/postgresql-svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: gitlab-postgresql
namespace: gitlab
labels:
name: gitlab-postgresql
spec:
ports:
- name: postgres
port: 5432
targetPort: postgres
selector:
name: gitlab-postgresql
38 changes: 38 additions & 0 deletions gitlab/gitlab/redis-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gitlab-redis
namespace: gitlab
spec:
replicas: 1
template:
metadata:
labels:
name: gitlab-redis
spec:
containers:
- name: redis
image: redis:3.2.4
ports:
- name: redis
containerPort: 6379
volumeMounts:
- mountPath: /var/lib/redis
name: data
livenessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 5
timeoutSeconds: 1
volumes:
- name: data
emptyDir: {}
14 changes: 14 additions & 0 deletions gitlab/gitlab/redis-svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: gitlab-redis
namespace: gitlab
labels:
name: gitlab-redis
spec:
selector:
name: gitlab-redis
ports:
- name: redis
port: 6379
targetPort: redis
36 changes: 36 additions & 0 deletions gitlab/minio/minio-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: minio
namespace: gitlab
spec:
replicas: 1
template:
metadata:
labels:
name: minio
app: minio
spec:
containers:
- name: minio
image: minio/minio
args:
- server
- /export"
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: data-store
mountPath: /export
ports:
- containerPort: 9000
name: http
protocol: TCP
volumes:
- name: data-store
emptyDir: {}
15 changes: 15 additions & 0 deletions gitlab/minio/minio-svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: minio
namespace: gitlab
labels:
name: minio
app: minio
spec:
selector:
name: minio
ports:
- name: http
port: 9000
protocol: TCP

0 comments on commit 73eb9a6

Please sign in to comment.