Panfactum LogoPanfactum
Panfactum VersioningUpgradingGeneral Guide

General Upgrade Steps

This guide takes you through the recommended steps to take when upgrading your Panfactum version.

Before you being, please ensure you have reviewed the guide for pinning the Panfactum version.

Review the Changelogs

Some version upgrades require taking specific actions that we call out in the new release's changelog. Make sure you have reviewed the changes and understand what steps you need to take.

Update Local Development Environment

  1. Update the version in your flake.nix file.

    {
        inputs = {
            flake-utils.url = "github:numtide/flake-utils";
    -       panfactum.url = "github:NixOS/nixpkgs/old-version";
    +       panfactum.url = "github:NixOS/nixpkgs/new-version";
        };
        ...
    }
    
  2. Run nix flake update. This will update your lockfile and then download the new versions of all utilities.

  3. If you receive some warnings when your devShell reloads, run the recommended commands to update your repo files.

Update your Infrastructure

  1. Update the provider versions in your first-party IaC modules to match the required provider versions in the new release:

    terraform {
      required_providers {
        kubernetes = {
          source  = "hashicorp/kubernetes"
    -     version = "old-version"
    +     version = "new-version"
        }
      }
    }
    
  2. Update the pf_stack_version terragrunt variable in only your lowest environment level: 1

    environment: "development"
    - pf_stack_version: "old-version"
    + pf_stack_version: "new-version"
    
  3. Ensure that the terragrunt version for that environment is set to local in order to deploy the local changes from step 1 (review these docs). 2

  4. Run pf-tf-init in the environment's Terragrunt directory to automatically upgrade your module.yaml and .terraform.lock.hcl files for every module.

  5. On your local machine, run terragrunt apply across all modules in that environment. You can run terragrunt run-all apply to update all modules at once. 3

  6. Check to ensure that the environment is functioning as expected.

  7. Once you are satisfied, cut a new release of your stack repository indicating you have updated the Panfactum version.

  8. Repeat step 2-5 for all environments in sequence, testing each environment before moving on to the next. For step 3, set the version to the release ref that you created in step 6.

Footnotes

  1. Typically your "integration" environment which is frequently named development

  2. Ideally in your environment.user.yaml

  3. We strongly recommend doing this locally rather than relying on CI / CD as upgrades are sensitive operations.