[root@master02 trident-installer]# ./tridentctl install --dry-run -n trident -d
DEBU Initialized logging. logLevel=debug
DEBU Running outside a pod, creating CLI-based client.
DEBU Initialized Kubernetes CLI client. cli=oc flavor=openshift namespace=trident version=1.11.0+d4cacc0
DEBU Validated installation environment. installationNamespace=trident kubernetesVersion=
DEBU Deleted Kubernetes configmap. label="app=trident-installer.netapp.io"namespace=trident
DEBU Namespace exists. namespace=trident
DEBU Deleted Kubernetes object by YAML.
DEBU Deleted installer cluster role binding.
DEBU Deleted Kubernetes object by YAML.
DEBU Deleted installer cluster role.
DEBU Deleted Kubernetes object by YAML.
DEBU Deleted installer service account.
DEBU Removed security context constraint user. scc=privileged user=trident-installer
DEBU Created Kubernetes object by YAML.
INFO Created installer service account. serviceaccount=trident-installer
DEBU Created Kubernetes object by YAML.
INFO Created installer cluster role. clusterrole=trident-installer
DEBU Created Kubernetes object by YAML.
INFO Created installer cluster role binding. clusterrolebinding=trident-installer
INFO Added security context constraint user. scc=privileged user=trident-installer
DEBU Created Kubernetes configmap from directory. label="app=trident-installer.netapp.io" name=trident-installer namespace=trident path=/root/trident-installer/setup
INFO Created installer configmap. configmap=trident-installer
DEBU Created Kubernetes object by YAML.
INFO Created installer pod. pod=trident-installer
INFO Waiting for Trident installer pod to start.
DEBU Trident installer pod not yet started, waiting. increment=280.357322ms message="pod not yet started (Pending)"
DEBU Trident installer pod not yet started, waiting. increment=523.702816ms message="pod not yet started (Pending)"
DEBU Trident installer pod not yet started, waiting. increment=914.246751ms message="pod not yet started (Pending)"
DEBU Trident installer pod not yet started, waiting. increment=1.111778662s message="pod not yet started (Pending)"
DEBU Pod started. phase=Succeeded
INFO Trident installer pod started. namespace=trident pod=trident-installer
DEBU Getting logs. cmd="oc --namespace=trident logs trident-installer -f"
DEBU Initialized logging. logLevel=debug
DEBU Running in a pod, creating API-based client. namespace=trident
DEBU Initialized Kubernetes API client. cli=oc flavor=openshift namespace=trident version=v1.11.0+d4cacc0
DEBU Validated installation environment. installationNamespace=trident kubernetesVersion=v1.11.0+d4cacc0
DEBU Parsed requested volume size. quantity=2Gi
DEBU Dumping RBAC fields. ucpBearerToken= ucpHost= useKubernetesRBAC=true
DEBU Namespace exists. namespace=trident
DEBU PVC does not exist. pvc=trident
DEBU PV does not exist. pv=trident
INFO Starting storage driver. backend=/setup/backend.json
DEBU config: {"Endpoint":"https://admin:root1234@99.248.106.82/json-rpc/11.0","InitiatorIFace":"default","SVIP":"99.248.82.55:3260","TenantName":"trident","Types":[{"Qos":{"burstIOPS":4000,"maxIOPS":2000,"minIOPS":1000},"Type":"Bronze"},{"Qos":{"burstIOPS":8000,"maxIOPS":6000,"minIOPS":4000},"Type":"Silver"},{"Qos":{"burstIOPS":10000,"maxIOPS":8000,"minIOPS":6000},"Type":"Gold"}],"UseCHAP":true,"storageDriverName":"solidfire-san","version":1}
DEBU Storage prefix is absent, will use default prefix.
DEBU Parsed commonConfig: {Version:1 StorageDriverName:solidfire-san BackendName: Debug:false DebugTraceFlags:map[] DisableDelete:false StoragePrefixRaw:[] StoragePrefix:<nil> SerialNumbers:[] DriverContext: LimitVolumeSize:}
DEBU Initializing storage driver. driver=solidfire-san
DEBU Configuration defaults Size=1G StoragePrefix= UseCHAP=true
DEBU Parsed into solidfireConfig DisableDelete=false StorageDriverName=solidfire-san Version=1
DEBU Decoded to &{CommonStorageDriverConfig:0xc42064e0a0 TenantName:trident EndPoint:https:
DEBU Set default block size. defaultBlockSize=512
DEBU Using SF API version from config file. version=11.0
DEBU Initializing SolidFire API client. cfg="{trident https://admin:root1234@99.248.106.82/json-rpc/11.0 99.248.82.55:3260 default 0xc4206d26e0 [] 512 map[]}" endpoint="https://admin:root1234@99.248.106.82/json-rpc/11.0" svip="99.248.82.55:3260"
ERRO Error detected in API response. ID=637 code=500 message=xUnknownAccount name=xUnknownAccount
DEBU Account not found, creating. error="device API error: xUnknownAccount" tenantName=trident
DEBU Created account. accountID=0 tenantName=trident
DEBU SolidFire driver initialized. AccountID=2 InitiatorIFace=default
DEBU Using CHAP, skipped Volume Access Group logic. AccessGroups="[]" SVIP="99.248.82.55:3260" UseCHAP=true driver=solidfire-san
DEBU Added pool for SolidFire backend. attributes="map[media:{Offers: ssd} IOPS:{Min: 1000, Max: 2000} snapshots:{Offer: true} clones:{Offer: true} encryption:{Offer: false} provisioningType:{Offers: thin} backendType:{Offers: solidfire-san}]" backend=solidfire_99.248.82.55 pool=Bronze
DEBU Added pool for SolidFire backend. attributes="map[clones:{Offer: true} encryption:{Offer: false} provisioningType:{Offers: thin} backendType:{Offers: solidfire-san} media:{Offers: ssd} IOPS:{Min: 4000, Max: 6000} snapshots:{Offer: true}]" backend=solidfire_99.248.82.55 pool=Silver
DEBU Added pool for SolidFire backend. attributes="map[snapshots:{Offer: true} clones:{Offer: true} encryption:{Offer: false} provisioningType:{Offers: thin} backendType:{Offers: solidfire-san} media:{Offers: ssd} IOPS:{Min: 6000, Max: 8000}]" backend=solidfire_99.248.82.55 pool=Gold
DEBU Storage driver initialized. driver=solidfire-san
INFO Storage driver loaded. driver=solidfire-san
INFO Dry run completed, no problems found.
DEBU Received EOF from pod logs. container= pod=trident-installer
INFO Waiting for Trident installer pod to finish.
DEBU Pod finished. phase=Succeeded
INFO Trident installer pod finished. namespace=trident pod=trident-installer
DEBU Deleted Kubernetes pod. label="app=trident-installer.netapp.io"namespace=trident
INFO Deleted installer pod. pod=trident-installer
DEBU Deleted Kubernetes configmap. label="app=trident-installer.netapp.io"namespace=trident
INFO Deleted installer configmap. configmap=trident-installer
INFO In-cluster installation completed.
DEBU Deleted Kubernetes object by YAML.
INFO Deleted installer cluster role binding.
DEBU Deleted Kubernetes object by YAML.
INFO Deleted installer cluster role.
DEBU Deleted Kubernetes object by YAML.
INFO Deleted installer service account.
INFO Removed security context constraint user. scc=privileged user=trident-installer
- 正式安装
$ ./tridentctl install -n trident
该步骤是真正的执行。会创建serviceaccount, clusterrolebinding,configmap配置,trident-install pod(该pod在部署完trident deployment后会删除)等, 并会创建一个pv与trident pvc进行初始化操作,最终会创建trident deployment,完成trident的安装。
- trident的安装支持自定义一些配置。
- --etcd-image可指定etcd的镜像(默认是quay.io/coreos/etcd,下载会比较慢)
- --trident-image指定trident的镜像
- --volume-size指定trident持久存储的大小(默认为2GiB)
- --volume-name指定volume名字(默认是etcd-vol)
- --pv指定pv名字(默认是trident)
- --pvc指定pvc名字(默认是trident)
- --generate-custom-yaml将使用的所有配置进行导出到一个setup文件夹,不会对集群做任何操作
- --use-custom-yaml安装setup下的所有yaml文件进行部署trident
以下是执行的日志
[root@master02 trident-installer]# ./tridentctl install -n trident
INFO Created installer service account. serviceaccount=trident-installer
INFO Created installer cluster role. clusterrole=trident-installer
INFO Created installer cluster role binding. clusterrolebinding=trident-installer
INFO Added security context constraint user. scc=privileged user=trident-installer
INFO Created installer configmap. configmap=trident-installer
INFO Created installer pod. pod=trident-installer
INFO Waiting for Trident installer pod to start.
INFO Trident installer pod started. namespace=trident pod=trident-installer
INFO Starting storage driver. backend=/setup/backend.json
INFO Storage driver loaded. driver=solidfire-san
INFO Starting Trident installation. namespace=trident
INFO Created service account.
INFO Created cluster role.
INFO Created cluster role binding.
INFO Added security context constraint user. scc=anyuid user=trident
INFO Created PVC.
INFO Controller serial numbers. serialNumbers="4BZXJB2,85Q8JB2,4BXXJB2,4BXTJB2"
INFO Created iSCSI CHAP secret. secret=trident-chap-solidfire-99-248-82-55-trident
INFO Created PV. pv=trident
INFO Waiting for PVC to be bound. pvc=trident
INFO Created Trident deployment.
INFO Waiting for Trident pod to start.
INFO Trident pod started. namespace=trident pod=trident-57ccdff48f-gtflx
INFO Waiting for Trident REST interface.
INFO Trident REST interface is up. version=18.10.0
INFO Trident installation succeeded.
INFO Waiting for Trident installer pod to finish.
INFO Trident installer pod finished. namespace=trident pod=trident-installer
INFO Deleted installer pod. pod=trident-installer
INFO Deleted installer configmap. configmap=trident-installer
INFO In-cluster installation completed.
INFO Deleted installer cluster role binding.
INFO Deleted installer cluster role.
INFO Deleted installer service account.
INFO Removed security context constraint user. scc=privileged user=trident-installer
- 执行完install后,trident并不会安装之前配置的backend,需要另外再单独添加。(个人觉得netapp这点考虑得有点多余,因为dry-run的时候已经对backend.json作了检查了,直接install将它添加上岂不是更方便)
$ ./tridentctl -n trident create backend -f setup/backend.json
$ ./tridentctl -n trident get backend
+------------------------+----------------+--------+---------+| NAME | STORAGE DRIVER | ONLINE | VOLUMES |
+------------------------+----------------+--------+---------+
| solidfire_99.248.82.55| solidfire-san |true| 0 |
+------------------------+----------------+--------+---------+
- 添加基本的storageclass
将sample-input/storage-class-basic.yaml.templ中的BACKEND_TYPE用指定的backend中的STORAGE DRIVER值替换(此例中为solidfire-san)
$ cat sample-input/storage-class-basic.yaml.templapiVersion: storage.k8s.io/v1kind: StorageClassmetadata:name: basicprovisioner: netapp.io/tridentparameters:backendType:"__BACKEND_TYPE__"
$ sed "s/__BACKEND_TYPE__/solidfire-san/" sample-input/storage-class-basic.yaml.templ | occreate -f -
- 根据backend中的Type创建对应的storageclass
$ cat storage-class-gold.yamlapiVersion: storage.k8s.io/v1kind: StorageClassmetadata:name: goldannotations:
storageclass.kubernetes.io/is-default-class: "true"provisioner: netapp.io/tridentparameters:storagePools:"solidfire_99.248.82.55:Gold"
$ oc create -f storage-class-gold.yaml
查看当前的storageclass
$ oc get sc
NAME PROVISIONER AGE
basic netapp.io/trident 2hgold(default) netapp.io/trident 1h
使用:创建PVC
- 创建第一个PVC
$ cat test-pvc.yamlapiVersion: v1kind: PersistentVolumeClaimmetadata:annotations:
volume.beta.kubernetes.io/storage-class: gold
volume.beta.kubernetes.io/storage-provisioner: netapp.io/trident
trident.netapp.io/reclaimPolicy:"Retain"name: testpvcnamespace: testspec:accessModes:
- ReadWriteOnceresources:requests:storage:1Gi
$ oc create -f test-pvc.yaml
PVC创建的说明:
- volume.beta.kubernetes.io/storage-class为10,11步创建的storageclass
- volume.beta.kubernetes.io/storage-provisioner指定为netapp的trident
- trident.netapp.io/reclaimPolicy指定创建PV的reclaimPolicy,默认为"Delete",支持"Delete"和"Retain",不支持"Recycle"
- accessModes因SolidFire是块存储,只支持ReadWriteOnce
SolidFire功能测试
快照恢复数据
创建快照
创建快照