vania-janet/multiturn-rag-retrieval-data huggingface dataset:
image: quay.io/k8scsi/livenessprobe:v2.0.0
name: liveness-probe
securityContext:
runAsNonRoot: false
runAsUser: 0
privileged: false
resources:
limits:
cpu: 50m
memory: 50Mi
requests:
cpu: 5m
memory: 10Mi
volumeMounts:
- mountPath: /csi
name: plugin-dir
serviceAccountName: ibm-vpc-block-node-sa
tolerations:
- operator: Exists
volumes:
- hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
name: registration-dir
- hostPath:
path: /var/lib/kubelet
type: Directory
name: kubelet-data-dir
- hostPath:
path: /var/lib/kubelet/plugins/vpc.block.csi.ibm.io/
type: DirectoryOrCreate
name: plugin-dir
- hostPath:
path: /dev
type: Directory
name: device-dir
- hostPath:
path: /etc/udev
type: Directory
name: etcudevpath
- hostPath:
path: /run/udev
type: Directory
name: runudevpath
- hostPath:
path: /lib/udev
type: Directory
name: libudevpath
- hostPath:
path: /sys
type: Directory
name: syspath
- name: customer-auth
secret:
secretName: storage-secret-store
- configMap:
name: cluster-info
name: cluster-info
- apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
version: 2.0.3_354
labels:
addonmanager.kubernetes.io/mode: Reconcile
path: /
port: 9080
initialDelaySeconds: 45
periodSeconds: 5
volumeMounts:
- name: pvmount
mountPath: /test
volumes:
- name: pvmount
persistentVolumeClaim:
claimName: wasliberty
---

apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: wasliberty
spec:
maxUnavailable: 1
selector:
matchLabels:
app: wasliberty
---

apiVersion: v1
kind: Service
metadata:
name: wasliberty
labels:
app: wasliberty
spec:
ports:
- port: 9080
selector:
app: wasliberty
type: NodePort
---

apiVersion: v1
kind: ConfigMap
metadata:
name: wasliberty
labels:
app: wasliberty
data:
VERSION: "1.0"
LANGUAGE: en
---

apiVersion: v1
kind: Secret
metadata:
name: wasliberty
labels:
app: wasliberty
type: Opaque
data:
username: dXNlcm5hbWU=
password: cGFzc3dvcmQ=
---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wasliberty
annotations:
volume.beta.kubernetes.io/storage-class: "ibmc-file-bronze"
labels:
billingType: "hourly"
app: wasliberty
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 24Gi
Show more





 Packaging apps for reuse in multiple environments with Kustomize
name: wasliberty
labels:
app: wasliberty
type: Opaque
data:
username: dXNlcm5hbWU=
password: cGFzc3dvcmQ=
Show more





 Persistent volumes for container storage 

Persistent volumes (PVs) interface with physical storage to provide persistent data storage for your container workloads.

The following example shows how you can add persistent storage to your app. To provision persistent storage, you create a persistent volume claim (PVC) to describe the type and size of file storage that you want to have. After you create the PVC, the persistent volume and the physical storage are automatically created by using [dynamic provisioning](https://cloud.ibm.com/docs/containers?topic=containers-kube_conceptsdynamic_provisioning). By referencing the PVC in your deployment YAML, the storage is automatically mounted to your app pod. When the container in your pod writes data to the /test mount path directory, data is stored on the NFS file storage instance.



* For more information, see [Understanding Kubernetes storage basics](https://cloud.ibm.com/docs/containers?topic=containers-kube_conceptskube_concepts).
* For options on other types of storage that you can provision, see [Planning highly available persistent storage](https://cloud.ibm.com/docs/containers?topic=containers-storage-plan).



apiVersion: apps/v1
kind: Deployment
metadata:
name: wasliberty
spec:
replicas: 3
template:
...
spec:
...
containers:
- name: wasliberty
...
volumeMounts:
- name: pvmount
mountPath: /test
volumes:
- name: pvmount
persistentVolumeClaim:
claimName: wasliberty
...
---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wasliberty
annotations:
ibm.io/mpath=3600a09803830445455244c4a38754c66
ibm.io/nodeip=10.176.48.67
ibm.io/password=R6lqLBj9al6e2lbp
ibm.io/targetip=161.26.98.114
ibm.io/username=IBM02SU1543159-I106288771
kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"PersistentVolume","metadata":{"annotations":{"ibm.io/iqn":"iqn.2018-09.com.ibm:ibm02su1543159-i106288771","ibm.io/lunid":"0"...
Finalizers: []
StorageClass: ibmc-block-attacher
Status: Available
Claim:
Reclaim Policy: Retain
Access Modes: RWO
Capacity: 20Gi
Node Affinity: <none>
Message:
Source:
Type: HostPath (bare host directory volume)
Path: /
HostPathType:
Events: <none>

The block storage device is successfully attached when the ibm.io/dm is set to a device ID, such as /dev/dm/1, and you can see ibm.io/attachstatus=attached in the Annotations section of your CLI output.



If you want to detach a volume, delete the PV. Detached volumes are still authorized to be accessed by a specific worker node and are attached again when you create a new PV with the IBM Cloud Block Volume Attacher storage class to attach a different volume to the same worker node. To avoid attaching the old detached volume again, unauthorize the worker node to access the detached volume by using the ibmcloud sl block access-revoke command. Detaching the volume does not remove the volume from your IBM Cloud infrastructure account.
Make a POST /instances request to create an instance, and define the volume by using the volume_attachments parameter. Specify a volume name, capacity, and profile. Also, specify generation=2 in the request.

Valid volume names can include a combination of lowercase alpha-numeric characters (a-z, 0-9) and the hyphen (-), up to 63 characters. Volume names must begin with a lowercase letter. Volume names must be unique across the entire VPC infrastructure. For example, if you create two volumes with the same name in the same account and region, a "volume name duplicate" error is triggered.

This example specifies customer-managed encryption and user tags for the boot and data volumes.

curl -X POST "$vpc_api_endpoint/v1/instances?version=2022-06-14&generation=2" -H "Authorization: $iam_token" -d '{
"boot_volume_attachment": {
"volume": {
"encryption_key": {
"crn": "crn:[...]"
},
"name": "my-boot-volume",
"profile": {
"name": "general-purpose"
},
"user_tags": {
"env:test",
"env:prod"
}
}
},
"image": {
"id": "9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366"
},
"keys": [
{
"id": "363f6d70-0000-0001-0000-00000013b96c"
}
],
"name": "my-instance",
"placement_target": {
"id": "0787-8c2a09be-ee18-4af2-8ef4-6a6060732221"
},
"primary_network_interface": {
* UI
* CLI
* Terraform







 Connecting to iSCSI LUNs on CloudLinux 

Follow these instructions to mount your iSCSI LUN with multipath on a CloudLinux Server release 6.10.

If multiple hosts mount the same Block Storage for Classic volume without being cooperatively managed, your data is at risk for corruption. Volume corruption can occur if changes are made to the volume by multiple hosts at the same time. You need a cluster-aware, shared-disk file system to prevent data loss such as Microsoft® Cluster Shared Volumes (CSV), Red Hat Global File System (GFS2), VMware® VMFS, and others. For more information, see your host's OS Documentation.

It's best to run storage traffic on a VLAN, which bypasses the firewall. Running storage traffic through software firewalls increases latency and adversely affects storage performance. For more information about routing storage traffic to its own VLAN interface, see the [FAQs](https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-block-storage-faqshowtoisolatedstorage).

Before you start, make sure the host that is accessing the IBM Cloud® Block Storage for Classic volume is authorized correctly.



 Authorizing the host in the UI 



1. Log in to the [IBM Cloud console](https://cloud.ibm.com/login). From the menu![Menu icon](https://cloud.ibm.com/docs-content/v1/content/14cf2f2f32b430cf4ed67ad14b3cecc010f91c45/icons/icon_hamburger.svg), select Classic Infrastructure![Classic icon](https://cloud.ibm.com/docs-content/v1/content/14cf2f2f32b430cf4ed67ad14b3cecc010f91c45/icons/classic.svg).
2. Click Storage > Block Storage for Classic.
3.
osdStorageClassName: <osdStorageClassName> For multizone clusters, specify a storage class with a waitForFirstConsumer volume binding mode
osdSize: <osdSize> The OSD size is the total storage capacity of your OCS storage cluster
numOfOsd: 1
billingType: advanced
ocsUpgrade: false

Example custom resource definition for installing ODF only on specified worker nodes on a 4.8 cluster.

apiVersion: ocs.ibm.io/v1
kind: OcsCluster
metadata:
name: ocscluster-vpc Kubernetes resource names can't contain capital letters or special characters. Enter a name for your resource that uses only lowercase letters, numbers, - or .
spec:
osdStorageClassName: <osdStorageClassName> For multizone clusters, specify a storage class with a waitForFirstConsumer volume binding mode
osdSize: <osdSize> The OSD size is the total storage capacity of your OCS storage cluster
numOfOsd: 1
billingType: advanced
ocsUpgrade: false
workerNodes: Specify the private IP addresses of the worker nodes where you want to install OCS.
- <workerNodes> To get a list worker nodes, run oc get nodes.
- <workerNodes>
- <workerNodes>
2. Save the file and create the OcsCluster custom resource to your cluster.

oc create -f <ocs-cluster-filename>.yaml
3. Verify that your OcsCluster is running.

oc describe ocscluster ocscluster-vpc

Example output.

Name: ocscluster-vpc
Namespace:
Labels: <none>
Annotations: <none>
API Version: ocs.ibm.io/v1
Kind: OcsCluster
Metadata:
Creation Timestamp: 2021-03-23T20:56:51Z
Finalizers:
finalizer.ocs.ibm.io
Then, use your storage class in the metadata.annotations.volume.beta.kubernetes.io/storage-class section of your PVC. If the region and zone are specified in the storage class and the PVC, the values in the PVC take precedence.

accessMode
: Specify one of the following options.



* ReadWriteMany: The PVC can be mounted by multiple pods. All pods can read from and write to the volume.
* ReadOnlyMany: The PVC can be mounted by multiple pods. All pods have read-only access.
* ReadWriteOnce: The PVC can be mounted by one pod only. This pod can read from and write to the volume.



storage
: Enter the size of the File Storage for Classic, in gigabytes (Gi). After your storage is provisioned, you can't change the size of your File Storage for Classic. Make sure to specify a size that matches the amount of data that you want to store.

iops
: This option is available for the custom storage classes only (ibmc-file-custom / ibmc-file-retain-custom). Specify the total IOPS for the storage, selecting a multiple of 100 within the allowable range. If you choose an IOPS other than one that is listed, the IOPS is rounded up.

storageClassName
: The name of the storage class that you want to use to provision File Storage for Classic. You can choose to use one of the [IBM-provided storage classes](https://cloud.ibm.com/docs/containers?topic=containers-file_storagefile_storageclass_reference) or [create your own storage class](https://cloud.ibm.com/docs/containers?topic=containers-file_storagefile_custom_storageclass). If you don't specify a storage class, the PV is created with the default storage class ibmc-file-bronze.

If you want to use a customized storage class, create your PVC with the corresponding storage class name, a valid IOPS and size.

2. Create the PVC.
When you create a stand-alone (unattached) block storage data volume, the volume bandwidth is assigned based on volume capacity, IOPS, and volume profile. The API response for a GET /volume/{id} call shows the bandwidth for an unattached volume like the following example.

{
"active": true,
"bandwidth": 640,
"busy": false,
"capacity": 500,
"created_at": "2021-08-08T06:26:17Z",
"crn": "crn:[...]",
"encryption": "provider_managed",
"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/ccbe6fe1-5680-4865-94d3-687076a38293",
"id": "ccbe6fe1-5680-4865-94d3-687076a38293",
"iops": 5000,
"name": "my-volume-1",
"profile": {
"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose",
"name": "custom"
.
.
.
"volume_attachments": []
Show more

When you attach a secondary volume to a virtual server instance, the primary boot volume gets priority IOPS, and bandwidth allocation to ensure reasonable boot times. Boot volume IOPS and bandwidth are never reduced to be less than 3000 IOPS or 393 Mbps.

All volumes are assigned instance bandwidth proportional to their maximum bandwidth, where the sum of all volume bandwidth equals the overall "volumes" bandwidth.

In our [example](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-bandwidthvolume-adjust-bandwidth), the remaining bandwidth that is allocated on the instance for data volumes is 1,607 Mbps (2000 Mbps less 393 Mbps for the boot volume).
- name: pvmount
mountPath: /test
volumes:
- name: pvmount
persistentVolumeClaim:
claimName: wasliberty
---

apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: wasliberty
spec:
maxUnavailable: 1
selector:
matchLabels:
app: wasliberty
---

apiVersion: v1
kind: Service
metadata:
name: wasliberty
labels:
app: wasliberty
spec:
ports:
- port: 9080
selector:
app: wasliberty
type: NodePort
---

apiVersion: v1
kind: ConfigMap
metadata:
name: wasliberty
labels:
app: wasliberty
data:
VERSION: "1.0"
LANGUAGE: en
---

apiVersion: v1
kind: Secret
metadata:
name: wasliberty
labels:
app: wasliberty
type: Opaque
data:
username: dXNlcm5hbWU=
password: cGFzc3dvcmQ=
---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wasliberty
annotations:
volume.beta.kubernetes.io/storage-class: "ibmc-file-bronze"
labels:
billingType: "hourly"
app: wasliberty
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 24Gi
Show more





 Packaging apps for reuse in multiple environments with Kustomize 

As part of a [twelve-factor](https://12factor.net/), cloud-native app, you want to maintain dev-to-prod parity by setting up a continuous development and delivery pipeline that uses a common, version-controlled code base source.
kubernetes.io/storage-class
: In the spec volume claim templates metadata annotations section, enter the storage class that you want to use. Choose between the following options:



* If ibm.io/auto-create-bucket: "true": Enter the storage class that you want to use for your new bucket.
* If ibm.io/auto-create-bucket: "false": Enter the storage class that you used to create your existing bucket.



: To list existing storage classes, runoc get storageclasses | grep s3. If you don't specify a storage class, the PVC is created with the default storage class that is set in your cluster. Make sure that the default storage class uses the ibm.io/ibmc-s3fs provisioner so that your stateful set is provisioned with object storage.

storageClassName
: In the spec volume claim templates spec section, enter the same storage class that you entered in the spec.volumeClaimTemplates.metadata.annotations.volume.beta.kubernetes.io/storage-class section of your stateful set YAML.

storage
: In the spec volume claim templates spec resource requests section, enter a fictitious size for your IBM Cloud Object Storage bucket in gigabytes. The size is required by Kubernetes, but not respected in IBM Cloud Object Storage. You can enter any size that you want. The actual space that you use in IBM Cloud Object Storage might be different and is billed based on the [pricing table](https://cloud.ibm.com/objectstorage/create).
matchLabels:
app: nginx
volumeClaimTemplates:
- metadata:
name: persistent-storage
annotations:
volume.beta.kubernetes.io/storage-class: sat-gce-block-silver
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
Show more
4. Create the pod in your cluster.

oc apply -f statefulset-gce.yaml
5. Verify that the pod is deployed. Note that it might take a few minutes for your app to get into a Running state.

oc get pods

NAME READY STATUS RESTARTS AGE
statefulset-gce 1/1 Running 0 2m58s
6. Verify that the app can write to your persistent disk by logging in to your pod.

oc exec web-server -it bash
7. View the contents of the outfile file to confirm that your app can write data to your persistent storage.

cat /mnt/gce/outfile

Example output

Fri Jul 16 07:49:39 EDT 2021
Fri Jul 16 07:49:39 EDT 2021
Fri Jul 16 07:49:39 EDT 2021
8. Exit the pod.

exit







 Creating a storage assignment in the console 

If you didn't assign your configuration to a cluster or service when you created it, you can create an assignment by completing the following steps.



1. Open the [Satellite console](https://cloud.ibm.com/satellite/locations) in your browser.
2. Select the location where you created your storage configuration.
3. Click the Locations tab, then click Storage.
4. Click the storage configuration that you want to assign to a cluster group.
5. On the Configuration details page, click Create storage assignment.
6. In the Create an assignment pane, enter a name for your assignment.
7.
Volume corruption can occur if changes are made to the volume by multiple hosts at the same time. You need a cluster-aware, shared-disk file system to prevent data loss such as Microsoft® Cluster Shared Volumes (CSV), Red Hat Global File System (GFS2), VMware® VMFS, and others. For more information, see your host's OS Documentation.
* Our compute hosts have multiple network cards with different IP addresses for network redundancy and expanded bandwidth. How can we authorize them all to access the same Storage volume?

It is possible to authorize a subnet of IP addresses to access a specific Block Storage for Classic volume through the console, SLCLI, or API. To authorize a host to connect from multiple IP addresses on a subnet, complete the following steps.



 Console UI 



1. Go to [Classic Infrastructure](https://cloud.ibm.com/gen1/infrastructure/devices).
2. Click Storage > Block Storage for Classic.
3. Locate the volume and click the ellipsis ![Actions icon](https://cloud.ibm.com/icons/action-menu-icon.svg).
4. Click Authorize Host.
5. To see the list of available IP addresses, select IP address as the host type. Then, select the subnet where your host resides.
6. From the filtered list, select one or more IP addresses that can access the volume and click Save.







 SLCLI 

 slcli block subnets-assign -h
Usage: slcli block subnets-assign [OPTIONS] ACCESS_ID
Assign block storage subnets to the given host id.
access_id is the host_id obtained by: slcli block access-list <volume_id>

Options:
--subnet-id INTEGER ID of the subnets to assign; e.g.: --subnet-id 1234
-h, --help Show this message and exit.



* How many volumes can be ordered?

By default, you can provision a combined total of 700 block and file storage. To increase your volume limit, contact your sales representative.
Create the volume group for LVM. Only /hana/log is assigned to the LVM.

[root@vx2d-44x616 ] pvcreate /dev/vdf /dev/vdg /dev/vdh
[root@vx2d-44x616 ] vgcreate hana_log_vg /dev/vdf /dev/vdg /dev/vdh
2. After the volume group is created, the logical volume for /hana/log needs to be defined on top. This logical volume reflects the file system size requirement for SAP HANA.

[root@vx2d-44x616 ] lvcreate -i 3 -I 64 -l 100%VG -n hana_log_lv hana_log_vg
3. Now proceed with the same instructions that are listed in steps 3 and 4 [profile vx2d-16x224](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-intel-vs-vpcvx2d-16x224).







 vx2d-144x2016 and vx2d-176x2464 



1. Create the volume group for LVM. /hana/log and /hana/data are assigned to the LVM.

[root@vx2d-144x2016 ] pvcreate /dev/vde /dev/vdf /dev/vdg /dev/vdh
[root@vx2d-144x2016 ] pvcreate /dev/vdi /dev/vdj /dev/vdk
[root@vx2d-144x2016 ] vgcreate hana_data_vg /dev/vde /dev/vdf /dev/vdg /dev/vdh
[root@vx2d-144x2016 ] vgcreate hana_log_vg /dev/vdi /dev/vdj /dev/vdk
2. After the volume group is created, two logical volumes need to be defined on top.
- name: mypvc
mountPath: /usr/share/nginx/html
volumeClaimTemplates:
- metadata:
name: mypvc
annotations:
ibm.io/auto-create-bucket: "false"
ibm.io/auto-delete-bucket: "false"
ibm.io/bucket: mybucket
ibm.io/secret-name: mysecret
volume.beta.kubernetes.io/storage-class: ibmc-s3fs-standard-perf-cross-region
volume.beta.kubernetes.io/storage-provisioner: ibm.io/ibmc-s3fs
spec:
accessModes: [ "ReadOnlyMany" ]
storageClassName: "ibmc-s3fs-standard-perf-cross-region"
resources:
requests:
storage: 1Gi
Show more



name
: Enter a name for your stateful set. The name that you enter is used to create the name for your PVC in the format: <volume_name>-< statefulset_name>-<replica_number>.

serviceName
: Enter the name of the service that you want to use to expose your stateful set.

replicas
: Enter the number of replicas for your stateful set.

matchLabels
: In the spec selector match labels section, enter all labels that you want to include in your stateful set and your PVC. Labels that you include in the volumeClaimTemplates of your stateful set are not recognized by Kubernetes. Instead, you must define these labels in the spec.selector.matchLabels and spec.template.metadata.labels section of your stateful set YAML. To make sure that all your stateful set replicas are into the load balancing of your service, include the same label that you used in the spec.selector section of your service YAML.

labels
: In the spec metadata labels section, enter the same labels that you added to the spec.selector.matchLabels section of your stateful set YAML.

terminationGracePeriodSeconds
You might need to take your storage volume back to a specific point in time because of user-error or data corruption.



1. Unmount your volume. You must ensure that the host is not trying to connect to the volume during the restore.



* [Unmounting Block Storage for Classic volumes on Linux®](https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-mountingLinuxunmountingLin)
* [Unmounting Block Storage for Classic volumes on Microsoft®](https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-mountingWindowsunmountingWin)



2. Then, you can restore the volume with a snapshot from the SLCLI by using the following command.

 slcli block snapshot-restore --help
Usage: slcli block snapshot-restore [OPTIONS] VOLUME_ID

Options:
-s, --snapshot-id TEXT The id of the snapshot which is to be used to restore
the block volume
-h, --help Show this message and exit.
3. Lastly, mount and reattach your storage volume to the host.



* [Mount iSCSI LUNs on Linux® - RHEL6 and CentOS6](https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-mountingLinux).
* [Mount iSCSI LUN on Red Hat Enterprise Linux® 8](https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-mountingRHEL8).
* [Mount iSCSI LUNs on CloudLinux 6.10](https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-mountingCloudLinux).
* [Mount iSCSI LUN on CloudLinux 8](https://cloud.ibm.com/docs/BlockStorage?topic=BlockStorage-mountingCloudLin8).