Artifactory Helm Upgrade

Upgrade Artifactory on Kubernetes using Helm charts with single-command declarative version updates.

Helm is the package manager for Kubernetes. Helm charts are packages of pre-configured Kubernetes resources, allowing you to define, install, and upgrade applications like Artifactory with a single command. Using Helm charts to upgrade Artifactory provides a streamlined and declarative method for deployment.

Choose your environment below to get started:

Upgrade Artifactory using Helm with Bundled PostgreSQL

This topic details the critical steps and checks required when upgrading an Artifactory instance that uses the bundled PostgreSQL database.

Preparation and Pre-Upgrade Checks

To ensure a smooth upgrade, consider the following:

  • Backup Your Data: We strongly recommend performing a full backup of your Artifactory data directory ($JFROG_HOME/artifactory/var) and database before starting the upgrade. This allows recovery in case of unexpected issues.
  • Review Release Notes: Always check the Artifactory Release Notes for the target version. They may contain critical information, breaking changes, or specific pre-upgrade tasks not covered here.
  • Downtime: In a single-node setup, the Artifactory service is unavailable to users during the upgrade. In High Availability (HA) mode, a rolling upgrade ensures only one node is down at a time, so the service remains available.

Pre-Upgrade Steps for Bundled PostgreSQL

Complete the following steps before upgrading Artifactory to 7.111.x, because the bundled PostgreSQL chart has been upgraded to version 15.5.20 in the latest artifactory and artifactory-ha Helm charts.

Step 1: Backup and Delete
  1. Create a backup of your credentials, including the PostgreSQL password and used PVCs.

  2. Delete the PostgreSQL statefulset and secret.

    kubectl delete statefulsets.apps postgresql-postgresql --namespace <namespace> --cascade=orphan
    kubectl delete secret postgresql --namespace <namespace>

For more information, see How to upgrade to version 11.0.0.

Step 2: Get Image Tag

To ensure a successful upgrade, the custom-values.yaml file must include the 'postgresql.image.tag from the previous chart instead of the one from the latest chart.

  1. Get the current image tag of your PostgreSQL pod by running the following command:

    $ kubectl get pod {{ .Release.Name }}-postgresql-0 --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.containers[*].image}";
  2. Copy the version from the output and set the following in your custom-values.yaml file in the 'postgresql' section.

    postgresql:
      image:
        tag: <postgresql_version>
Step 3: Update PostgreSQL Configurations in custom-values.yaml

The configurations in the *postgresql* section of the artifactory and artifactory-ha charts do not align with the new structure of the latest PostgreSQL chart. For a successful upgrade, include the new configurations in your custom-values.yaml file of the artifactory or artifactory-ha chart.

For example, in the previous version of the Artifactory charts, the key for the PostgreSQL password in the Kubernetes secret was postgresqlPassword. In the latest versions, this key has changed to password. This change causes upgrade failures if custom-values.yaml or related configurations still reference the old key.

The following sections show an example of the changes in configurations in Artifactory’s previous and latest charts:

Previous Chart

postgresql:
  enabled: true
  image:
    registry: releases-docker.jfrog.io
    repository: bitnami/postgresql
    tag: 15.6.0-debian-11-r16
  postgresqlUsername: artifactory
  postgresqlPassword: ""
  postgresqlDatabase: artifactory
  postgresqlExtendedConf:
    listenAddresses: "*"
    maxConnections: "1500"
  persistence:
    enabled: true
    size: 200Gi
  service:
    port: 5432
  primary:
    nodeSelector: {}
    affinity: {}
    tolerations: []
  readReplicas:
    nodeSelector: {}
    affinity: {}
    tolerations: []
  resources: {}
  securityContext:
    enabled: true
  containerSecurityContext:
    enabled: true

Latest Chart

postgresql:
  enabled: true
  image:
    registry: releases-docker.jfrog.io
    repository: bitnami/postgresql
    tag: 16.6.0-debian-12-r2

  auth:
    username: "artifactory"
    password: ""
    database: "artifactory"
  primary:
    extendedConfiguration: |
      listen_addresses = '*'
      max_connections = 1500
    persistence:
      enabled: true
      size: 200Gi
    service:
      ports:
        postgresql: 5432
    resourcesPreset: "small"
    resources: {}
    nodeSelector: {}
    affinity: {}
    tolerations: []
  readReplicas:
    nodeSelector: {}
    affinity: {}
    tolerations: []
  securityContext:
    enabled: true
  containerSecurityContext:
    enabled: true

Upgrading a Single Node

To upgrade a single-node Artifactory deployment:

  1. Use the following command to upgrade.

    helm upgrade artifactory --namespace artifactory jfrog/artifactory
  2. If Artifactory was installed without providing a value to postgresql.auth.password (if the password was auto-generated), run the following command to get the current password:

    POSTGRES_PASSWORD=$(kubectl get secret -n <namespace> <myrelease>-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)
  3. Upgrade the release using the helm upgrade command. If you retrieved an auto-generated password, pass it in the command as shown below:

    helm upgrade <myrelease> jfrog/artifactory --set postgresql.auth.password=${POSTGRES_PASSWORD} --namespace <namespace>

    This applies any configuration changes on your existing deployment.

Upgrading an HA Setup

The upgrade process for an HA setup depends on which Helm chart was used for the initial installation.

  1. Use the following command to upgrade.

    helm upgrade artifactory --namespace artifactoryha jfrog/artifactory
  2. If Artifactory was installed without providing a value to postgresql.auth.password (if the password was auto-generated), run the following command to get the current password.

    POSTGRES_PASSWORD=$(kubectl get secret -n <namespace> <myrelease>-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)
  3. Upgrade the release by passing the previously auto-generated secret:

    helm upgrade <myrelease> --namespace artifactory jfrog/artifactory --set postgresql.auth.password=${POSTGRES_PASSWORD}

    This applies any configuration changes on your existing deployment.

Upgrade Artifactory using Helm with External Database

This topic covers the upgrade process for Artifactory when you are using an external database.

If you want to upgrade from any version lower than 7.x, see Upgrading Artifactory from 6.10.x to 7.x.

Preparation and Pre-Upgrade Checks

To ensure a smooth upgrade, consider the following:

  • Backup Your Data: We strongly recommend performing a full backup of your Artifactory data directory ($JFROG_HOME/artifactory/var) and database before starting the upgrade. This allows recovery in case of unexpected issues.
  • Review Release Notes: Always check the Artifactory Release Notes for the target version. They may contain critical information, breaking changes, or specific pre-upgrade tasks not covered here.
  • Downtime: In a single-node setup, the Artifactory service is unavailable to users during the upgrade. In High Availability (HA) mode, a rolling upgrade ensures only one node is down at a time, so the service remains available.

Upgrading a Single Node

Run the helm upgrade command to upgrade your single-node Artifactory deployment.

  • Run the following command:

    helm upgrade artifactory --namespace artifactory jfrog/artifactory

Upgrading an HA Setup

To upgrade an HA deployment with an external database that was originally installed using the artifactory chart, run the helm upgrade command.

  • Run the following command:

    helm upgrade artifactory --namespace artifactoryha jfrog/artifactory

Troubleshooting and Post-Upgrade Notes

  • Database Migrations: During the first startup after an upgrade, Artifactory may run database converters to execute changes in the database schema.