Cloud Native 4 min read

GitLab Installation and Port Configuration on a Kubernetes Master

This guide walks through installing required tools, configuring Postfix, adding the GitLab repository, installing GitLab CE on a Kubernetes master, adjusting default ports in GitLab’s configuration files, reloading the setup, and accessing the service via a web browser.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
GitLab Installation and Port Configuration on a Kubernetes Master

Install the necessary utilities on the Kubernetes master:

yum install curl policycoreutils openssh-server openssh-clients postfix -y

Restart Postfix and configure it to listen on all interfaces: systemctl restart postfix Edit /etc/postfix/main.cf and replace inet_interfaces = localhost with inet_interfaces = all.

Add the GitLab CE repository by creating /etc/yum.repos.d/gitlab-ce.repo with the following content:

[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

Refresh the repository cache and install GitLab CE:

yum makecache
yum -y install gitlab-ce

If the default ports 80 and 8080 are already in use, modify GitLab’s port settings. Edit /etc/gitlab/gitlab.rb and change: #unicorn['port'] = 8080 to

unicorn['port'] = 8070
#nginx['listen_port'] = nil

to nginx['listen_port'] = 8090 Update the Unicorn configuration file /var/opt/gitlab/gitlab-rails/etc/unicorn.rb: #listen "127.0.0.1:8080", :tcp_nopush => true becomes listen "127.0.0.1:8070", :tcp_nopush => true Adjust the Nginx configuration /var/opt/gitlab/nginx/conf/gitlab-http.conf: #listen *:80; becomes listen *:8090; Apply all changes with the GitLab reconfiguration command (which may take some time): gitlab-ctl reconfigure Optionally increase memory and reload the configuration again using the same command.

Manage the GitLab service with the following commands: gitlab-ctl start – start the service gitlab-ctl stop – stop the service gitlab-ctl restart – restart the service gitlab-ctl status – view service status

Finally, access GitLab via the web interface at http://192.168.210.85/ , log in as root, and create a new project to complete the deployment.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud NativeDevOpsGitLabInstallation
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.