ibm-object-storage-plugin
Chart for deploying ibmcloud object storage plugin. IBM Cloud Object Storage is persistent, highly available storage that you can mount to apps that run in a Kubernetes cluster by using the IBM Cloud Object Storage plug-in. The plug-in is a Kubernetes Flex-Volume plug-in that connects Cloud Object Storage buckets to pods in your cluster. License By installing this product you accept the following license terms: http://www.apache.org/licenses/ and https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf
About this chart
IBM Cloud Object Storage Plug-in
This Helm chart installs the IBM Cloud Object Storage plug-in in a Kubernetes cluster. In IBM Cloud Kubernetes Service, the Helm chart is deployed in the ibm-object-s3fs namespace of your cluster.
Supported orchestration platforms
The following table details orchestration platforms suitable for deployment of the IBM Cloud Object Storage Plug-in.
| Orchestration platform | Version | Architecture |
|---|---|---|
| Kubernetes | 1.26 | x86 |
| Kubernetes | 1.25 | x86 |
| Kubernetes | 1.24 | x86 |
| Kubernetes | 1.23 | x86 |
| Kubernetes | 1.22 | x86 |
| Red Hat OpenShift | 4.11 | x86 |
| Red Hat OpenShift | 4.10 | x86 |
| Red Hat OpenShift | 4.9 | x86 |
| Red Hat OpenShift | 4.8 | x86 |
| Red Hat OpenShift | 4.7 | x86 |
Introduction
IBM Cloud Object Storage is persistent, highly available storage that you can mount to apps that run in a Kubernetes cluster by using the IBM Cloud Object Storage plug-in. The plug-in is a Kubernetes Flex-Volume plug-in that connects Cloud Object Storage buckets to pods in your cluster. Information that is stored with IBM Cloud Object Storage is encrypted in transit and at rest, dispersed across multiple geographic locations, and accessed over HTTP by using a REST API.
Chart Details
When you install the IBM Cloud Object Storage plug-in Helm chart, the following Kubernetes resources are deployed into your Kubernetes cluster:
- IBM Cloud Object Storage driver daemonset: The daemonset deploys one
ibmcloud-object-storage-driverpod on every worker node in your cluster. The daemonset contains the Kubernetes flex driver plug-in to communicate with thekubeletcomponent in your cluster. - IBM Cloud Object Storage plug-in pod: The pod contains the storage provisioner controllers to work with the Kubernetes controllers.
- IBM-provided storage classes: You can use the storage classes to create Cloud Object Storage buckets with a specific configuration.
- Kubernetes service accounts, RBAC cluster roles and cluster role bindings: The service accounts and RBAC roles authorize the plug-in to interact with your Kubernetes resources.
Prerequisites
- IBM Cloud Kubernetes Service (IKS):
- Create or use an existing standard Kubernetes cluster that you provisioned with IBM Cloud Kubernetes Service.
- Install the IBM Cloud CLI, the IBM Cloud Kubernetes Service plug-in, the Kubernetes CLI.
- Log in to your IBM Cloud account. Target the appropriate region and, if applicable, resource group. Set the context for your cluster.
- Helm > v3.2.0 Required. Follow the instructions to install the Helm client v3 on your local machine. If helm v2 is installed on your local machine or on your cluster, then it is strongly recommended to migrate from helm v2 to v3. Install using script
SecurityContextConstraints Requirements
- The chart automatically creates following SCC, s3fs-cos-driver-scc, for OpenShift Container Platform (OCP) to provide the required permissions & capabilities to the Driver Pods
- Custom SecurityContextConstraints definition:
apiVersion: security.openshift.io/v1 kind: SecurityContextConstraints metadata: name: s3fs-cos-driver-scc priority: 0 defaultAddCapabilities: [] allowedCapabilities: [] allowHostDirVolumePlugin: true allowHostIPC: false allowHostPID: false allowHostPorts: false allowHostNetwork: true allowPrivilegedContainer: false allowPrivilegeEscalation: true requiredDropCapabilities: - KILL - MKNOD - SETUID - SETGID readOnlyRootFilesystem: true runAsUser: type: RunAsAny seLinuxContext: type: MustRunAs fsGroup: type: RunAsAny supplementalGroups: type: RunAsAny users: - system:serviceaccount:{{template "ibm-object-storage-plugin.namespace" .}}:ibmcloud-object-storage-driver groups: [] volumes: - configMap - downwardAPI - emptyDir - hostPath - persistentVolumeClaim - projected - secret
- Custom SecurityContextConstraints definition:
Permissions
To install the Helm chart in your cluster, you must have the Administrator platform role.
Resources Required
The IBM Cloud Object Storage plug-in requires the following resources on each worker node to run successfully:
- CPU: 0.2 vCPU
- Memory: 128MB
Installing the Chart
Install the IBM Cloud Object Storage plug-in with a Helm chart to set up pre-defined storage classes for IBM Cloud Object Storage. You can use these storage classes to create a PVC to provision IBM Cloud Object Storage for your apps.
Before you begin
- Complete the prerequisites for your IBM Cloud environment as outlined in the
Prerequisitessection of thisREADME. - Create a Cloud Object Storage instance that you want to use to store your data.
- Option 1: Create an IBM Cloud Object Storage service instance in IBM Cloud. The service provides a public and a private service endpoint. In IBM Cloud Kubernetes Service, the private endpoint is used by default. However, you can specify the public service endpoint in your PVC instead. To connect to the private service endpoint, you must be on the IBM network, for example by using a VPN gateway.
- Option 2: Set up a local Cloud Object Storage server in your cluster. For example, check out the
ibm-minio-objectstoreHelm chart. - Option 3: Create or use an existing Cloud Object Storage instance that you set up with a different cloud provider, such as Amazon s3.
- Retrieve your Cloud Object Storage API endpoint, and the credentials to access your Cloud Object Store. For example, to retrieve this information for an IBM Cloud Object Storage service instance in IBM Cloud (Option 1), see Retrieve the IBM Cloud Object Storage service credentials.
- Store the credentials to access your Cloud Object Store in a Kubernetes secret.
-
Encode the Cloud Object Storage credentials to base64 and note all the base64 encoded values.
echo -n "<key_value>" | base64 -
Create a configuration file for your Kubernetes secret. The credentials might vary depending on the type of Cloud Object Storage instance you use. The following examples show the values that you must provide if you use an IBM Cloud Object Storage service instance in IBM Cloud. You can create the secret, say
secret.yamlin any namespace that you want. Example for Hash-based Message Authentication Code (HMAC) authentication:apiVersion: v1 kind: Secret type: ibm/ibmc-s3fs metadata: name: <secret_name> namespace: <namespace> data: access-key: <base64_access_key_id> secret-key: <base64_secret_access_key>Example for Identity and Access Management (IAM) key authentication:
apiVersion: v1 kind: Secret type: ibm/ibmc-s3fs metadata: name: <secret_name> namespace: <namespace> data: api-key: <base64_apikey> service-instance-id: <base64_resource_instance_id> -
Create the Kubernetes secret in your cluster.
kubectl apply -f secret.yaml
-
Installing the Chart
- Go to IBM Cloud Kubernetes Service for deployment on IKS Cluster
IBM Cloud Kubernetes Service
Note: This chart supports only Helm V3 and will not work with Helm V2
-
Verify that
helm v3is installed on your local machine.helm version --short v3.0.2+g19e47eeTip: If helm v2 is installed on your local machine or on your cluster, then first migrate from helm v2 to v3.
-
Add the IBM Cloud Helm repository
ibm-helmto your cluster.helm repo add ibm-helm https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm -
Update the Helm repo to retrieve the latest version of all Helm charts in this repo.
helm repo update -
Download the Helm chart and unpack the chart in your current directory. Then, navigate to the
ibm-object-storage-plugindirectory.helm fetch --untar ibm-helm/ibm-object-storage-plugin && cd ibm-object-storage-plugin -
To limit the IBM Cloud Object Storage plug-in access to Kubernetes secrets, go to Optional: Limit secret access ; otherwise, if there is no limitation to be set, continue with next step.
-
Install the IBM Cloud Object Storage Helm plug-in
ibmc. The plug-in is used to automatically retrieve your cluster location and to set the Cloud Object Storage s3 API endpoint for your IBM Cloud Object Storage buckets in your storage classes.-
Install the
ibmcHelm plug-in.helm plugin install ./helm-ibmcExample output:
Installed plugin: ibmc -
Verify that the
ibmcplug-in is installed successfully.helm ibmc --help
-
-
Install the IBM Cloud Object Storage plug-in. When you install the plug-in, pre-defined storage classes are added to your cluster.
Important note1: The bucket access policy configuration, to configure authorised ips, has been enabled only for VPC-Gen2 clusters. Currently, this feature is not supported on IKS Classic. The feature has been enabled by default for VPC-Gen2 clusters in eu-fr2 region. For other regions, to enable bucket access policy, pass the flag
--set bucketAccessPolicy=trueto helm ibmc install command.Important note2: If bucketAccessPolicy is set to true, the s3fs plugin gets installed in kube-system namespace. This is because, to enable access policy for buckets, plugin needs access to
cluster-infoconfig-map which lies in kube-system ns.Example: Install chart from helm registry, without any limitation to access specific Kubernetes secrets:
helm ibmc install ibm-object-storage-plugin ibm-helm/ibm-object-storage-plugin --set license=trueExample: Install chart from local path, with a limitation to access the Cloud Object Storage's secrets only, as described in the
Optional: Limit secret accesssection at the bottom:helm ibmc install ibm-object-storage-plugin ./ --set license=trueExample: Install chart from helm registry, with bucket access policy feature enabled (for regions other than eu-fr2)
helm ibmc install ibm-object-storage-plugin ibm-helm/ibm-object-storage-plugin --set license=true --set bucketAccessPolicy=true -
Go to Limit secret access
Optional: Limit secret access
Limit the IBM Cloud Object Storage plug-in to access only the Kubernetes secrets that hold your IBM Cloud Object Storage service credentials. By default, the plug-in is authorized to access all Kubernetes secrets in your cluster.
- Navigate to the
templatesdirectory and list available files.cd ./templates && ls - Open the
provisioner-sa.yamlfile and look for theibmcloud-object-storage-secret-readerClusterRole definition. - Add the name of the secret that you created earlier to the list of secrets that the plug-in is authorized to access in the
resourceNamessection.kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: ibmcloud-object-storage-secret-reader rules: - apiGroups: [""] resources: ["secrets"] resourceNames: ["<secret_name1>","<secret_name2>"] verbs: ["get"] - Save your changes.
- Navigate back to the
ibm-object-storage-plugindirectory. - Go back to Installing the Chart section and continue with chart installation.
Verifying the Chart
-
Verify that the IBM Cloud Object Storage plug-in is installed correctly.
kubectl get pod -n <namespace> -o wide | grep objectExample output:
$ kubectl get pods -n ibm-object-s3fs -o wide | grep object ibmcloud-object-storage-driver-nss6g 1/1 Running 0 2m7s 10.216.37.8 10.216.37.8 <none> <none> ibmcloud-object-storage-driver-qsnh8 1/1 Running 0 2m7s 10.216.37.14 10.216.37.14 <none> <none> ibmcloud-object-storage-plugin-7644559d65-4b2dr 1/1 Running 0 2m7s 172.30.207.136 10.216.37.14 <none> <none>The installation is successful when you see one
ibmcloud-object-storage-pluginpod and one or moreibmcloud-object-storage-driverpods. The number ofibmcloud-object-storage-driverpods equals the number of worker nodes in your cluster. All pods must be in aRunningstate for the plug-in to function properly. If the pods fail, runkubectl describe pod -n <namespace> <pod_name>to find the root cause for the failure. -
Ve
Deploy ibm-object-storage-plugin with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-object-storage-plugin on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartibm-object-storage-plugin is pinned at v2.2.22 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply