关注微信公众号
第一手干货与资讯
加入官方微信群
获取免费技术支持
DevOps engineers have grown so reliant on the power and scalability of Kubernetes (K8s) clusters that one server platform can seldom accommodate them all. More and more enterprises now run their containerized applications in clusters across multiple platforms at once, in public clouds and on-prem servers.
That can fuel a chaotic stampede in an enterprise-class system - who has control, and which builds do you trust?
Rancher offers a solution for managing multiple K8s clusters, and an enhanced Kubernetes distribution with additional features for central control of those clusters. Rancher’s multi-cluster operations management features provide a unified experience across public and private providers, VMware clusters, and bare metal servers that run in production across your organization, with common policies for provisioning and upgrades.
While containerized applications help provide great stability through features like immutability and declarative configuration, they don’t guarantee that the software they contain is trusted. Without full control of and visibility into the source and dependencies that go into your containers, elements you don’t want or need can sneak into your builds.
JFrog Artifactory can provide the hybrid Kubernetes registry you need that gives you full visibility into your containers. Artifactory enables trust by giving you insight into your code-to-cluster process while providing visibility into each layer of each application. Moreover, a hybrid K8s registry will help you run applications effectively and safely across all clusters in all of the infrastructure environments you use.
Rancher makes it easy for you to install a high-availability instance of Artifactory through its catalog of applications directly into a Kubernetes cluster that you create for Artifactory. In this way, Artifactory instances can run in any of the infrastructure types you use, either on a public cloud or an on-prem server.
To start, install the Rancher Kubernetes Engine (RKE) onto a server and set up an admin account.
From Rancher’s UI, add a new K8s cluster in the platform where your Artifactory instance will run.
You can install Artifactory into the Default Rancher project that is automatically created when adding a cluster. However, it’s a good practice to create a Rancher project and namespace for Artifactory to run in,
For example, a project my-project and a namespace my-project-artifactory:
\.jfrog.team jfrog.team; if ($http_x_forwarded_proto = '') { set $http_x_forwarded_proto $scheme; } ## Application specific logs ## access_log /var/log/nginx/jfrog.team-access.log timing; ## error_log /var/log/nginx/jfrog.team-error.log; rewrite ^/$ /artifactory/webapp/ redirect; rewrite ^/artifactory/?(/webapp)?$ /artifactory/webapp/ redirect; rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/$repo/$1/$2; chunked_transfer_encoding on; client_max_body_size 0; location /artifactory/ { proxy_read_timeout 2400s; proxy_pass_header Server; proxy_cookie_path ~*^/.* /; if ( $request_uri ~ ^/artifactory/(.*)$ ) { proxy_pass http://artifactory/artifactory/$1; } proxy_pass http://artifactory/artifactory/; proxy_next_upstream http_503 non_idempotent; proxy_set_header X-Artifactory-Override-Base-Url $http_x_forwarded_proto://$host:$server_port/artifactory; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
From the main menu, select Resources > Config Maps, then click Add Config Map.
![Rancher ConfigMap](/img/blog/2018/Jfrog-Rancher-ConfigMap.jpg
The ConfigMap will be used when Artifactory is installed.
Once you have a cluster, project, and namespace that Artifactory can run in, you can install it easily through Rancher’s catalog of applications.
![Launch Rancher Catalog](/img/blog/2018/Jfrog-Rancher-Catalog_Launch.jpg
![Rancher JFrog Catalog Item](/img/blog/2018/Jfrog-Rancher-Catalog_JFrog.jpg
![Rancher JFrog Catalog Details](/img/blog/2018/Jfrog-Rancher-Catalog_Install.jpg
Scroll down to set the Configuration Options. Set the name, enable persistent storage, and set the persistent volume size to a value large enough to accommodate your expected needs.
Set the Container Images to use the Default Image, and the Services and Load Balancing settings to use the NGINX server, assign the artifactory-ha-tls secret and the art-nginx-conf ConfigMap that were created in the prior steps.
![Rancher JFrog Catalog Details](/img/blog/2018/Jfrog-Rancher-Settings.jpg
Set the Database Settings to enable and configure PostgreSQL.
![Rancher JFrog Database Settings](/img/blog/2018/Jfrog-Rancher-Settings-Database.jpg
![Rancher JFrog Storage Settings](/img/blog/2018/Jfrog-artifactory-storage.png
Click Launch to perform the installation.
![Rancher JFrog Install Launched](/img/blog/2018/Jfrog-Rancher-Install_Launch.png
![Rancher JFrog Install Completed](/img/blog/2018/Jfrog-Rancher-Install_Complete.png
Rancher and Artifactory both bring many pieces that would be challenging to manage independently into a single system, bringing control and visibility to the process. Together, they help enforce uniform policies, promotion flow, and more under a set of universal managers, quelling the risk of disorder.
Rancher’s integration of Artifactory through its catalog makes it especially easy to deploy and manage a hybrid Kubernetes Registry across all of the clusters you need across your organization.
If you’re already a Rancher user, you can install Artifactory immediately through the catalog of applications.
![Rancher JFrog Activate](/img/blog/2018/Jfrog-Rancher-Activate.png
If you are new to Artifactory, you can request a set of three Artifactory Enterprise licenses for a free trial by emailing rancher-jfrog-licenses@jfrog.com.