apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: 'my-gitlab'
  name: 'my-gitlab'
spec:
  replicas: 1
  selector:
    matchLabels:
      app: 'my-gitlab'
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: 'my-gitlab'
    spec:
      containers:
        - name: 'my-gitlab'
          env:
            - name: GITLAB_OMNIBUS_CONFIG
              value: >-
                external_url
                'http://my-gitlab-my-project-name.apps.ir-thr-at1.arvan.run';
                gitlab_rails['lfs_enabled'] = true; postgresql['enable'] =
                false; prometheus_monitoring['enable'] = false;
                redis['enable'] = false; nginx['client_max_body_size'] =
                '300m'; gitlab_rails['db_username'] = 'root';
                gitlab_rails['db_password'] = 'STRONGPOSTGRESPASS';
                gitlab_rails['db_host'] = 'my-gitlabpostgres-svc';
                gitlab_rails['db_port'] = '5432';
                gitlab_rails['db_database'] = 'my-gitlab';
                gitlab_rails['db_adapter'] = 'postgresql';
                gitlab_rails['db_encoding'] = 'utf8';
                gitlab_rails['redis_host'] = 'my-gitlabredis-svc';
                gitlab_rails['redis_port'] = '6379';
          image: 'gitlab/gitlab-ce:13.2.2-ce.0'
          ports:
            - containerPort: 80
              protocol: TCP
          resources:
            limits:
              cpu: '4'
              ephemeral-storage: '4G'
              memory: '8G'
            requests:
              cpu: '4'
              ephemeral-storage: '4G'
              memory: '8G'
          volumeMounts:
            - name: 'my-gitlab-base'
              mountPath: /var/opt/gitlab
            - name: 'my-gitlab-log'
              mountPath: /var/log/gitlab
            - name: 'my-gitlab-etc'
              mountPath: /etc/gitlab
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      volumes:
        - name: 'my-gitlab-base'
          persistentVolumeClaim:
            claimName: 'my-gitlab-base'
        - name: 'my-gitlab-log'
          persistentVolumeClaim:
            claimName: 'my-gitlab-log'
        - name: 'my-gitlab-etc'
          persistentVolumeClaim:
            claimName: 'my-gitlab-etc'
