Ping Identity Devops

Saving Your Configuration Changes

To save any configuration changes you make when using the products in the stack, you must set up a local Docker volume to persist state and data for the stack. If you don’t do this, whenever you bring the stack down, your configuration changes will be lost.

Mount a Docker volume to the directory in the container where your configuration changes are written. The location must be to a directory you haven’t already created. Our Docker containers use the /opt/out directory to store application data.

For PingFederate, mount the volume to /opt/out/instance/server/default/data — the directory where the PingFederate Admin console writes its configuration. This is the path recommended in Operating patterns for PingFederate in Kubernetes and elsewhere in our documentation.

Mounting a volume to all of /opt/out also persists your changes, but it isn’t recommended for PingFederate. A full /opt/out mount shadows files that ship inside the image, so image updates and upgrades can behave unexpectedly — for example, new software bits won’t include special files built into the Docker image, and the volume keeps serving stale versions of files the new image expects to own. Restricting the mount to the data directory keeps image-delivered files (such as templates and conf files) under the image’s control while persisting only what you change through the Admin console.

Make sure the local directory isn’t already created. Docker needs to create this directory for the mount to work. If the directory already exists, don’t reuse one that holds files from a different product or image version — leftover files can conflict with what the image writes during startup.

You can mount a Docker volume for containers in a stack or for standalone containers.

Bind mounting for a stack

  1. Add a volumes section under the container entry for each product in the docker-compose.yaml file you’re using for the stack.

  2. Under the volumes section, add a location to persist your data. For PingFederate, mount to the data directory as recommended above. For example:

    pingfederate:
      volumes:
        - /tmp/compose/pingfederate_1:/opt/out/instance/server/default/data
  3. In the environment section, comment out the SERVER_PROFILE_PATH setting.

    The container then uses your volumes entry to supply the product state and data, including your configuration changes.

    When the container starts, this mounts /tmp/compose/pingfederate_1 to the /opt/out/instance/server/default/data directory in the container. You can also view the product logs and data in the /tmp/compose/pingfederate_1 directory.

  4. Repeat this process for the remaining container entries in the stack.

Bind mounting for a standalone container

Add a volume entry to the docker run command:

docker run \
  --name pingfederate \
  --volume <local-path>:/opt/out/instance/server/default/data \
  pingidentity/pingfederate:edge

Getting started with Docker Compose mounts

Within many of the docker-compose.yaml files in the Getting-Started repository, volume mounts have been included to persist your configuration across container restarts.

  • To view the list of persisted volumes, enter:

    docker volume list
  • To view the contents of the /opt/out/ directory when the container is running, enter:

    docker container exec -it <container id> sh
    cd out
  • To view the contents of the persisted volume when the container is stopped, enter:

    docker run --rm -i -v=<volume name>:/mnt alpine ls /mnt
  • To remove a volume, enter:

    docker volume rm <volume name>
  • To copy files from the container to your local filesystem, enter:

    docker cp \
      <container id>:<source path> \
      <destination path>
    eg.
    docker cp \
      b867054293a1:/opt/out/instance/server/default/data \
      ~/pingfederate/
  • To copy files from your local filesystem to the container, enter:

    docker cp \
      <source path> \
      <container id>:<destination path>
    eg.
    docker cp \
      myconnector.jar \
      bb867054293a186:/opt/out/instance/server/default/deploy/

Persistent volumes in a Helm deployment

In Kubernetes, persist configuration with a persistent volume claim (PVC) on the PingFederate Admin console workload, rather than bind mounts. The Admin console is the only workload that needs a PVC: it writes the configuration that engine nodes replicate from it at startup. For the full discussion of this pattern, see Operating patterns for PingFederate in Kubernetes.

In your Helm values file, enable a persistent volume for pingfederate-admin and set the mountPath to the PingFederate data directory:

pingfederate-admin:
  enabled: true
  container:
    replicaCount: 1
  envs:
    SERVER_PROFILE_URL: https://github.com/pingidentity/pingidentity-server-profiles.git
    SERVER_PROFILE_PATH: getting-started/pingfederate
  workload:
    type: StatefulSet
    statefulSet:
      persistentvolume:
        enabled: true
        volumes:
          out-dir:
            mountPath: /opt/out/instance/server/default/data
            persistentVolumeClaim:
              accessModes:
                - ReadWriteOnce
              resources:
                requests:
                  storage: 8Gi

pingfederate-engine:
  enabled: true
  container:
    replicaCount: 2
  envs:
    SERVER_PROFILE_URL: https://github.com/pingidentity/pingidentity-server-profiles.git
    SERVER_PROFILE_PATH: getting-started/pingfederate

Key points:

  • The workload type must be StatefulSet for the admin console — persistent volumes on workload.statefulSet.persistentvolume are supported for StatefulSet workloads only.

  • mountPath: /opt/out/instance/server/default/data persists exactly the configuration the Admin console writes. Files outside this directory (templates, conf files, deployed JARs delivered by the image or server profile) remain owned by the image and are refreshed when you deploy a new image version.

  • Engine nodes need no PVC. They replicate configuration from the Admin console at startup.

  • With a PVC in place, you no longer need SERVER_PROFILE_PATH to carry your configuration, but you can keep a server profile for files delivered outside the data directory (adapter JARs, extensions). Don’t include instance/bulk-config/data.json or instance/server/default/data in the profile when using this pattern.

Install or upgrade the release with your values file:

helm upgrade --install demo pingidentity/ping-devops -f your-values.yaml

This values structure matches the 30-helm/pingfederate-upgrade/02-upgraded.yaml example in the Getting-Started repository and the data-mount pattern in Operating patterns for PingFederate in Kubernetes.

If you’re using the PingFederate Flex images (pingfederate:NN.N-alpine-flex), the durable path is /opt/pingidentity/runtime/server/default/data instead of /opt/out/instance/server/default/data, and the PVC must be seeded on first start. See Migrate PingFederate to Flex Images and the 30-helm/pingfederate-flex examples.