Artifactory & Xray on Openshift via OperatorHub
Tags: devops, security, kubernetes, openshift
Published: 2020-05-27 21:25:37

<h2>OpenShift Operators for JFrog Artifactory Enterprise & Xray</h2>
<p>OpenShift Operators are a method of packaging, deploying, and managing a Kubernetes application. They help handle the complex details of running containerized software, monitoring the state of the OpenShift Container Platform to make automated real time operating decisions.</p>
<p>The OpenShift operator now available for JFrog Artifactory Enterprise is compatible with OpenShift 4 and performs this automated monitoring for your deployment of Artifactory. It helps keep Artifactory running in your K8s cluster by:</p>
<ul>
<li>
Setting up the correct RBAC policies to run JFrog Artifactory securely
</li>
<li>
Deploying JFrog Artifactory in a high availability (HA) mode
</li>
<li>
Provisioning the required storage and service endpoints
</li>
</ul>
<p>The OpenShift operator now available for JFrog Xray is also compatible with OpenShift 4 and performs the same automated monitoring for your deployment of Xray. It helps keep Xray running in your K8s cluster by:</p>
<ul>
<li>
Setting up the correct RBAC policies to run JFrog Xray securely
</li>
<li>
Deploying Openshift certified RabbitMQ instance for enhanced security
</li>
</ul>
<h2>Deploying Artifactory Enterprise Instance via Operatorhub</h2>
<p>Our first step will be to configure a Postgresql instance to be used by the JFrog Enterprise Operators as they require an external database to be configured ahead of time. In this case we picked Postgresql as we can then leverage the same component for both Artifactory & Xray.</p>
<h4>Configure Artifactory Database</h4>
<code>CREATE USER artifactory WITH PASSWORD 'password';
CREATE DATABASE artifactory WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE artifactory TO artifactory;</code>
<h4>Configure Xray Database</h4>
<code>CREATE DATABASE xraydb WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE xraydb TO artifactory;
</code>
<h4>Create TLS Secret for Artifactory SSL</h4>
<code>oc create secret tls tls-ingress --cert=tls.crt --key=tls.key</code>
<h4>Access Openshift OperatorHub to install JFrog Artifactory Enterprise Operator</h4>
<a href="https://ibb.co/njdw4Kf"><img src="https://i.ibb.co/vkycfMm/Screen-Shot-2020-05-27-at-12-53-16-PM.png" alt="Screen-Shot-2020-05-27-at-12-53-16-PM" border="0"></a>
<h4>Find new Artifactory HA Provided API under Installed Operators</h4>
<a href="https://ibb.co/Ny0HbRX"><img src="https://i.ibb.co/x7nRdZy/Screen-Shot-2020-05-27-at-12-51-21-PM.png" alt="Screen-Shot-2020-05-27-at-12-51-21-PM" border="0"></a>
<h4>Click on the Artifactory HA Provided API to create a new instance</h4>
<a href="https://ibb.co/2ZMcLFS"><img src="https://i.ibb.co/mNyhYR0/Screen-Shot-2020-05-27-at-12-53-04-PM.png" alt="Screen-Shot-2020-05-27-at-12-53-04-PM" border="0"></a>
<h4>Fill in all necessary fields marked with "OVERRIDE"</h4>
<a href="https://ibb.co/XS89qBZ"><img src="https://i.ibb.co/t8XS9fM/Screen-Shot-2020-05-27-at-12-55-04-PM.png" alt="Screen-Shot-2020-05-27-at-12-55-04-PM" border="0"></a>
<h4>Use the "oc" CLI to view pods and external IP exposed from Openshift</h4>
<a href="https://ibb.co/Xb32TKW"><img src="https://i.ibb.co/PN9m8Pr/Pods.png" alt="Pods" border="0"></a>
<h4>Congratulations!</h4>
<p>Next Steps</p>
<ul>
<li>
(Optional) Map DNS to the external IP
</li>
<li>
Access Artifactory with default credentials <br/>
<code>user: admin password: password</code> 
</li>
<li>
Update Artifactory credentials in the onboarding wizard
</li>
<li>
Add at least one license per Artifactory node in the onboarding wizard
</li>
<li>
Complete onboarding wizard with desired options selected
</li>
</ul> 
<h2>Deploying Xray Instance via Operatorhub</h2>
<p>The following steps will assume you have deployed a Postgresql instance into Openshift with xraydb already created and granted permissions to the artifactory user.</p>
<p>If you wish to use another database for Artifactory other than Postgresql you will need to create a Postgresql instance at this point as Xray requires Postgresql.</p>
<p>Next we will deploy the Xray operator via the Operatorhub and create a new instance of Xray that will communicate to the Artifactory and Postgresql we just created in the prior steps. Let's head back to the Openshift web console to find the Xray Operator available to install below.</p>
 <h4>Access Openshift OperatorHub to install JFrog Xray Operator</h4>
<a href="https://ibb.co/njdw4Kf"><img src="https://i.ibb.co/vkycfMm/Screen-Shot-2020-05-27-at-12-53-16-PM.png" alt="Screen-Shot-2020-05-27-at-12-53-16-PM" border="0"></a>
<h4>Find new Xray Provided API under Installed Operators</h4>
<a href="https://ibb.co/Ny0HbRX"><img src="https://i.ibb.co/x7nRdZy/Screen-Shot-2020-05-27-at-12-51-21-PM.png" alt="Screen-Shot-2020-05-27-at-12-51-21-PM" border="0"></a>
<h4>Click on the Xray Provided API to create a new instance</h4>
<a href="https://ibb.co/PD9JQdJ"><img src="https://i.ibb.co/y4YKSrK/Screen-Shot-2020-05-27-at-1-18-00-PM.png" alt="Screen-Shot-2020-05-27-at-1-18-00-PM" border="0"></a>
<h4>Fill in all necessary fields marked with "OVERRIDE"</h4>
<a href="https://ibb.co/HznKKP6"><img src="https://i.ibb.co/1q800X1/Screen-Shot-2020-05-27-at-1-19-36-PM.png" alt="Screen-Shot-2020-05-27-at-1-19-36-PM" border="0"></a>
<h4>Use the "oc" CLI to view pods and external IP exposed from Openshift</h4>
<a href="https://ibb.co/6WmwRgG"><img src="https://i.ibb.co/z4rxhGC/Screen-Shot-2020-05-27-at-1-21-02-PM.png" alt="Screen-Shot-2020-05-27-at-1-21-02-PM" border="0"></a>
<h4>Congratulations!</h4>
<p>Next Steps</p>
<ul>
<li>
Complete onboarding wizard with desired options for Xray
</li>
</ul>
<p>Congratulations! We now have deployed Artifactory Enterprise and Xray into Openshift!</P>