How to provision better storage and enhance cluster deployments on Red Hat OpenShift Service on AWS with Amazon FSx for NetApp ONTAP

Learn how to create container applications and virtual machines on Red Hat® OpenShift® Service on AWS clusters using Internet Small Computer System Interface (iSCSI) volumes with Amazon FSx for NetApp ONTAP. Provision better storage and enhance your cluster deployments.

Authors: Mayur Shetty, Principal Ecosystem Solution Architect, Red Hat and Banu Sundhar, Senior Technical Marketing Engineer, NetApp

Learn how to create container applications and virtual machines on Red Hat® OpenShift® Service on AWS clusters using Internet Small Computer System Interface (iSCSI) volumes with Amazon FSx for NetApp ONTAP. Provision better storage and enhance your cluster deployments.

Authors: Mayur Shetty, Principal Ecosystem Solution Architect, Red Hat and Banu Sundhar, Senior Technical Marketing Engineer, NetApp

Using iSCSI storage for container apps on ROSA

15 mins

On Red Hat® OpenShift® Service on AWS (ROSA), Trident (NetApp's storage orchestrator for Kubernetes) integrates with Internet Small Computers System Interface (iSCSI). This integration automates the process of provisioning iSCSI volumes for containers and makes it easier for developers to request and use persistent storage.

What will you learn?

  • How to deploy a Postgresql application using iSCSI storage class

What you need before starting:

Deploy a PostgreSQL application using iSCSI storage class

Use the following yaml to deploy the postgreSQL app. 

  1. Inspect the setup file using the command #cat postgres-san.yaml 

    a. Review the PostgreSQL database application:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: postgres
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: postgres
      template:
        metadata:
          labels:
            app: postgres
        spec:
          containers:
          - name: postgres
            image: postgres:14
            env:
            - name: POSTGRES_USER
              #value: "myuser"
              value: "admin"
            - name: POSTGRES_PASSWORD
              #value: "mypassword"
              value: "adminpass"
            - name: POSTGRES_DB
              value: "mydb"
            - name: PGDATA
              value: "/var/lib/postgresql/data/pgdata"
            ports:
            - containerPort: 5432
            volumeMounts:
            - name: postgres-storage
              mountPath: /var/lib/postgresql/data
          volumes:
          - name: postgres-storage
            persistentVolumeClaim:
              claimName: postgres-pvc

    b. Request dedicated digital storage “sc-fsx-san”

     ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: postgres-pvc
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 5Gi
      storageClassName: sc-fsx-san

    c. Create a stable network address to connect to your database 

    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: postgres
    spec:
      selector:
        app: postgres
      ports:
      - protocol: TCP
        port: 5432
        targetPort: 5432
      type: ClusterIP
    

    d. Create a dedicated space and run the setup commands

    #oc create namespace postgres-san
    root@localhost HAFSX]# oc create -f postgres-san.yaml -n postgres-san
    deployment.apps/postgres created
    persistentvolumeclaim/postgres-pvc created
    service/postgres created
  2. Verify that the application pod is running and that a PVC and PV are created for the application. 

     Figure 1: command #oc create -f postgres-san.yaml is returned with name, ready, status, restarts, age columns. Status result for persistentvolumeclaim/postgres-pvc shows Bound.

    a. Note:  the storage class for the PVC uses the san storage class previously created using iSCSI.

  3. Verify that iSCSi sessions are created in the node where the pod runs.
    Figure 2: The command # oc get pods -n postgres-san -o wide shows ready, status, restart, age, IP, and node results

    Figure 3: Screenshot of command line interface showing the oc debug command being applied to the node, with results showing that an iSCSI session is currently running on it.
     
  4. Verify that a lun is created on the volume in FSxN  for this application and the lun is mapped. You can log into the FSxN CLI using fsxadmin and the password you previously created.
    Figure 4: screenshot shows the volumes and luns belonging to the vserver fsx.

    Figure 5: screenshot shows the path of the lun within the volume.


You have now successfully deployed a Postgresql application using iSCSI storage class!

Previous resource
Setting up Amazon FSxN with iSCSI storage
Next resource
Using iSCSI storage for VMs on Red Hat OpenShift Virtualization in ROSA

This learning path is for operations teams or system administrators

Developers may want to check out Transitioning to ROSA HCP on developers.redhat.com. 

Get started on developers.redhat.com

Hybrid Cloud Logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy, sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2025 Red Hat