DEV Community

John Peterson for JFrog

Posted on

Artifactory & Xray on Openshift via OperatorHub

OpenShift Operators for JFrog Artifactory Enterprise & Xray

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.

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:

  • Setting up the correct RBAC policies to run JFrog Artifactory securely
  • Deploying JFrog Artifactory in a high availability (HA) mode
  • Provisioning the required storage and service endpoints

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:

  • Setting up the correct RBAC policies to run JFrog Xray securely
  • Deploying Openshift certified RabbitMQ instance for enhanced security

Deploying Artifactory Enterprise Instance via Operatorhub

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.

Configure Artifactory Database

CREATE USER artifactory WITH PASSWORD 'password';
CREATE DATABASE artifactory WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE artifactory TO artifactory;

Configure Xray Database

CREATE DATABASE xraydb WITH OWNER=artifactory ENCODING='UTF8';
GRANT ALL PRIVILEGES ON DATABASE xraydb TO artifactory;

Create TLS Secret for Artifactory SSL

oc create secret tls tls-ingress --cert=tls.crt --key=tls.key

Access Openshift OperatorHub to install JFrog Artifactory Enterprise Operator

Screen-Shot-2020-05-27-at-12-53-16-PM

Find new Artifactory HA Provided API under Installed Operators

Screen-Shot-2020-05-27-at-12-51-21-PM

Click on the Artifactory HA Provided API to create a new instance

Screen-Shot-2020-05-27-at-12-53-04-PM

Fill in all necessary fields marked with "OVERRIDE"

Screen-Shot-2020-05-27-at-12-55-04-PM

Use the "oc" CLI to view pods and external IP exposed from Openshift

Pods

Congratulations!

Next Steps

  • (Optional) Map DNS to the external IP
  • Access Artifactory with default credentials user: admin password: password
  • Update Artifactory credentials in the onboarding wizard
  • Add at least one license per Artifactory node in the onboarding wizard
  • Complete onboarding wizard with desired options selected

Deploying Xray Instance via Operatorhub

The following steps will assume you have deployed a Postgresql instance into Openshift with xraydb already created and granted permissions to the artifactory user.

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.

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.

Access Openshift OperatorHub to install JFrog Xray Operator


Screen-Shot-2020-05-27-at-12-53-16-PM

Find new Xray Provided API under Installed Operators

Screen-Shot-2020-05-27-at-12-51-21-PM

Click on the Xray Provided API to create a new instance

Screen-Shot-2020-05-27-at-1-18-00-PM

Fill in all necessary fields marked with "OVERRIDE"

Screen-Shot-2020-05-27-at-1-19-36-PM

Use the "oc" CLI to view pods and external IP exposed from Openshift

Screen-Shot-2020-05-27-at-1-21-02-PM

Congratulations!

Next Steps

  • Complete onboarding wizard with desired options for Xray

Congratulations! We now have deployed Artifactory Enterprise and Xray into Openshift!

Discussion (0)