- 01-namespace.yaml
apiVersion: v1kind: Namespacemetadata: name: gitlab
- 02-redis.yaml
---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: redis namespace: gitlab annotations: volume.beta.kubernetes.io/storage-class: "gitops-data"spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi---kind: ServiceapiVersion: v1metadata: name: gitlab-redis namespace: gitlab labels: app: gitlab-redisspec: type: ClusterIP ports: - name: redis protocol: TCP port: 6379 targetPort: redis selector: app: gitlab-redis---kind: DeploymentapiVersion: apps/v1metadata: name: gitlab-redis namespace: gitlab labels: app: gitlab-redisspec: replicas: 1 selector: matchLabels: app: gitlab-redis template: metadata: name: gitlab-redis labels: app: gitlab-redis spec: containers: - name: gitlab-redis image: 'sameersbn/redis:4.0.9-3' ports: - name: redis containerPort: 6379 protocol: TCP resources: limits: cpu: 500m memory: 1Gi requests: cpu: 200m memory: 1Gi livenessProbe: exec: command: - redis-cli - ping initialDelaySeconds: 5 timeoutSeconds: 5 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 readinessProbe: exec: command: - redis-cli - ping initialDelaySeconds: 5 timeoutSeconds: 5 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 volumeMounts: - name: data mountPath: /var/lib/redis volumes: - name: data persistentVolumeClaim: claimName: redis
- 03-postgresql.yaml
---## PVCapiVersion: v1kind: PersistentVolumeClaimmetadata: name: pgsql namespace: gitlab annotations: volume.beta.kubernetes.io/storage-class: "gitops-data"spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi---## Servicekind: ServiceapiVersion: v1metadata: name: gitlab-postgresql namespace: gitlab labels: app: gitlab-postgresqlspec: ports: - name: postgres protocol: TCP port: 5432 targetPort: postgres selector: app: postgresql type: ClusterIP---## Deploymentkind: DeploymentapiVersion: apps/v1metadata: name: gitlab-pgsql namespace: gitlab labels: app: postgresqlspec: replicas: 1 selector: matchLabels: app: postgresql template: metadata: name: postgresql labels: app: postgresql spec: containers: - name: postgresql image: sameersbn/postgresql:12-20200524 ports: - name: postgres containerPort: 5432 env: - name: DB_USER value: gitlab - name: DB_PASS value: passwOrd - name: DB_NAME value: gitlabhq_production - name: DB_EXTENSION value: 'pg_trgm,btree_gist' resources: requests: cpu: 200m memory: 256Mi limits: cpu: 2 memory: 2Gi livenessProbe: exec: command: ["pg_isready","-h","localhost","-U","postgres"] initialDelaySeconds: 30 timeoutSeconds: 5 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 readinessProbe: exec: command: ["pg_isready","-h","localhost","-U","postgres"] initialDelaySeconds: 5 timeoutSeconds: 1 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 volumeMounts: - name: data mountPath: /var/lib/postgresql volumes: - name: data persistentVolumeClaim: claimName: pgsql
- 04-gitlab.yaml
---## PVCapiVersion: v1kind: PersistentVolumeClaimmetadata: name: gitlab namespace: gitlab annotations: volume.beta.kubernetes.io/storage-class: "gitops-data"spec: accessModes: - ReadWriteMany resources: requests: storage: 20Gi---## Servicekind: ServiceapiVersion: v1metadata: name: gitlab namespace: gitlab labels: app: gitlabspec: ports: - name: http protocol: TCP port: 80 targetPort: http - name: ssh protocol: TCP port: 22 targetPort: ssh nodePort: 30022 type: NodePort selector: app: gitlab---kind: DeploymentapiVersion: apps/v1metadata: name: gitlab namespace: gitlab labels: app: gitlabspec: replicas: 1 selector: matchLabels: app: gitlab template: metadata: name: gitlab labels: app: gitlab spec: containers: - name: gitlab image: 'sameersbn/gitlab:13.10.2' ports: - name: ssh containerPort: 22 - name: http containerPort: 80 - name: https containerPort: 443 env: - name: GITLAB_TIMEZONE value: Asia/Shanghai - name: GITLAB_SECRETS_OTP_KEY_BASE # Be used to encrypt 2FA secrets in the database. "long-and-random-alpha-numeric-string" value: long-and-random-alpha-numeric-string - name: GITLAB_SECRETS_DB_KEY_BASE # Be used to encrypt CI secret variables, as well as import credentials, in the database. value: long-and-random-alpha-numeric-string - name: GITLAB_SECRETS_SECRET_KEY_BASE # Be used for password reset links, and other 'standard' auth features. value: long-and-random-alpha-numeric-string - name: GITLAB_ROOT_PASSWORD value: admin321 - name: GITLAB_ROOT_EMAIL value: test@test.com - name: GITLAB_HOST value: 'gitlab-test.datagrand.com' - name: GITLAB_PORT value: '80' - name: GITLAB_SSH_PORT value: '30022' - name: GITLAB_NOTIFY_ON_BROKEN_BUILDS value: 'true' - name: GITLAB_NOTIFY_PUSHER value: 'false' - 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: passwOrd - name: DB_NAME value: gitlabhq_production - name: REDIS_HOST value: gitlab-redis - name: REDIS_PORT value: '6379' resources: requests: cpu: 1 memory: 1Gi limits: cpu: 2 memory: 4Gi livenessProbe: httpGet: path: / port: 80 scheme: HTTP initialDelaySeconds: 300 timeoutSeconds: 5 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 readinessProbe: httpGet: path: / port: 80 scheme: HTTP initialDelaySeconds: 5 timeoutSeconds: 30 periodSeconds: 10 successThreshold: 1 failureThreshold: 3 volumeMounts: - name: data mountPath: /home/git/data - name: localtime mountPath: /etc/localtime volumes: - name: data persistentVolumeClaim: claimName: gitlab - name: localtime hostPath: path: /etc/localtime
- 05-ingress.yaml
apiVersion: extensions/v1beta1kind: Ingressmetadata: name: gitlab namespace: gitlab annotations: kubernetes.io/ingress.class: "nginx"spec: rules: - host: gitlab-test.test.com http: paths: - backend: serviceName: gitlab servicePort: 80