Skip to content

Commit 497b8b3

Browse files
Merge pull request #225444 from roygara/sanAKS
AKS draft
2 parents 609c402 + 9657514 commit 497b8b3

12 files changed

+292
-49
lines changed

articles/storage/elastic-san/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ items:
2222
href: elastic-san-connect-windows.md
2323
- name: Connect to an Elastic SAN volume - Linux
2424
href: elastic-san-connect-linux.md
25+
- name: Connect to an Elastic SAN volume - AKS
26+
href: elastic-san-connect-aks.md
2527
- name: Expand an Elastic SAN
2628
href: elastic-san-expand.md
2729
- name: Configure virtual networks

articles/storage/elastic-san/elastic-san-batch-create-sample.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Create multiple Azure Elastic SAN (preview) volumes in a batch
3-
description: Azure PowerShell Script Sample - Create multiple elastic SAN (preview) volumes in a batch.
2+
title: Create multiple Azure Elastic SAN Preview volumes in a batch
3+
description: Azure PowerShell Script Sample - Create multiple elastic SAN Preview volumes in a batch.
44
author: roygara
55
ms.service: storage
66
ms.topic: sample
@@ -10,7 +10,7 @@ ms.subservice: elastic-san
1010
ms.custom: ignite-2022
1111
---
1212

13-
# Create multiple elastic SAN (preview) volumes in a batch
13+
# Create multiple elastic SAN Preview volumes in a batch
1414

1515
To simplify creating multiple volumes as a batch, you can use a .csv with pre-filled values to create as many volumes of varying sizes as you like.
1616

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
---
2+
title: Connect an Azure Elastic SAN Preview volume to an AKS cluster.
3+
description: Learn how to connect to an Azure Elastic SAN Preview volume an Azure Kubernetes Service cluster.
4+
author: roygara
5+
ms.service: storage
6+
ms.topic: how-to
7+
ms.date: 03/08/2023
8+
ms.author: rogarana
9+
ms.subservice: elastic-san
10+
---
11+
12+
# Connect Azure Elastic SAN Preview volumes to an Azure Kubernetes Service cluster
13+
14+
This article explains how to connect an Azure Elastic storage area network (SAN) Preview volume from an Azure Kubernetes Service (AKS) cluster. To make this connection, enable the [Kubernetes iSCSI CSI driver](https://github.com/kubernetes-csi/csi-driver-iscsi) on your cluster. With this driver, you can access volumes on your Elastic SAN by creating persistent volumes on your AKS cluster, and then attaching the Elastic SAN volumes to the persistent volumes.
15+
16+
## About the driver
17+
18+
The iSCSI CSI driver is an open source project that allows you to connect to a Kubernetes cluster over iSCSI. Since the driver is an open source project, Microsoft won't provide support from any issues stemming from the driver, itself.
19+
20+
The Kubernetes iSCSI CSI driver is available on GitHub:
21+
22+
- [Kubernetes iSCSI CSI driver repository](https://github.com/kubernetes-csi/csi-driver-iscsi)
23+
- [Readme](https://github.com/kubernetes-csi/csi-driver-iscsi/blob/master/README.md)
24+
- [Report iSCSI driver issues](https://github.com/kubernetes-csi/csi-driver-iscsi/issues)
25+
26+
### Licensing
27+
28+
The iSCSI CSI driver for Kubernetes is [licensed under the Apache 2.0 license](https://github.com/kubernetes-csi/csi-driver-iscsi/blob/master/LICENSE).
29+
30+
## Prerequisites
31+
32+
- Have an [Azure Elastic SAN](elastic-san-create.md) with volumes
33+
- Use either the [latest Azure CLI](/cli/azure/install-azure-cli) or install the [latest Azure PowerShell module](/powershell/azure/install-az-ps)
34+
- Meet the [compatibility requirements](https://github.com/kubernetes-csi/csi-driver-iscsi/blob/master/README.md#container-images--kubernetes-compatibility) for the iSCSI CSI driver
35+
36+
## Limitations
37+
38+
- Dynamic allocation isn't currently supported
39+
- Only `ReadWriteOnce` access mode is currently supported
40+
41+
## Get started
42+
43+
### Driver installation
44+
45+
First, install the Kubernetes iSCSI CSI driver on your cluster. You have to perform a local install since a few code changes are required for the driver to connect to Elastic SAN volumes.
46+
47+
First, clone the driver repo:
48+
49+
```
50+
git clone https://github.com/kubernetes-csi/csi-driver-iscsi.git
51+
```
52+
53+
Elastic SAN doesn't currently support dynamic discovery used in this driver. The following code changes in the driver are required to add volumes statically.
54+
55+
Make the following modifications to pkg/lib/iscsi/iscsi/iscsi.go:
56+
57+
First, add a new function for static discovery:
58+
59+
```
60+
// Add a new function to make static discovery
61+
func (c *Connector) discoverTargetStatically(targetIqn string, iFace string, portal string) error {
62+
err := CreateDBEntry(targetIqn, portal, iFace, c.DiscoverySecrets, c.SessionSecrets)
63+
if err != nil {
64+
debug.Printf("Error creating db entry: %s\n", err.Error())
65+
return err
66+
}
67+
return nil
68+
}
69+
```
70+
71+
Then, make the following change so that you can use the function you created:
72+
73+
Replace:
74+
```
75+
if err := c.discoverTarget(targetIqn, iFace, portal); err != nil
76+
```
77+
with:
78+
```
79+
if err := c.discoverTargetStatically
80+
```
81+
82+
After the modifications, run the remaining install scripts:
83+
84+
```
85+
cd csi-driver-iscsi
86+
87+
./deploy/install-driver.sh master local
88+
```
89+
90+
After deployment, check the pods status to verify that the driver installed.
91+
92+
```bash
93+
kubectl -n kube-system get pod -o wide -l app=csi-iscsi-node
94+
```
95+
96+
### Volume information
97+
98+
To connect an Elastic SAN volume to an AKS cluster, you need the volume's StorageTargetIQN, StorageTargetPortalHostName, and StorageTargetPortalPort.
99+
100+
You may get them with the following Azure PowerShell command:
101+
102+
```azurepowershell
103+
Get-AzElasticSanVolume -ResourceGroupName $resourceGroupName -ElasticSanName $sanName -VolumeGroupName $searchedVolumeGroup -Name $searchedVolume
104+
```
105+
106+
You may also get them with the following Azure CLI command:
107+
108+
```azurecli
109+
az elastic-san volume show --elastic-san-name --name --resource-group --volume-group-name
110+
```
111+
112+
### Cluster configuration
113+
114+
Once you've retrieved your volume's information, you need to create a few yml files for your new resources on your AKS cluster.
115+
116+
### Storageclass
117+
118+
Use the following example to create a storageclass.yml file. This file defines your persistent volume's storageclass.
119+
120+
```yml
121+
apiVersion: storage.k8s.io/v1
122+
kind: StorageClass
123+
metadata:
124+
name: sanVolume
125+
provisioner: manual
126+
```
127+
128+
### Persistent volume
129+
130+
After you've created the storage class, create a *pv.yml* file. This file defines your [persistent volume](../../aks/concepts-storage.md#persistent-volumes). In the following example, replace `yourTargetPortal`, `yourTargetPortalPort`, and `yourIQN` with the values you collected earlier, then use the example to create a *pv.yml* file. If you need more than 1 gibibyte of storage and have it available, replace `1Gi` with the amount of storage you require.
131+
132+
```yml
133+
---
134+
apiVersion: v1
135+
kind: PersistentVolume
136+
metadata:
137+
name: iscsiplugin-pv
138+
labels:
139+
name: data-iscsiplugin
140+
spec:
141+
storageClassName: sanVolume
142+
accessModes:
143+
- ReadWriteOnce
144+
capacity:
145+
storage: 1Gi
146+
csi:
147+
driver: iscsi.csi.k8s.io
148+
volumeHandle: iscsi-data-id
149+
volumeAttributes:
150+
targetPortal: "yourTargetPortal:yourTargetPortalPort"
151+
portals: "[]"
152+
iqn: "yourIQN"
153+
lun: "0"
154+
iscsiInterface: "default"
155+
discoveryCHAPAuth: "false"
156+
sessionCHAPAuth: "false"
157+
```
158+
159+
After creating the *pv.yml* file, create a persistent volume with the following command:
160+
161+
```bash
162+
kubectl apply -f pathtoyourfile/pv.yaml
163+
```
164+
165+
### Persistent volume claim
166+
167+
Next, create a [persistent volume claim](../../aks/concepts-storage.md#persistent-volume-claims). Use the storage class we defined earlier with the persistent volume we defined. The following is an example of what your pvc.yml file might look like:
168+
169+
```yml
170+
apiVersion: v1
171+
kind: PersistentVolumeClaim
172+
metadata:
173+
name: iscsiplugin-pvc
174+
spec:
175+
accessModes:
176+
- ReadWriteOnce
177+
resources:
178+
requests:
179+
storage: 1Gi
180+
storageClassName: sanVolume
181+
selector:
182+
matchExpressions:
183+
- key: name
184+
operator: In
185+
values: ["data-iscsiplugin"]
186+
```
187+
188+
After creating the *pvc.yml* file, create a persistent volume claim.
189+
190+
```bash
191+
kubectl apply -f pathtoyourfile/pvc.yaml
192+
```
193+
194+
To verify your PersistentVolumeClaim is created and bound to the PersistentVolume, run the following command:
195+
196+
```bash
197+
kubectl get pvc pathtoyourfile
198+
```
199+
200+
201+
Finally, create a [pod manifest](../../aks/concepts-clusters-workloads.md#pods). The following is an example of what your *pod.yml* file might look like. You can use it to make your own pod manifest, replace the values for `name`, `image`, and `mountPath` with your own:
202+
203+
```yml
204+
apiVersion: v1
205+
kind: Pod
206+
metadata:
207+
name: nginx
208+
spec:
209+
containers:
210+
- image: maersk/nginx
211+
imagePullPolicy: Always
212+
name: nginx
213+
ports:
214+
- containerPort: 80
215+
protocol: TCP
216+
volumeMounts:
217+
- mountPath: /var/www
218+
name: iscsi-volume
219+
volumes:
220+
- name: iscsi-volume
221+
persistentVolumeClaim:
222+
claimName: iscsiplugin-pvc
223+
```
224+
225+
After creating the *pod.yml* file, create a pod.
226+
227+
```bash
228+
kubectl apply -f pathtoyourfile/pod.yaml
229+
```
230+
231+
To verify your Pod was created, run the following command:
232+
233+
```bash
234+
kubectl get pods
235+
```
236+
237+
You've now successfully connected an Elastic SAN volume to your AKS cluster.
238+
239+
## Next steps
240+
241+
[Plan for deploying an Elastic SAN Preview](elastic-san-planning.md)

articles/storage/elastic-san/elastic-san-connect-linux.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Connect to an Azure Elastic SAN (preview) volume - Linux.
3-
description: Learn how to connect to an Azure Elastic SAN (preview) volume from a Linux client.
2+
title: Connect to an Azure Elastic SAN Preview volume - Linux.
3+
description: Learn how to connect to an Azure Elastic SAN Preview volume from a Linux client.
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
@@ -10,15 +10,15 @@ ms.subservice: elastic-san
1010
ms.custom: references_regions, ignite-2022
1111
---
1212

13-
# Connect to Elastic SAN (preview) volumes - Linux
13+
# Connect to Elastic SAN Preview volumes - Linux
1414

15-
This article explains how to connect to an Elastic storage area network (SAN) volume from a Linux client. For details on connecting from a Windows client, see [Connect to Elastic SAN (preview) volumes - Windows](elastic-san-connect-windows.md).
15+
This article explains how to connect to an Elastic storage area network (SAN) volume from a Linux client. For details on connecting from a Windows client, see [Connect to Elastic SAN Preview volumes - Windows](elastic-san-connect-windows.md).
1616

1717
In this article, you'll add the Storage service endpoint to an Azure virtual network's subnet, then you'll configure your volume group to allow connections from your subnet. Finally, you'll configure your client environment to connect to an Elastic SAN volume and establish a connection.
1818

1919
## Prerequisites
2020

21-
- Complete [Deploy an Elastic SAN (preview)](elastic-san-create.md)
21+
- Complete [Deploy an Elastic SAN Preview](elastic-san-create.md)
2222
- An Azure Virtual Network, which you'll need to establish a connection from compute clients in Azure to your Elastic SAN volumes.
2323

2424
## Limitations
@@ -206,4 +206,4 @@ iscsiadm -m node --targetname yourTargetIQN -p yourTargetPortalHostName:yourTarg
206206

207207
## Next steps
208208

209-
[Configure Elastic SAN networking (preview)](elastic-san-networking.md)
209+
[Configure Elastic SAN networking Preview](elastic-san-networking.md)

articles/storage/elastic-san/elastic-san-connect-windows.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Connect to an Azure Elastic SAN (preview) volume - Windows
3-
description: Learn how to connect to an Azure Elastic SAN (preview) volume from a Windows client.
2+
title: Connect to an Azure Elastic SAN Preview volume - Windows
3+
description: Learn how to connect to an Azure Elastic SAN Preview volume from a Windows client.
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
@@ -10,15 +10,15 @@ ms.subservice: elastic-san
1010
ms.custom: references_regions, ignite-2022
1111
---
1212

13-
# Connect to Elastic SAN (preview) volumes - Windows
13+
# Connect to Elastic SAN Preview volumes - Windows
1414

15-
This article explains how to connect to an Elastic storage area network (SAN) volume from a Windows client. For details on connecting from a Linux client, see [Connect to Elastic SAN (preview) volumes - Linux](elastic-san-connect-linux.md).
15+
This article explains how to connect to an Elastic storage area network (SAN) volume from a Windows client. For details on connecting from a Linux client, see [Connect to Elastic SAN Preview volumes - Linux](elastic-san-connect-linux.md).
1616

1717
In this article, you'll add the Storage service endpoint to an Azure virtual network's subnet, then you'll configure your volume group to allow connections from your subnet. Finally, you'll configure your client environment to connect to an Elastic SAN volume and establish a connection.
1818

1919
## Prerequisites
2020

21-
- Complete [Deploy an Elastic SAN (preview)](elastic-san-create.md)
21+
- Complete [Deploy an Elastic SAN Preview](elastic-san-create.md)
2222
- An Azure Virtual Network, which you'll need to establish a connection from compute clients in Azure to your Elastic SAN volumes.
2323

2424
## Limitations
@@ -248,4 +248,4 @@ iscsicli PersistentLoginTarget yourStorageTargetIQN t yourStorageTargetPortalHos
248248

249249
## Next steps
250250

251-
[Configure Elastic SAN networking (preview)](elastic-san-networking.md)
251+
[Configure Elastic SAN networking Preview](elastic-san-networking.md)

articles/storage/elastic-san/elastic-san-create.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to deploy an Azure Elastic SAN (preview) with the Azure p
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 02/22/2023
7+
ms.date: 03/08/2023
88
ms.author: rogarana
99
ms.subservice: elastic-san
1010
ms.custom: references_regions, ignite-2022
@@ -16,8 +16,8 @@ This article explains how to deploy and configure an elastic storage area networ
1616

1717
## Prerequisites
1818

19-
- If you're using Azure PowerShell, use `Install-Module -Name Az.ElasticSan -Scope CurrentUser -Repository PSGallery -Force -RequiredVersion 0.1.0` to install the preview module.
20-
- If you're using Azure CLI, install the latest version. For installation instructions, see [How to install the Azure CLI](/cli/azure/install-azure-cli).
19+
- If you're using Azure PowerShell, install the [latest Azure PowerShell module](/powershell/azure/install-az-ps).
20+
- If you're using Azure CLI, install the [latest version](/cli/azure/install-azure-cli).
2121
- Once you've installed the latest version, run `az extension add -n elastic-san` to install the extension for Elastic SAN.
2222

2323
## Limitations
@@ -81,7 +81,7 @@ az feature show --name ElasticSanPreviewAccess --namespace Microsoft.ElasticSan
8181

8282
# [PowerShell](#tab/azure-powershell)
8383

84-
The following command creates an Elastic SAN that uses locally-redundant storage. To create one that uses zone-redundant storage, replace `Premium_LRS` with `Premium_ZRS`.
84+
The following command creates an Elastic SAN that uses locally redundant storage. To create one that uses zone-redundant storage, replace `Premium_LRS` with `Premium_ZRS`.
8585

8686
```azurepowershell
8787
## Variables
@@ -99,7 +99,7 @@ New-AzElasticSAN -ResourceGroupName $rgName -Name $sanName -AvailabilityZone $zo
9999
```
100100
# [Azure CLI](#tab/azure-cli)
101101

102-
The following command creates an Elastic SAN that uses locally-redundant storage. To create one that uses zone-redundant storage, replace `Premium_LRS` with `Premium_ZRS`.
102+
The following command creates an Elastic SAN that uses locally redundant storage. To create one that uses zone-redundant storage, replace `Premium_LRS` with `Premium_ZRS`.
103103

104104
```azurecli
105105
## Variables

0 commit comments

Comments
 (0)