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

How to install CoreDNS, GitLab, Jenkins

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "how to install CoreDNS, GitLab, Jenkins". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install CoreDNS, GitLab, Jenkins".

Install the following services on the repository server you created earlier. 1) build a CoreDNS service CoreDNS service for server hostname resolution in the development environment. The server in the development environment binds MAC-IP through the DHCP service provided by the gateway, and then uses CoreDNS service to map IP and hostname. First pull the CoreDNS image from Docer Hub. Docker pull coredns/coredns:1.8.3

Stop the DNS service that starts by default on Ubuntu.

Do not stop the DNS service before downloading the coredns image, otherwise the docker image repository server will not be resolved.

Sudo systemctl disable systemd-resolved

Sudo systemctl stop systemd-resolved

Create 2 files, Corefile hostsfile, under the directory / home/devops/dockerSrvStorage/coredns, as follows:

192.168.0.1 is the IP address of the wireless router at home. I am using TL-WDR7650 Gigabit Extensible Wireless routing here.

# ls

Corefile hostsfile

# cat Corefile

.: 53 {

Hosts / etc/coredns/hostsfile {

Fallthrough

}

Forward. 192.168.0.1:53

Log

}

Add all the previously created Guest virtual machine IP.

# cat hostsfile

Devops@repositoryServer:~/dockerSrvStorage/coredns$ cat hostsfile

192.168.0.114 repositoryServer dnsServer gitlab jenkins gitlab.telbox.cn jenkins.telbox.cn

192.168.0.112 devopServer0

192.168.0.113 devopServer1

192.168.0.115 devopServer2

192.168.0.106 k8s-master-0

192.168.0.107 k8s-node-0

192.168.0.109 k8s-node-1

192.168.0.108 k8s-node-2

192.168.0.114 basehost0

192.168.0.111 ubuntu20Server

Run the CoreDNS image docker run-it-d-- net=host\

-- name=coredns-- restart=always\

-v / home/devops/dockerSrvStorage/coredns:/etc/coredns/\

Coredns/coredns:1.8.3\

-conf / etc/coredns/Corefile

Note:

-net=host to be specified. If not specified, DNS cannot be queried in the container of the host. If this item is specified, you do not need to specify the-p option. The port of the host is used by default.

Reference:

Common DNS Server such as BIND, Dnsmasq (but not CoreDNS):

Https://computingforgeeks.com/bind-vs-dnsmasq-vs-powerdns-vs-unbound/

Install Core DNS Docker:

Https://blog.csdn.net/weixin_36938307/article/details/105390004

2) GitLab

Various docker services generally need persistent mapping to facilitate configuration and data storage. Use / home/devops/dockerSrvStorage locally as the root directory for various application storage.

The parameter-hostname gitlab.telbox.cn defines the host domain name where the user accesses the gitlab service.

Mkdir-p / home/devops/dockerSrvStorage/gitlab

Sudo docker pull gitlab/gitlab-ce:13.9.2-ce.0

Sudo docker run-- detach\

-- hostname gitlab.telbox.cn\

-- publish 9181 publish 443-- publish 9180 VR 80-- publish 9182 VR 22\

-- name gitlab\

-- restart always\

-- volume / home/devops/dockerSrvStorage/gitlab/config:/etc/gitlab\

-- volume / home/devops/dockerSrvStorage/gitlab/logs:/var/log/gitlab\

-- volume / home/devops/dockerSrvStorage/gitlab/data:/var/opt/gitlab\

Gitlab/gitlab-ce:13.9.2-ce.0

If necessary, you can enter the GitLab container for configuration.

Sudo docker exec gitlab gitlab-ctl reconfigure

To access the installed GitLab service http://gitlab.telbox.cn:9180/ for the first time, you need to set the root user's password.

Reference:

Https://www.jianshu.com/p/080a962c35b6

Https://zhuanlan.zhihu.com/p/63786567

3) Jenkinsmkdir-p / home/devops/dockerSrvStorage/jenkins

Sudo docker run-p 9183VR 8080-p 9184VR 50000\

-- name jenkins-d\

-v / home/devops/dockerSrvStorage/jenkins:/var/jenkins_home\

Jenkins/jenkins:lts

After startup, go to docker to view the initial password. This password is used when accessing jenkins.telbox.cn:9183 for the first time.

Sudo docker exec-it jenkins bash

Jenkins@e061aa64ed7b:/$ cat / var/jenkins_home/secrets/initialAdminPassword

Visit jenkins.telbox.cn:9183 to enter the initial password and select the recommended plug-in to install.

After the plug-in is installed, you are required to enter Jenkins URL, and enter jenkins.telbox.cn:9183 here

The Jenkins URL is used to provide the root URL for absolute links to various Jenkins resources. That means this value is required for proper operation of many Jenkins features including email notifications, PR status updates, and the BUILD_URL environment variable provided to build steps.

The proposed default value shown is not saved yet and is generated from the current request, if possible. The best practice is to set this value to the URL that users are expected to use. This will avoid confusion when sharing or viewing links.

If necessary, you can configure logs for Jenkins:

Mkdir-p / home/devops/dockerSrvStorage/jenkins/data

Cat > / home/devops/dockerSrvStorage/jenkins/data/log.properties

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

Internet Technology

Wechat

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

12
Report