In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This series of articles:
Chapter 1: Nine Analysis takes you to play with rancher-installation
Chapter 2: Nine Analysis takes you to play rancher-Import Cluster
Chapter 3: Nine Analysis takes you to play rancher-Integrated gitlab
Chapter 4: Nine Analysis takes you to play rancher-Integrated harbor
Chapter 5: Nine Analysis takes you to play with rancher-Pipeline release
Chapter 6: Nine Analysis takes you to play rancher-require 'docker login'
Chapter 7: Nine Analysis takes you to play rancher-pipeline and custom domain name
Chapter 8: Nine Analysis takes you to play rancher-drone Integrated gitlab
Catalogue
1 preface
2 create a gitlab Oauth application
3 create secret
4 create project spaces and namespaces
5 install nfs server
6 create pv
7 create pvc
8 add drone to the App Store
1 preface
If you have any questions about the blog, please add a group to let us know!
The pipeline function of rancher is relatively weak, and people are most criticized for its slow speed, inability to cache, resource consumption and so on. Compared with rancher,drone, it has many advantages, such as less resources, cacheability, high speed, lightweight and so on. This article describes how to use rancher's App Store to install drone and how drone correlates gitlab.
The environment of this paper is k8s v1.16.3 minute rancher v2.3.3.
2 create a gitlab Oauth application
Log in to gitlab and select setting:
Select "application" and fill in the relevant information. Redirect URI is the callback drone server address (it will be installed below, so it doesn't matter here. My address is http://jiuxi.drone.org/login, note that / login is a must suffix, don't forget to write).
After saving, the authorization information is generated as follows:
End of gitlab configuration.
3 create secret
First, create a secret through kubelet, where the "clientSecret" value is the secret value of the oauth application created by the above gitlab:
Kubectl create secret generic drone-server-secrets\
-- namespace=drone\
-from-literal=clientSecret= "93e85934b165566125bdc313288d79fb446c486d18afaf07f7c97e36297b00bd"
4 create project spaces and namespaces
Log in to rancher and select the specified cluster:
Click to enter jiuxi, you can see the dashboard of the cluster, and select "Project / Namespace":
Select add Project:
Fill in the project name (drone) and create:
Under the new project (drone), select add Namespace:
Fill in the namespace name (drone) and create:
The project space and namespace have been created. By navigating and clicking to enter, all future operations will be carried out under this project space.
5 install nfs server
The reason for installing the nfs server is that drone requires storage space, so nfs is used here. How to install nfs server, please refer to my "easy to complete nfs installation", do not worry, simple and easy, let you finish easily in minutes.
Mkdir-p / data/nfs/drone/1g
Chmod 777-R / data/nfs/drone/1g
Echo "/ data/nfs/drone 10.110.0.0 echo 16 (rw,sync,no_root_squash)" > > / etc/exports
Systemctl restart nfs
6 create pv
Edit the pv-drone-1g.yaml file, where the server address is the address of the nfs server:
ApiVersion: v1
Kind: PersistentVolume
Metadata:
Name: pv-drone-1g
Spec:
Capacity:
Storage: 1Gi
VolumeMode: Filesystem
AccessModes:
-ReadWriteOnce
PersistentVolumeReclaimPolicy: Retain
Nfs:
Server: 10.110.101.106
Path: / data/nfs/drone/1g
Create a pv:
Kubectl apply-f pv-drone-1g.yaml
7 create pvc
Edit the pvc-drone-1g.yaml file:
ApiVersion: v1
Kind: PersistentVolumeClaim
Metadata:
Name: pvc-drone-1g
Namespace: drone
Spec:
AccessModes:
-ReadWriteOnce
Resources:
Requests:
Storage: 1Gi
VolumeMode: Filesystem
Create a pvc:
Kubectl apply-f pvc-drone-1g.yaml
Since the pv is created first, and then the pvc is created, the pvc status is queried and it is found that the pvc has been successfully bound to the pv:
8 add drone to the App Store
Go to the App Store under the project space (drone) and select "start":
Search to find "drone":
Click and take a screenshot as follows:
"Drone settings" configuration content:
The explanation is as follows:
Drone Host Name: drone hostname
Set Drone Admin User: the gitlab user name above when the gitlab oauth was created
Drone integration Server: code repository type, I am gitlab
Secret created with kubectl on Select the Existing Drone Provider Secret;
GitLab OAuth3 Client ID: clientID of gitlab oauth
GitLab Server Address: gitlab warehouse address
"Service and Load balance" configuration content:
Because I installed nginx-ingress, I used load balance. For more information about how to install nginx-ingress, you can check out my related articles, which are simple enough to make you explode in minutes.
Click "start" after configuration. The following figure shows the status after successful startup. Sometimes the response of the page is not timely. You can refresh it several times to see the running status:
Click the "80/http" link in the figure above, and it will directly jump to the gitlab warehouse authorization page and select "Authorize":
The page will return to drone, and the page will synchronize your gitlab repository status. After the synchronization is completed, your gitlab repository code will be displayed:
Since then, it is easy to install drone and associate gitlab with the rancher App Store.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.