列舉後端組態選項與範例Azure NetApp Files
瞭解 Azure NetApp Files 的 NFS 和 SMB 後端組態選項、並檢閱組態範例。
後端組態選項
Trident 使用後端組態(子網路、虛擬網路、服務層級和位置)、在所要求位置的可用容量集區上建立 Azure NetApp Files Volume 、並符合所要求的服務層級和子網路。
|
* 從NetApp Trident 25.06 版本開始,手動 QoS 容量池作為技術預覽版受到支援。 * |
Azure NetApp Files 後端提供這些組態選項。
參數 | 說明 | 預設 |
---|---|---|
「分度」 |
永遠為1 |
|
「torageDriverName」 |
儲存驅動程式名稱 |
「Azure - NetApp-Files」 |
「後端名稱」 |
自訂名稱或儲存後端 |
驅動程式名稱+「_」+隨機字元 |
《訂閱ID》 |
Azure訂閱的訂閱ID |
|
「TenantId」 |
應用程式註冊的租戶ID |
|
"clientID" |
應用程式註冊的用戶端ID |
|
「客戶機密」 |
應用程式註冊的用戶端機密 |
|
《服務層級》 |
其中一種是「標準」、「高級」或「超高」 |
""(隨機) |
位置 |
要建立新磁碟區的Azure位置名稱 |
|
"來源群組" |
用於篩選已探索資源的資源群組清單 |
「[]」(無篩選器) |
《netappAccounts》 |
篩選探索資源的NetApp帳戶清單 |
「[]」(無篩選器) |
《容量Pools》 |
用於篩選已探索資源的容量集區清單 |
「[]」(無篩選器、隨機) |
「虛擬化網路」 |
具有委派子網路的虛擬網路名稱 |
" |
《Subnet》 |
委派給「icrosoft.Netapp/volumes`」的子網路名稱 |
" |
《網路功能》 |
Volume的vnet功能集可能是 |
" |
「nfsMountOptions」 |
精細控制NFS掛載選項。SMB磁碟區已忽略。若要使用NFS 4.1版掛載磁碟區、請包含 |
"nfsves=3" |
《限制Volume大小》 |
如果要求的磁碟區大小高於此值、則資源配置失敗 |
""(預設不強制執行) |
「DebugTraceFlags」 |
疑難排解時要使用的偵錯旗標。範例:「\{"API":假、「方法」:真、「探索」:true}。除非您正在進行疑難排解並需要詳細的記錄傾印、否則請勿使用此功能。 |
null |
|
設定NFS或SMB磁碟區建立。選項包括 |
|
|
代表此後端所支援的區域和區域清單。如需詳細資訊、請 "使用「csi拓撲」"參閱。 |
|
|
表示 QoS 類型:自動或手動。* Trident 25.06 技術預覽版* |
汽車 |
|
設定允許的最大吞吐量。僅支援手動 QoS 容量池。* Trident 25.06 技術預覽版* |
|
|
如需網路功能的詳細資訊、請參閱 "設定Azure NetApp Files 適用於某個聲音量的網路功能"。 |
必要的權限與資源
如果您在建立 PVC 時收到「找不到容量集區」錯誤,您的應用程式註冊可能沒有相關的必要權限和資源(子網路,虛擬網路,容量集區)。如果啟用除錯功能、 Trident 會記錄建立後端時所探索到的 Azure 資源。確認使用的角色是否適當。
的值 resourceGroups
、 netappAccounts
、 capacityPools
、 virtualNetwork`和 `subnet
可以使用簡短或完整名稱來指定。在大多數情況下、建議使用完整名稱、因為短名稱可以符合多個名稱相同的資源。
。 resourceGroups
、 netappAccounts`和 `capacityPools
值是篩選器、可將探索到的資源集合限制在此儲存後端可用的資源、並可任意組合指定。完整名稱格式如下:
類型 | 格式 |
---|---|
資源群組 |
<資源群組> |
NetApp帳戶 |
資源群組//<NetApp帳戶> |
容量資源池 |
資源群組//<NetApp帳戶>/<容量資源池> |
虛擬網路 |
資源群組//<虛擬網路> |
子網路 |
資源群組//<虛擬網路>/<子網路> |
Volume資源配置
您可以在組態檔的特殊區段中指定下列選項、以控制預設的Volume資源配置。請參閱 組態範例 以取得詳細資料。
參數 | 說明 | 預設 |
---|---|---|
「匯出規則」 |
匯出新磁碟區的規則。 |
「0.00.0.0/0」 |
「napshotDir |
控制.snapshot目錄的可見度 |
針對 NFSv3 的 NFSv4 "false" 為 "true" |
《大小》 |
新磁碟區的預設大小 |
100公克 |
「unixPermissions」 |
新磁碟區的UNIX權限(4個八進位數字)。SMB磁碟區已忽略。 |
""(預覽功能、訂閱時需要白名單) |
組態範例
下列範例顯示基本組態、讓大部分參數保留預設值。這是定義後端最簡單的方法。
最小組態
這是絕對最低的後端組態。使用此組態、 Trident 會探索您在設定位置中委派給 Azure NetApp Files 的所有 NetApp 帳戶、容量集區和子網路、並隨機將新磁碟區放在其中一個集區和子網路上。由於省略、因此 nasType
nfs
會套用預設值、而後端會為 NFS 磁碟區進行資源配置。
當您剛開始使用 Azure NetApp Files 並試用時、這項組態是理想的選擇、但實際上您會想要為您所配置的磁碟區提供額外的範圍。
---
apiVersion: trident.netapp.io/v1
kind: TridentBackendConfig
metadata:
name: backend-tbc-anf-1
namespace: trident
spec:
version: 1
storageDriverName: azure-netapp-files
subscriptionID: 9f87c765-4774-fake-ae98-a721add45451
tenantID: 68e4f836-edc1-fake-bff9-b2d865ee56cf
clientID: dd043f63-bf8e-fake-8076-8de91e5713aa
clientSecret: SECRET
location: eastus
管理的身分識別
此後端組態已不再如此 subscriptionID
、 tenantID
、 clientID`和 `clientSecret
,使用託管身分識別時為選用功能。
apiVersion: trident.netapp.io/v1
kind: TridentBackendConfig
metadata:
name: backend-tbc-anf-1
namespace: trident
spec:
version: 1
storageDriverName: azure-netapp-files
capacityPools:
- ultra-pool
resourceGroups:
- aks-ami-eastus-rg
netappAccounts:
- smb-na
virtualNetwork: eastus-prod-vnet
subnet: eastus-anf-subnet
雲端身分識別
此後端組態已不再如此 tenantID
、 clientID`和 `clientSecret
(使用雲端身分識別時為選用功能)。
apiVersion: trident.netapp.io/v1
kind: TridentBackendConfig
metadata:
name: backend-tbc-anf-1
namespace: trident
spec:
version: 1
storageDriverName: azure-netapp-files
capacityPools:
- ultra-pool
resourceGroups:
- aks-ami-eastus-rg
netappAccounts:
- smb-na
virtualNetwork: eastus-prod-vnet
subnet: eastus-anf-subnet
location: eastus
subscriptionID: 9f87c765-4774-fake-ae98-a721add45451
具有容量集區篩選器的特定服務層級組態
此後端組態會將磁碟區放置在 Azure 的位置、並置於 eastus`容量集區中 `Ultra
。Trident 會自動探索該位置中委派給 Azure NetApp Files 的所有子網路、並隨機在其中一個磁碟區上放置新的磁碟區。
---
version: 1
storageDriverName: azure-netapp-files
subscriptionID: 9f87c765-4774-fake-ae98-a721add45451
tenantID: 68e4f836-edc1-fake-bff9-b2d865ee56cf
clientID: dd043f63-bf8e-fake-8076-8de91e5713aa
clientSecret: SECRET
location: eastus
serviceLevel: Ultra
capacityPools:
- application-group-1/account-1/ultra-1
- application-group-1/account-1/ultra-2
具有手動 QoS 容量池的後端範例
此後端配置將磁碟區放置在 Azure 的 `eastus`具有手動 QoS 容量池的位置。* NetApp Trident 25.06 中的技術預覽*。
---
version: 1
storageDriverName: azure-netapp-files
backendName: anf1
location: eastus
labels:
clusterName: test-cluster-1
cloud: anf
nasType: nfs
defaults:
qosType: Manual
storage:
- serviceLevel: Ultra
labels:
performance: gold
defaults:
maxThroughput: 10
- serviceLevel: Premium
labels:
performance: silver
defaults:
maxThroughput: 5
- serviceLevel: Standard
labels:
performance: bronze
defaults:
maxThroughput: 3
進階組態
此後端組態可進一步將磁碟區放置範圍縮小至單一子網路、並修改部分Volume資源配置預設值。
---
version: 1
storageDriverName: azure-netapp-files
subscriptionID: 9f87c765-4774-fake-ae98-a721add45451
tenantID: 68e4f836-edc1-fake-bff9-b2d865ee56cf
clientID: dd043f63-bf8e-fake-8076-8de91e5713aa
clientSecret: SECRET
location: eastus
serviceLevel: Ultra
capacityPools:
- application-group-1/account-1/ultra-1
- application-group-1/account-1/ultra-2
virtualNetwork: my-virtual-network
subnet: my-subnet
networkFeatures: Standard
nfsMountOptions: vers=3,proto=tcp,timeo=600
limitVolumeSize: 500Gi
defaults:
exportRule: 10.0.0.0/24,10.0.1.0/24,10.0.2.100
snapshotDir: "true"
size: 200Gi
unixPermissions: "0777"
虛擬集區組態
此後端組態可在單一檔案中定義多個儲存集區。當您有多個容量集區支援不同的服務層級、而且想要在Kubernetes中建立代表這些層級的儲存類別時、這很有用。虛擬資源池標籤是用來區分資源池的依據 performance
。
---
version: 1
storageDriverName: azure-netapp-files
subscriptionID: 9f87c765-4774-fake-ae98-a721add45451
tenantID: 68e4f836-edc1-fake-bff9-b2d865ee56cf
clientID: dd043f63-bf8e-fake-8076-8de91e5713aa
clientSecret: SECRET
location: eastus
resourceGroups:
- application-group-1
networkFeatures: Basic
nfsMountOptions: vers=3,proto=tcp,timeo=600
labels:
cloud: azure
storage:
- labels:
performance: gold
serviceLevel: Ultra
capacityPools:
- ultra-1
- ultra-2
networkFeatures: Standard
- labels:
performance: silver
serviceLevel: Premium
capacityPools:
- premium-1
- labels:
performance: bronze
serviceLevel: Standard
capacityPools:
- standard-1
- standard-2
支援的拓撲組態
Trident 可根據地區和可用性區域、為工作負載提供更多資源。 `supportedTopologies`此後端組態中的區塊用於提供每個後端的區域和區域清單。此處指定的區域和區域值必須符合每個 Kubernetes 叢集節點上標籤的區域和區域值。這些區域和區域代表可在儲存類別中提供的允許值清單。對於包含後端所提供區域和區域子集的儲存類別、 Trident 會在所述區域和區域中建立磁碟區。如需詳細資訊、請 "使用「csi拓撲」"參閱。
---
version: 1
storageDriverName: azure-netapp-files
subscriptionID: 9f87c765-4774-fake-ae98-a721add45451
tenantID: 68e4f836-edc1-fake-bff9-b2d865ee56cf
clientID: dd043f63-bf8e-fake-8076-8de91e5713aa
clientSecret: SECRET
location: eastus
serviceLevel: Ultra
capacityPools:
- application-group-1/account-1/ultra-1
- application-group-1/account-1/ultra-2
supportedTopologies:
- topology.kubernetes.io/region: eastus
topology.kubernetes.io/zone: eastus-1
- topology.kubernetes.io/region: eastus
topology.kubernetes.io/zone: eastus-2
儲存類別定義
以下內容 StorageClass
定義請參閱上述儲存資源池。
使用的範例定義 parameter.selector
欄位
使用 parameter.selector
您可以為每個項目指定 StorageClass
用於裝載磁碟區的虛擬集區。該磁碟區會在所選的資源池中定義各個層面。
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gold
provisioner: csi.trident.netapp.io
parameters:
selector: performance=gold
allowVolumeExpansion: true
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: silver
provisioner: csi.trident.netapp.io
parameters:
selector: performance=silver
allowVolumeExpansion: true
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: bronze
provisioner: csi.trident.netapp.io
parameters:
selector: performance=bronze
allowVolumeExpansion: true
SMB磁碟區的定義範例
使用 nasType
、 node-stage-secret-name`和 `node-stage-secret-namespace
、您可以指定SMB磁碟區、並提供所需的Active Directory認證資料。
預設命名空間的基本組態
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: anf-sc-smb
provisioner: csi.trident.netapp.io
parameters:
backendType: "azure-netapp-files"
trident.netapp.io/nasType: "smb"
csi.storage.k8s.io/node-stage-secret-name: "smbcreds"
csi.storage.k8s.io/node-stage-secret-namespace: "default"
每個命名空間使用不同的機密
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: anf-sc-smb
provisioner: csi.trident.netapp.io
parameters:
backendType: "azure-netapp-files"
trident.netapp.io/nasType: "smb"
csi.storage.k8s.io/node-stage-secret-name: "smbcreds"
csi.storage.k8s.io/node-stage-secret-namespace: ${pvc.namespace}
每個磁碟區使用不同的機密
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: anf-sc-smb
provisioner: csi.trident.netapp.io
parameters:
backendType: "azure-netapp-files"
trident.netapp.io/nasType: "smb"
csi.storage.k8s.io/node-stage-secret-name: ${pvc.name}
csi.storage.k8s.io/node-stage-secret-namespace: ${pvc.namespace}
|
nasType: smb 支援SMB磁碟區的集區篩選器。 nasType: nfs 或 nasType: null NFS集區的篩選器。
|
建立後端
建立後端組態檔之後、請執行下列命令:
tridentctl create backend -f <backend-file>
如果後端建立失敗、表示後端組態有問題。您可以執行下列命令來檢視記錄、以判斷原因:
tridentctl logs
識別並修正組態檔的問題之後、您可以再次執行create命令。