Long-Term Supported Versions

    GitLab Deployment

    Description

    GitLab deployment is required in Scenario 1 (openEuler native deployment CI/CD based on GitLab CI/CD). In Scenario 2 (openEuler native development cluster managed by GitLab CI/CD), skip this step.

    Preparing the Server

    Prepare a machine running openEuler 20.03 LTS or later versions.

    Starting GitLab

    Copy the required YAML files to the /home directory and start the related pod.

    Note: The YAML files related to GitLab can be obtained from the GitLab official site.

    Example YAML files are as follows. Modify them as required.

    gitlab-redis.yaml

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: redis
      namespace: default
      labels:
        name: redis
    spec:
      selector:
        matchLabels:
          name: redis
      template:
        metadata:
          name: redis
          labels:
            name: redis
        spec:
          containers:
          - name: redis
            image: 10.35.111.11:5000/redis:latest
            imagePullPolicy: IfNotPresent
            ports:
            - name: redis
              containerPort: 6379
            volumeMounts:
            - mountPath: /var/lib/redis
              name: data
            livenessProbe:
              exec:
                command:
                - redis-cli
                - ping
              initialDelaySeconds: 30
              timeoutSeconds: 5
            readinessProbe:
              exec:
                command:
                - redis-cli
                - ping
              initialDelaySeconds: 5
              timeoutSeconds: 1
          volumes:
          - name: data
            emptyDir: {}
    
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: redis
      namespace: default
      labels:
        name: redis
    spec:
      ports:
        - name: redis
          port: 6379
          targetPort: redis
      selector:
        name: redis
    

    gitlab-postgresql.yaml

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: postgresql
      namespace: default
      labels:
        name: postgresql
    spec:
      selector:
        matchLabels:
          name: postgresql
      template:
        metadata:
          name: postgresql
          labels:
            name: postgresql
        spec:
          containers:
          - name: postgresql
            image: 10.35.111.11:5000/postgres:13.6
            imagePullPolicy: IfNotPresent
            env:
            - name: POSTGRES_HOST_AUTH_METHOD
              value: trust
            - name: DB_USER
              value: gitlab
            - name: DB_PASS
              value: passw0rd
            - name: DB_NAME
              value: gitlab_production
            - name: DB_EXTENSION
              value: pg_trgm
            ports:
            - name: postgres
              containerPort: 5432
            volumeMounts:
            - mountPath: /var/lib/postgresql
              name: data
            livenessProbe:
              exec:
                command:
                - pg_isready
                - -h
                - localhost
                - -U
                - postgres
              initialDelaySeconds: 30
              timeoutSeconds: 5
            readinessProbe:
              exec:
                command:
                - pg_isready
                - -h
                - localhost
                - -U
                - postgres
              initialDelaySeconds: 5
              timeoutSeconds: 1
          volumes:
          - name: data
            emptyDir: {}
    
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: postgresql
      namespace: default
      labels:
        name: postgresql
    spec:
      ports:
        - name: postgres
          port: 5432
          targetPort: postgres
      selector:
        name: postgresql
    

    gitlab.yaml

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: gitlab
      namespace: default
      labels:
        name: gitlab
    spec:
      selector:
        matchLabels:
          name: gitlab
      template:
        metadata:
          name: gitlab
          labels:
            name: gitlab
        spec:
          containers:
          - name: gitlab
            image: 10.35.111.11:5000/yrzr/gitlab-ce-arm64v8:14.3.2-ce.0
            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: admin321
            - name: GITLAB_ROOT_EMAIL
              value: 517554016@qq.com
            - name: GITLAB_HOST
              value: git.qikqiak.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
            livenessProbe:
              httpGet:
                path: /
                port: 80
              initialDelaySeconds: 180
              timeoutSeconds: 5
            readinessProbe:
              httpGet:
                path: /
                port: 80
              initialDelaySeconds: 5
              timeoutSeconds: 1
          volumes:
          - name: data
            emptyDir: {}
    
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: gitlab
      namespace: default
      labels:
        name: gitlab
    spec:
      ports:
        - name: http
          port: 80
          targetPort: http
          nodePort: 30852
        - name: ssh
          port: 22
          nodePort: 32353
          targetPort: ssh
      selector:
        name: gitlab
      type: NodePort
    

    Start the containers.

    kubectl apply -f gitlab-redis.yaml
    kubectl apply -f gitlab-postgresql.yaml
    kubectl apply -f gitlab.yaml
    

    Check whether the GitLab pod is set up successfully.

    kubectl get pod -A -owide
    

    Logging in to GitLab

    Log in to the GitLab Web UI. The address is the IP address and the configured port.

    The user name is root. The default password can be viewed in the password file in the container.

    kubectl exec -it gitlab-lab -n default /bin/sh
    cat /etc/gitlab/initial_root_password
    

    • After you log in, this page is displayed:

    Bug Catching

    Buggy Content

    Bug Description

    Submit As Issue

    It's a little complicated....

    I'd like to ask someone.

    PR

    Just a small problem.

    I can fix it online!

    Bug Type
    Specifications and Common Mistakes

    ● Misspellings or punctuation mistakes;

    ● Incorrect links, empty cells, or wrong formats;

    ● Chinese characters in English context;

    ● Minor inconsistencies between the UI and descriptions;

    ● Low writing fluency that does not affect understanding;

    ● Incorrect version numbers, including software package names and version numbers on the UI.

    Usability

    ● Incorrect or missing key steps;

    ● Missing prerequisites or precautions;

    ● Ambiguous figures, tables, or texts;

    ● Unclear logic, such as missing classifications, items, and steps.

    Correctness

    ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

    ● Incorrect schematic or architecture diagrams;

    ● Incorrect commands or command parameters;

    ● Incorrect code;

    ● Commands inconsistent with the functions;

    ● Wrong screenshots.

    Risk Warnings

    ● Lack of risk warnings for operations that may damage the system or important data.

    Content Compliance

    ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

    ● Copyright infringement.

    How satisfied are you with this document

    Not satisfied at all
    Very satisfied
    Submit
    Click to create an issue. An issue template will be automatically generated based on your feedback.
    Bug Catching
    编组 3备份