Confessions of a DevOps Frog: Automating Artifactory deployment to Kubernetes is Actually Easy!

In our previous blog post, we described how Artifactory can serve as a Helm repository, and listed the best practices for using your Artifactory Helm repository to store your charts and deploy them to Kubernetes. Now we’ll demonstrate how easy it is to deploy your Artifactory as a single Artifactory instance and a multi-node Artifactory HA cluster using Helm and Kubernetes.

Kubernetes allows you to quickly and predictably deploy your applications, scale them on the fly, seamlessly roll out new features and efficiently utilize hardware resources. JFrog fully supports deploying Artifactory to your Kubernetes cluster to serve as a universal repository manager for all your CI/CD needs wherever they are running in your organization.

Smooth sailing

Using Helm, the Kubernetes package manager, we have created a set of customizable Helm charts. These Helm charts can be configured according to your storage, databases, and other setting needs for the different Artifactory installations, including OSS, Pro and HA. Each parameter can be overwritten from the command line, or using a custom values.yaml file. Additional Helm chart examples and templates are available in the Artifactory Docker examples GitHub repository.

Important Note: The following workflows display how to deploy Artifactory. We recommend running these workflows in your development environment prior to deploying Artifactory in production. To learn more about the full deployment process, please refer to Deploying Artifactory to Kubernetes.

Deploying a single Artifactory instance

The Artifactory Helm chart allows you to configure a single Artifactory Pro or OSS instance in the Kubernetes cluster with an external database and persistent storage that is installed outside the Kubernetes cluster.      Single Artifactory in Kubernetes

The following step-by-step workflow initializes Helm and updates your Helm client with the latest index from the official Helm charts repository.

  1. Initialize Helm, by running the following command:
    $ helm init
    $ helm repo update
    
  2. Deploy Artifactory, by running the following command:
    $ helm install stable/artifactory
  3. Configure Artifactory, by following the on-screen instructions to retrieve the Artifactory IP and URL, and then run the on-boarding wizard to setup your newly deployed Artifactory.

Refer to these additional configuration options to further customize your deployment.

Artifactory Helm Chart can be configured with many options.

For example, deploy Artifactory OSS, by running the following command:

$ helm install \
  --set artifactory.image.repository=”docker.bintray.io/jfrog/artifactory-oss” \
  stable/artifactory

Deploying Artifactory HA

The Artifactory High Availability Helm chart allows you to deploy an Artifactory HA cluster using three nodes: a primary node and two member nodes.

Artifactory in Kubernetes

 The following steps configure Artifactory HA using Helm:

  1. Clone the Git repository, by running the following command:
    $ git clone https://github.com/JFrogDev/artifactory-docker-examples.git
  2. Deploy Artifactory HA, using the artifactory-ha chart with the following configuration:
    – An Artifactory HA cluster containing one primary node and two member nodes.
    – A PostgreSQL database.
    – An Nginx for SSL, load balancing and reverse proxy configurations.

    $ cd artifactory-docker-examples/kubernetes/helm/artifactory-ha
    $ helm init
    $ helm repo update
    $ helm dependency update
    $ helm install
  3. Customize your deployment, using the following configuration options.

Artifactory as your Helm chart repository

Not only can you deploy Artifactory using Helm but Artifactory can also serve as your Helm Chart repository. It provides secure, private, local Helm repositories to share Helm charts across your organization with fine-grained access control. Proxy and cache public Helm resources with remote repositories, and aggregate local and remote resources under a single virtual Helm repository to access all your Helm charts from a single URL.Artifactory in Kubernetes

⎈ Happy Helming! ⎈

Embark on your voyage with Artifactory and Helm today.