Skip to content

Instantly share code, notes, and snippets.

@h3nryza
Last active August 30, 2018 05:44
Show Gist options
  • Save h3nryza/1f5c6c022c02d641aaf2056a69f3c606 to your computer and use it in GitHub Desktop.
Save h3nryza/1f5c6c022c02d641aaf2056a69f3c606 to your computer and use it in GitHub Desktop.
Creating a simple Gitlab installation on a local Kubernetes installation
---
kind: Namespace
apiVersion: v1
metadata:
name: gitlab
labels:
name: gitlab
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: gitlab-home
labels:
type: local
namespace: gitlab
spec:
storageClassName: slow
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /mnt/disks/gitlab
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitlab-home
namespace: gitlab
spec:
accessModes:
- ReadWriteOnce
storageClassName: slow
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitlab
labels:
app: gitlab
namespace: gitlab
spec:
replicas: 1
selector:
matchLabels:
app: gitlab
template:
metadata:
labels:
app: gitlab
spec:
volumes:
- name: gitlab-home
persistentVolumeClaim:
claimName: gitlab-home
containers:
- name: gitlab
image: gitlab/gitlab-ce
imagePullPolicy: Always
ports:
- containerPort: 80
- containerPort: 443
- containerPort: 22
volumeMounts:
- mountPath: /etc/gitlab
name: gitlab-home
---
apiVersion: v1
kind: Service
metadata:
labels:
app: gitlab
name: gitlab
namespace: gitlab
spec:
ports:
- name: gitlab-http
port: 80
protocol: TCP
targetPort: 80
- name: gitlab-https
port: 443
protocol: TCP
targetPort: 443
- name: gitlab-sshac
port: 22
protocol: TCP
targetPort: 22
selector:
app: gitlab
type: NodePort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment