In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
JFrog Artifactory is an artifacts repository management platform that supports all major packaging formats, build tools, and continuous integration (CI) servers. It stores all binary content in a single location and provides an interface that makes it easier for users to upload, find, and use binaries throughout application development and delivery.
In this article, we'll show you how to deploy and manage JFrog Artifactory on a Kubernetes cluster using Rancher. After reading this article, you will systematically understand the installation setup of JFrog Artifactory OSS and be able to follow the same steps to install Artifactory OSS or its commercial version in any Kubernetes cluster. Of course, we'll also show you how to create a generic repository in Artifactory and upload artifacts to it.
Artifactory has more features than those shown in this article, and we'll cover them in more detail in future articles.
Okay, so let's get started!
the software used
The following software tools were used in this article:
Rancher v2.0.8
Kubernetes cluster running on Google Kubernetes Engine version 1.10.7-gke.2
Artifactory helm chart version 7.4.2
Artifactory OSS version 6.3.2
If this article is updated in the future, please use the latest version at that time.
As with other tools in Kubernetes, there are several ways to install Artifactory. Here we will use Helm chart, Helm provides a way to package and share application installation commands with others. Think of it as a package manager for Kubernetes. Rancher integrates Helm in the Rancher Catalog, where you can deploy any Helm-supported application with just a few clicks. Rancher also has other features, including:
A simple and intuitive Web interface
Unified on-board all clouds, all distributions, all Kubernetes clusters
A single view of all managed clusters
Out-of-the-box cluster monitoring
Workload, Role-Based Access Control (RBAC), Policy, and Project Management
All Kubernetes features do not require any software to be installed locally
Install Rancher
Note: If you already have Rancher v2 Server and Kubernetes cluster, you can skip this section and go directly to the tutorial on installing JFrog Artifactory.
Rancher is powerful enough to manage Kubernetes clusters from anywhere, so we'll start Rancher Server in standalone mode on a GCE instance and use it to deploy Kubernetes clusters in GKE.
Starting Rancher Server in standalone mode is very easy-because it is a Docker container, we need a compute instance to run it before starting the container, so we start it with the following command:
Please modify the project and zone parameters according to your deployment.
After a few minutes you should see that the instance is ready.
Note down the EXTERNAL_IP address, which you may need later when connecting to Rancher Server.
After the compute node is up and running, we SSH into it via GCE's CLI (Command Line Interface).
Also, be careful to adjust the project and zone parameters as they change when you start nodes with different names or in different zones.
Once connected, run the following command to install some dependencies and install Docker CE. Rancher Server is a Docker container, and we need Docker if we want to continue the installation.
With this in place, we are ready to deploy Rancher servers. On the first launch of a container, Docker Engine fetches the container image from Docker Hub and saves it locally before launching the container. In the future, when the container needs to be started, it will be faster to use the local mirror directly.
Use the following command to control Docker to start the Rancher Server container and listen on ports 80 and 443 on the host
If everything works, Docker prints the download status, followed by the new container ID, before returning to the prompt.
Congratulations! You have successfully started an instance of Rancher Server.
Enter the EXTERNAL_IP address you just recorded in your browser and you will need to accept Rancher's default self-signed certificate. After this, a welcome screen pops up to set the password (remember it!) Continue to the next page.
On this page you need to set the URL of the Rancher Server. In a production deployment this might be a hostname, such as rancher.yourcompany.com, but if you are using a demo server, you can simply use the EXTERNAL_IP address above.
After clicking the Save URL, we will go to the Clusters page, from here we can start deploying our Kubernetes cluster.
Using Rancher to deploy a GKE cluster
Rancher can deploy and manage Kubernetes clusters from anywhere. These clusters can come from Google, Amazon, Azure, Alibaba Cloud, Huawei Cloud, Tencent Cloud, etc., and can be on cloud nodes, in data centers, or even in VMs running on your laptop. This is the best thing about Rancher. This time we will use GKE. After clicking Add Cluster, select Google Container Engine.
For this demo, set name to jfrog-artifactory.
To create a cluster, Rancher requires access to Google Cloud Platform. These permissions can be obtained via the Service Account's private key JSON file. How to generate it, first find the name of the service account (modify the name of the project according to your situation):
The output service account will replace it. Copy the entire address and apply it to the following command:
This creates a file named key.json in the current folder. This is the Service Account private key that Rancher will use to create the cluster:
You can paste the contents of the file into the text box, or click Read from a file and select the key.json file. Rancher will use this information to generate a page in which to configure your new cluster:
Set your desired Zone, Machine Type, Node Count, and Root Disk Size. Of course you can refer to the default values used in the demo above.
Click Create and the cluster will be deployed to GKE. After everything is ok, you can see that it is already active on the UI.
Install JFrog Artifactory
Next we will install Artifactory via JFrog's Helm chart repository. Helm charts, like OS package management systems, provide you with a stable way to deploy container applications in Kubernetes environments and allow you to update or roll back applications. Chart ensures that you have a specific version or tag installed for your container, and in the case of multiple components, Helm chart ensures that all of your components have the correct version installed.
Install JFrog Helm Repository
Rancher ships with a Helm charts library in its application catalog, but to satisfy Rancher users 'need for flexibility, you can also install any third-party Helm repository to deploy these applications to clusters. We'll be using the JFrog repository today.
In Rancher's Global Cluster view, click Catalogs, then click Add Catalog. In the pop-up window, enter a name, such as jfrog-artifact factory, and then enter the location of the official JFrog repository.
Click Create and the JFrog repository will appear in the list of custom directories.
Deploying Artifactory
We then deploy Artifactory. In the Global view, select the default project under the jfrog-artifact cluster:
After entering the default project, select Catalog Apps and click Launch. Rancher displays applications available for installation from Application Catalogs. Here you may find artifactory-ha appearing twice, once as a partner-provided chart in the default app library shipped with Rancher, and once from the JFrog repository itself. We installed the Helm repository because we wanted to install a regular, non-HA Artifactory, which we called artifactory. All applications in the directory indicate which library they came from, so in the case of charts in multiple libraries, you can still choose which library to install
When you select View Details, you can change options about how to install the app. By default, this directory entry will deploy licensed commercial versions of Artifactory, for which you need certificates. If you already have a certificate, then you can keep the default option; however, we want to install the OSS version, so we will change the image of the chart installation.
In the Configuration Options interface, select Add Answer, set the variable name of artifactory.image.repository and the value of docker.bintray.io/jfrog/artifactory-oss.
Now, when you click Launch, Rancher will deploy Artifactory to your cluster.
When the installation is complete, the red progress bar changes to green. If you click on artifactory, it will show you what Rancher has created for you. In this case, it creates three workloads, three services, one volume, and one encryption in Kubernetes.
Select Workloads and you can see that they are all running:
Solving Pending intrusion
At the time of this article, a bug occurred that caused Ingress to remain in Pendding state. If you see this when you click Load Balancing, read the solution.
To solve the pending Ingress problem, we need to create services where Ingress can send traffic. Click Import YAML in the upper-right corner. In the window that opens, paste the following information and click Import.
Visit Artifactory
Now in WordLoads interface, artifactory-artifactory-nginx workload will display clickable links to view ports 443/tcp and 80/tcp:
When you select 443/tcp, it opens the Artifactory UI in a new tab in your browser. Because it uses a self-signed certificate by default, your browser may pop up a warning to accept the certificate before executing.
Get Artifactory Working
You now have a fully functional binary artifact repository at your disposal. It's not that complicated, is it? There are a few things you need to configure before you can start using it.
First, you need to set up an administrative password. When it asks for information about proxy servers, select skip unless you have deployed it to a location where proxy configuration is required. Create a generic repository and select Finish.
Now, let's go through some basic usage quickly.
First, we upload the helm chart used to create the Artifactory installation.
Select Artifacts from the left menu to see the generic repository you just created. Select it, then select Deploy in the upper right corner to upload Helm chart's zipfile (or any other file) to the repository.
Once deployed, you'll see it in the repository under the Tree tab.
Although this is only a simple test of Artifactory, it is fully operational.
You can use Artifactory for binary artifact storage and distribution, and use Rancher to easily manage workloads, clusters, and content related to the deployment itself.
clean-up
If you have completed the demo in this article, you can remove Kubernetes clusters from Rancher's Global Cluster view. This will remove it from GKE. After that, you can delete instances of Rancher Server directly from GCE.
closure
JFrog Artifactory is very powerful. A large number of organizations use it every day, and the ability to deploy it quickly and safely into Kubernetes clusters is very useful.
According to their literature, Artifactory allows users to "publish quickly or purge quickly." Similarly, Rancher allows you to deploy quickly while controlling the security of resources and your surroundings. You can build, deploy, disassemble, encrypt, monitor and interact with Kubernetes clusters anywhere in the world, all from a simple, convenient and secure interface.
Nothing is easier than this!
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.