Exciting news for Kubernetes storage management! NetApp Trident 26.06.1 is now available in Preview for use with Google Cloud NetApp Volumes (GCNV) ONTAP-mode. This update enables Trident to create and manage your Kubernetes volumes when your GCNV storage pool is in ONTAP-mode!
Why ONTAP-mode?
While Flex Unified default mode provides excellent dynamic storage provisioning and management capabilities, many enterprise workloads demand deeper data management capabilities only available with GCNV Flex Unified ONTAP-mode. With the introduction of the Trident integration with ONTAP-mode, Trident can now interface with Google Cloud NetApp Volumes storage pools created with the ONTAP-mode option, and brings additional Trident features to your Kubernetes applications, including:
- Custom file names: Enhanced security and compliance auditing.
- SnapMirror Integration: Facilitating disaster recovery with volume replication.
- Clone across namespaces: Enabling consistent snapshots across multiple volumes.
- Volume Group snapshots: Enables ontap-mode consistency groups
- NFS v4.2 Support: Bringing updated protocol support for your workloads.
How to Set It Up
To get started with ONTAP-mode, ensure you are using Trident version 26.06.1 or later. This example is created on GKE using Trident Cloud Identity, although other Kubernetes distributions may be used with a secret.
Step 1 - Create your GCNV Storage Pool
Ensure your Google Cloud NetApp Volumes storage pool is created with the ontap-mode option. Note that the storage pool must be created outside of Trident (e.g., via the Google Cloud console or gcloud CLI). A sample on the console is shown below.
The pool will come up.
Step 2. Create a GKE cluster and Install Trident
In order to use cloud identity with Trident, you must first create a GCP service account with Google Cloud NetApp Volumes Admin role. This service account will later be linked to the trident-controller kubernetes service account. You must also enable workload identity when creating your standard GKE cluster. More information on how to set this up is in Deploying cloud identity with Trident, GKE, and Google Cloud NetApp Volumes steps 1 and 2.
Install Trident using cloud identity. An example using helm is shown below. Replace <service account> and <project name> with your values.
~$helm install trident netapp-trident/trident-operator --version 100.2606.1 --create-namespace --namespace trident --set cloudProvider="GCP" --set cloudIdentity="'iam.gke.io/gcp-service-account: <service account>@<project name>.iam.gserviceaccount.com'"
Check to be sure Trident is up and running:
~$kubectl get pods -n trident
NAME READY STATUS RESTARTS AGE
trident-controller-67f7cd9bf8-2ffl5 6/6 Running 0 3m
trident-node-linux-2r82s 2/2 Running 0 2m59s
trident-node-linux-f8gnh 2/2 Running 0 2m59s
trident-node-linux-jwqzn 2/2 Running 0 2m59s
trident-operator-5cbf7f857-ktj2n 1/1 Running 0 3m26s
After the trident pods are up and running, you must bind the GCP service account to the trident controller, and annotate the trident controller service account. More information can be found in Deploying cloud identity with Trident, GKE, and Google Cloud NetApp Volumes Steps 4 and 5.
Step 3. Create a secret.
If you are using Trident Cloud Identity with GKE, you must create an empty secret as shown below.
empty_secret.yaml
apiVersion: v1 kind: Secret metadata: name: gcnv-ontap-empty namespace: trident type: Opaque |
|---|
If you are not using Cloud Identity, the secret must contain credentials to create volumes on GCNV. Obtain a key from a GCP service account that has GoogleCloud NetApp Volumes Admin role assigned to it and information from the key is entered into the secret. A sample secret is located in the Trident documentation.
Apply the secret.
~$kubectl create -f empty_secret.yaml
secret/gcnv-ontap-empty created
~$kubectl get secret -n trident
NAME TYPE DATA AGE
gcnv-ontap-empty Opaque 0 8s
sh.helm.release.v1.trident.v1 helm.sh/release.v1 1 5m12s
trident-csi Opaque 6 4m45s
trident-encryption-keys Opaque 1 4m45s
Step 4. Configure and apply the Trident Backend:
Create a TridentBackendConfig manifest. You will use the ontap-nas or ontap-san drivers depending on if you need file or block volumes. In this example, we will use ontap-nas to create an NFS volume in us-central1-a. Change the poolID to the name of the pool.
backend.yaml
apiVersion: trident.netapp.io/v1
kind: TridentBackendConfig
metadata:
name: tbc-gcnv-ontap
namespace: trident
spec:
version: 1
storageDriverName: ontap-nas # Or san, depending on your needs
backendName: ontap-mode-backend
useREST: true
credentials:
name: gcnv-ontap-empty
type: secret
gcnv:
proxyURL: "https://netapp.googleapis.com"
projectNumber: '<insert-project-number>'
location: us-central1-a
poolID: ontap-mode-pool
~$kubectl create -f backend.yaml -n trident
tridentbackendconfig.trident.netapp.io/tbc-gcnv-ontap created
Step 5. Create Storage Classes:
Define a Kubernetes StorageClass that points to your new Trident backend. The backendType is the trident driver, ontap-nas. If you are using san, it would be ontap-san. We use nas as an example below.
scontap.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gcnv-flex-k8s-nfs-ontap
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: csi.trident.netapp.io
parameters:
backendType: "ontap-nas"
trident.netapp.io/nasType: "nfs"
allowVolumeExpansion: true
~$kubectl apply -f scontap.yaml
storageclass.storage.k8s.io/gcnv-flex-k8s-nfs-ontap created
Step 6. Deploy PVC and Applications:
Deploy your applications using Persistent Volume Claims (PVCs) that reference this storage class. Trident will automatically handle the provisioning of volumes within your ontap-mode storage pool.
pvcnfs.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-nas
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: gcnv-flex-k8s-nfs-ontap
~$kubectl create -f pvcnfs.yaml
persistentvolumeclaim/pvc-nas created
~$kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
pvc-nas Bound pvc-8fc7d774-789a-4b00-bb01-59e57e96ef2a 10Gi RWX gcnv-flex-k8s-nfs-ontap <unset> 13s
You can then attach your application pods to the PVC for persistent storage.
What now?
The integration of ONTAP-mode into NetApp Trident brings enterprise-grade data management directly into your Kubernetes environments on Google Cloud NetApp Volumes. By bridging these capabilities, you can now leverage extra ONTAP-mode features in Kubernetes, all while maintaining the simplicity of dynamic storage provisioning within your Kubernetes clusters. This preview release marks a significiant step forward for workloads requiring robust, native ONTAP configuration and data control within the Google Cloud ecosystem. Try it out today!