Cara memasang SSL pada GitLab Container Registry agar aman dan tidak muncul warning ketika melakukan aktifitas push maupun pull

Edit /etc/gitlab/gitlab.rb GitLab configuration file to define registry address.

[...]
registry_external_url 'https://registry.example.org/'
[...]
################################################################################
## Container Registry settings
##! Docs: https://docs.gitlab.com/ee/administration/packages/container_registry.html
################################################################################

# registry_external_url 'https://registry.example.com'
 registry_external_url 'https://registry.ocp-lab.wachid.web.id'
### Settings used by GitLab application
# gitlab_rails['registry_enabled'] = true

Ensure that /etc/gitlab/ssl directory exists.

root@masadmin:/# mkdir /etc/gitlab/ssl/
root@masadmin:/#

Lakukan Symlink sertifikat SSL dari gitlab web yang sebelumnya sudah kita generate dan pasang

root@masadmin:/# ln -s /etc/gitlab/opnssl/server.crt /etc/gitlab/ssl/registry.ocp-lab.wachid.web.id.crt
root@masadmin:/#
root@masadmin:/# ln -s /etc/gitlab/opnssl/server.key /etc/gitlab/ssl/registry.ocp-lab.wachid.web.id.key
root@masadmin:/#
Reconfigure GitLab instance.
sudo gitlab-ctl reconfigure

It will set up a registry, so the Packages & Registries will become available in the sidebar.

root@masadmin:~# sudo gitlab-ctl restart
ok: run: alertmanager: (pid 124608) 1s
ok: run: gitaly: (pid 124644) 0s
ok: run: gitlab-exporter: (pid 124665) 0s
ok: run: gitlab-kas: (pid 124677) 0s
ok: run: gitlab-workhorse: (pid 124691) 0s
ok: run: logrotate: (pid 124709) 1s
ok: run: nginx: (pid 124715) 0s
ok: run: node-exporter: (pid 124727) 1s
ok: run: postgres-exporter: (pid 124734) 0s
ok: run: postgresql: (pid 124743) 1s
ok: run: prometheus: (pid 124754) 0s
ok: run: puma: (pid 124783) 0s
ok: run: redis: (pid 124789) 1s
ok: run: redis-exporter: (pid 124796) 0s
ok: run: registry: (pid 124804) 1s
ok: run: sidekiq: (pid 124816) 1s
root@masadmin:~#

Leave a Reply

Your email address will not be published. Required fields are marked *