kubernetes 安装 gitlab 11.11.1

  运维

pvc

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

Deployment gitlab

apiVersion: apps/v1
kind: Deployment
metadata:
  name: gitlab
  labels:
    name: gitlab
spec:
  selector:
    matchLabels:
      name: gitlab
  template:
    metadata:
      name: gitlab
      labels:
        name: gitlab
    spec:
      containers:
      - name: gitlab
        #image: sameersbn/gitlab:11.11.1
        image: registry.cn-hangzhou.aliyuncs.com/sre_pub/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: 123456
        - name: GITLAB_ROOT_EMAIL
          value: sre@me.org
        - name: GITLAB_HOST
          value: gitlab.my.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: gitlab-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: gitlab-redis
        - name: REDIS_PORT
          value: "6379"
        - name: REDIS_PASS
          value: "123456"
        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

svc gitlab

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

LEAVE A COMMENT

Captcha Code