1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IBMCloud ROKS (Redhat Openshift) におけるICOS接続 -Part2-

Last updated at Posted at 2024-06-01

概要

IBMCloud上のRedhat Openshift環境にてPV(PersistentVolume:外部ストレージ)としてICOSオブジェクトストレージを利用する方法をまとめました。

以下の3つのステップで記載します。

1. 前提条件の確認

IBMCloud ICOSプラグインを入れる前に、WorkerNodeが最新パッチが適用されていることを確認する。

現在の管理対象Nodeに最新パッチが適用されているかの確認手順は以下を参考にしてください。

2. helm インストール

(本記事ではMAC端末における操作例となっております。)

  • ibm-helmをインストール
[操作ログ]
$ helm repo add ibm-helm https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm
"ibm-helm" has been added to your repositories
$
  • helmレポジトリの更新
[操作ログ]
% helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ibm-helm" chart repository
...Successfully got an update from the "iks-charts" chart repository
Update Complete. Happy Helming!⎈
%
  • ICOSプラグインに必要となるhelm-ibmcをインストール
  • helm-ibmcが導入されていることを確認
[操作ログ]
% helm plugin install ./ibm-object-storage-plugin/helm-ibmc
Installed plugin: ibmc
% helm ibmc --help
Error: fork/exec /Users/xxxxx/Library/helm/plugins/helm-ibmc/ibmc.sh: permission denied
% chmod 755 /Users/xxxxx/Library/helm/plugins/helm-ibmc/ibmc.sh
% helm ibmc --help
Helm version: v3.14.4+g81c902a
Install or upgrade Helm charts in IBM K8S Service(IKS)
Usage:
  helm ibmc [command]
Available Commands:
  install           Install a Helm chart
  upgrade           Upgrade the release to a new version of the Helm chart
Available Flags:
  -h, --help        (Optional) This text.
  -u, --update      (Optional) Update this plugin to the latest version
Example Usage:
    Install: helm ibmc install ibm-object-storage-plugin ibm-helm/ibm-object-storage-plugin
    Upgrade: helm ibmc upgrade [RELEASE] ibm-helm/ibm-object-storage-plugin
Note:
    1. It is always recommended to install latest version of ibm-object-storage-plugin chart.
    2. It is always recommended to have 'kubectl' client up-to-date.
%
  • ibm-object-storage-plugin をクラスターにインストールする
    (コマンドオプションはご利用要件に合わせて修正ください)
[実行コマンド例]
helm ibmc install ibm-object-storage-plugin ibm-helm/ibm-object-storage-plugin --set license=true --set quotaLimit=true
[操作ログ]
% helm ibmc install ibm-object-storage-plugin ibm-helm/ibm-object-storage-plugin --set license=true --set quotaLimit=true
Helm version: v3.14.4+g81c902a
Checking cluster type
Fetching WORKER OS details ...
Installing the Helm chart...
PROVIDER: IBMC-VPC
WORKER_OS: redhat
PLATFORM: openshift
KUBE_DRIVER_PATH: /usr/libexec/kubernetes
CONFIG_BUCKET_ACCESS_POLICY: false
CONFIG_QUOTA_LIMIT: true
ALLOW_CROSS_NS_SECRET: true
DC: tok02
Region: jp-tok
Chart: ibm-helm/ibm-object-storage-plugin
namespace/ibm-object-s3fs created
W0415 15:54:19.071744   23978 warnings.go:70] would violate PodSecurity "restricted:v1.24": host namespaces (hostNetwork=true), allowPrivilegeEscalation != false (container "ibmcloud-object-storage-driver-container" must set securityContext.allowPrivilegeEscalation=false), restricted volume types (volumes "kube-driver", "usr-local", "usr-lib", "etc-os-release-mount", "host-logs" use restricted volume type "hostPath"), runAsNonRoot != true (container "ibmcloud-object-storage-driver-container" must not set securityContext.runAsNonRoot=false), runAsUser=0 (container "ibmcloud-object-storage-driver-container" must not set runAsUser=0), seccompProfile (pod or container "ibmcloud-object-storage-driver-container" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
NAME: ibm-object-storage-plugin
LAST DEPLOYED: Mon Apr 15 15:54:15 2024
NAMESPACE: ibm-object-s3fs
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing: ibm-object-storage-plugin.   Your release is named: ibm-object-storage-plugin
(一部省略)
%

  • ibm-object-storage-plugin がOCクラスターに正しくインストールされたか確認する
    • ストレージクラスの確認: oc get storageclass | grep 'ibmc-s3fs'を実行し、ストレージクラスが正しく作成されたことを確認
    • プラグインPodの状態確認: oc get pods -n ibm-object-s3fs -o wide | grep objectを実行して、プラグイン関連のPodがすべてRunning状態であることを確認
    • (問題があれば詳細なログを確認)
% oc get storageclass | grep 'ibmc-s3fs'
ibmc-s3fs-cold-cross-region                   ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-cold-regional                       ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-smart-cross-region                  ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-smart-perf-cross-region             ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-smart-perf-regional                 ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-smart-regional                      ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-standard-cross-region               ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-standard-perf-cross-region          ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-standard-perf-regional              ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-standard-regional                   ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-vault-cross-region                  ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m
ibmc-s3fs-vault-regional                      ibm.io/ibmc-s3fs       Delete          Immediate              false                  12m

% oc get pods -n ibm-object-s3fs -o wide | grep object
ibmcloud-object-storage-driver-5npb2             1/1     Running   0          12m   10.244.64.9     10.244.64.9    <none>           <none>
ibmcloud-object-storage-driver-dd7xb             1/1     Running   0          12m   10.244.128.8    10.244.128.8   <none>           <none>
ibmcloud-object-storage-plugin-bb5454564-gc566   1/1     Running   0          12m   172.17.106.96   10.244.64.9    <none>           <none>

% helm ls -A
NAME                     	NAMESPACE      	REVISION	UPDATED                             	STATUS  	CHART                           	APP VERSION
ibm-object-storage-plugin	ibm-object-s3fs	1       	2024-04-15 15:54:15.630565 +0900 JST	deployed	ibm-object-storage-plugin-2.2.24	2.2.24
%
  • ここまででICOSを利用する事前準備が完了です、次のPart3記事で実際にアプリケーションとICOSストレージを接続します
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?