# Configuration

# Create a secret

Create a secret to store the Nimble access information.

> kubectl create --f secret.yaml

A sample file is as follows.

apiVersion: v1
kind: Secret
metadata:
  name: nimble-secret
  namespace: kube-system
stringData:
  serviceName: nimble-csp-svc
  servicePort: "8080"
  backend: 192.168.1.1
  username: admin
data:
  # echo -n admin | base64
  password: YWRtaW4=

# Creating a Storage class

A  Storage class specifies the provisioner to use the HPE CSI Driver and the volume parameters (such as Protection Templates, Performance Policies, CPG, and so on) of the volume that we want to create and can be used to differentiate between storage levels and usage. This concept is sometimes called "profiles" in other storage systems. A cluster can have multiple StorageClasses allowing users to create storage claims tailored for their specific application requirements.Create a hpe-standard StorageClass based upon the CSP deployed.

Create a storage class with following commands.

> kubectl create --f hpe-standard-sc.yaml

A sample storage class with parameters is as follows.

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: hpe-standard
  annotations:
    storageclass.kubernetes.io/is-default-class: "false"
provisioner: csi.hpe.com
parameters:
  csi.storage.k8s.io/fstype: xfs
  csi.storage.k8s.io/provisioner-secret-name: nimble-secret
  csi.storage.k8s.io/provisioner-secret-namespace: kube-system
  csi.storage.k8s.io/controller-publish-secret-name: nimble-secret
  csi.storage.k8s.io/controller-publish-secret-namespace: kube-system
  csi.storage.k8s.io/node-stage-secret-name: nimble-secret
  csi.storage.k8s.io/node-stage-secret-namespace: kube-system
  csi.storage.k8s.io/node-publish-secret-name: nimble-secret
  csi.storage.k8s.io/node-publish-secret-namespace: kube-system
  csi.storage.k8s.io/controller-expand-secret-name: nimble-secret
  csi.storage.k8s.io/controller-expand-secret-namespace: kube-system
  performancePolicy: "SQL Server"
  description: "Volume from HPE CSI Driver"
  accessProtocol: iscsi
  limitIops: 76800
  allowOverrides: description,limitIops,performancePolicy
allowVolumeExpansion: true

Note

In HPE Ezmeral Container Platform deployment, default storage class is defined by HPE Ezmeral Data Fabric.

# Creating a Persistent Volume Claim

With a Storage Class available, we can create a PVC to request an amount of storage for our application. The command to create PVC and its output are as follows.

> kubectl create -f pvc.yaml

A sample PVC is as follows.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi
storageClassName: hpe-standard