Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Rancher Integration gitlab tutorial

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1 preface

GitLab is an open source project for warehouse management systems. Use Git as a code management tool, and build a web service on this basis.

Rancher provides continuous integration capabilities, and the first step in continuous integration is to associate code bases, where rancher integration gitlab is introduced. There are two main things Rancher does. First, Rancher provides a minimalist version of the operating system RancherOS, which can be used to run Docker separately. Second, its Rancher platform can orchestrate Dockers (Rancher supports both Kubernetes and Docker Swarm) into any infrastructure environment; another advantage of Rancher is that it is cloud-independent and can support a variety of public clouds, private clouds and data center deployments. Rancher is also a multi-tenant platform, and customers can manage their clusters according to their own needs. Rancher Labs claims that it takes only 5 minutes to deploy a Kubernetes cluster using its platform. In addition, the management platform also prepares a rich application directory in advance, so that it only takes a few clicks to complete the application deployment in the relatively complex containerized environment.

Before continuing, first install rancher correctly and import the K8s cluster successfully. If you have not finished this operation, please refer to my other two articles. In addition, rancher is internationalized into simplified Chinese. The settings are as follows:

2 Operation

2.1 Select Cluster

2.2 Select a project

There is a concept of "project" in rancher, which you can compare to the K8s namespace. By default, k8s has two fixed namespaces, default and kube-system. Rancher associates default with the k8s default namespace and system with the k8s kube-system namespace. This section relates to gitlab under the rancher default project.

2.3 Select an assembly line

2.4 Select Gitlab

2.5 configure Gitlab application

2.5.1 Log in to Gitlab

If you are not using a private Gitlab server, but using the Gitlab website directly, click the "Click here" link in the following figure to log in:

If you are using a private Gitlab server, you need to open the private Gitlab server URL and log in. If you do not have a private Gitlab, you can refer to my "helm easy to complete gitlab" to build, the whole operation process is easy to explode.

2.5.2 set Gitlab

Select "settings":

Then select "Applications":

2.5.3 fill in the form content

The content of the form is written with reference to the rancher prompt:

My writing content is as follows:

When you click the "save" button, "application id" and "secret" are generated, as shown in the following figure:

2.6 rancher Associated gitlab

Write the appId and secret generated above to the rancher configuration, as shown in the following figure:

2.7 gitlab authorizes rancher access

After clicking the Authorization button above, the authorization confirmation page of gitlab will be displayed:

2.8 Associated successfully

If you successfully click the "Authorize" button in the figure above, the following page will be displayed. Since then, rancher has been successfully associated with gitlab:

2.9 Association failure

If the association fails, the following figure may be displayed:

The reason that appears in the above figure is: because the jiuxi.gitlab.org I use is a self-bound domain name record, that is, I write to the hosts file myself. While the rancher container is running, the hosts file inside the container is not written, so you need to write this domain name resolution record to the hosts file of the rancher container.

Execute the following statement to enter the rancher container:

Docker exec-it rancher / bin/bash

Append the domain name resolution record to the / etc/hosts file:

Echo "10.110.101.100 jiuxi.gitlab.org" > > / etc/hosts

Re-authorization will be successful.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report