kubernetes 安装 gitlab 11.11.1

  运维

gitlab in kubernetes

PersistentVolumeClaim

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gitlab-home-pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "100Gi"
  volumeName: 
  storageClassName: nfs
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gitlab-logs-pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "100Gi"
  volumeName: 
  storageClassName: nfs

Deployment

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: gitlab
  namespace: test
  labels:
    name: gitlab
spec:
  template:
    metadata:
      name: gitlab
      labels:
        name: gitlab
    spec:
      containers:
      - name: gitlab
        image: sameersbn/gitlab:11.11.1
        imagePullPolicy: IfNotPresent
        env:
        - name: TZ
          value: Asia/Shanghai
        - name: GITLAB_TIMEZONE
          value: Beijing
        - name: GITLAB_SECRETS_DB_KEY_BASE
          value: long-and-random-alpha-numeric-string
        - name: GITLAB_SECRETS_SECRET_KEY_BASE
          value: long-and-random-alpha-numeric-string
        - name: GITLAB_SECRETS_OTP_KEY_BASE
          value: long-and-random-alpha-numeric-string
        - name: GITLAB_ROOT_PASSWORD
          value: 1qaz@WSX
        - name: GITLAB_ROOT_EMAIL
          value: sre@yangqiao.org
        - name: GITLAB_HOST
          value: gitlab.test.com
        - name: GITLAB_PORT
          value: "80"
        - name: GITLAB_SSH_PORT
          value: "22"
        - 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: postgresql
        - name: DB_PORT
          value: "5432"
        - name: DB_USER
          value: gitlab
        - name: DB_PASS
          value: passw0rd
        - name: DB_NAME
          value: gitlab_production
        - name: REDIS_HOST
          value: redis
        - name: REDIS_PORT
          value: "6379"
        ports:
        - name: http
          containerPort: 80
        - name: ssh
          containerPort: 22
        volumeMounts:
        - mountPath: /home/git/data
          name: data
        - mountPath: /var/log/gitlab
          name: log
        livenessProbe:
          httpGet:
            path: /
            port: 80
          initialDelaySeconds: 180
          timeoutSeconds: 5
        readinessProbe:
          httpGet:
            path: /
            port: 80
          initialDelaySeconds: 5
          timeoutSeconds: 1
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: gitlab-home-pvc
      - name: log
        persistentVolumeClaim:
          claimName: gitlab-logs-pvc

Service

apiVersion: v1
kind: Service
metadata:
  name: gitlab
  namespace: test
  labels:
    name: gitlab
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      nodePort: 30005
      targetPort: http
    - name: ssh
      port: 22
      targetPort: ssh
  selector:
    name: gitlab

One Reply to “kubernetes 安装 gitlab 11.11.1”

LEAVE A COMMENT

发表评论前,请选对水果【Apple=苹果、Banana=香蕉、Pineapple=菠萝、Grapes=葡萄】 Banana...