mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-19 17:16:12 +00:00
support Azure data disk volume
Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
@@ -404,6 +404,9 @@ func TestExampleObjectSchemas(t *testing.T) {
|
||||
"../examples/volumes/azure_file": {
|
||||
"azure": &api.Pod{},
|
||||
},
|
||||
"../examples/volumes/azure_disk": {
|
||||
"azure": &api.Pod{},
|
||||
},
|
||||
}
|
||||
|
||||
capabilities.SetForTests(capabilities.Capabilities{
|
||||
|
51
examples/volumes/azure_disk/README.md
Normal file
51
examples/volumes/azure_disk/README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
|
||||
|
||||
<!-- BEGIN STRIP_FOR_RELEASE -->
|
||||
|
||||
<img src="http://kubernetes.io/kubernetes/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/kubernetes/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/kubernetes/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/kubernetes/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/kubernetes/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
|
||||
<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
|
||||
|
||||
If you are using a released version of Kubernetes, you should
|
||||
refer to the docs that go with that version.
|
||||
|
||||
Documentation for other releases can be found at
|
||||
[releases.k8s.io](http://releases.k8s.io).
|
||||
</strong>
|
||||
--
|
||||
|
||||
<!-- END STRIP_FOR_RELEASE -->
|
||||
|
||||
<!-- END MUNGE: UNVERSIONED_WARNING -->
|
||||
|
||||
# How to Use it?
|
||||
|
||||
On Azure VM, create a Pod using the volume spec based on [azure](azure.yaml).
|
||||
|
||||
In the pod, you need to provide the following information:
|
||||
|
||||
- *diskName*: (required) the name of the VHD blob object.
|
||||
- *diskURI*: (required) the URI of the vhd blob object.
|
||||
- *cachingMode*: (optional) disk caching mode. Must be one of None, ReadOnly, or ReadWrite. Default is None.
|
||||
- *fsType*: (optional) the filesytem type to mount. Default is ext4.
|
||||
- *readOnly*: (optional) whether the filesystem is used as readOnly. Default is false.
|
||||
|
||||
|
||||
Launch the Pod:
|
||||
|
||||
```console
|
||||
# kubectl create -f examples/volumes/azure_disk/azure.yaml
|
||||
```
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
[]()
|
||||
<!-- END MUNGE: GENERATED_ANALYTICS -->
|
16
examples/volumes/azure_disk/azure.yaml
Normal file
16
examples/volumes/azure_disk/azure.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: azure
|
||||
spec:
|
||||
containers:
|
||||
- image: kubernetes/pause
|
||||
name: azure
|
||||
volumeMounts:
|
||||
- name: azure
|
||||
mountPath: /mnt/azure
|
||||
volumes:
|
||||
- name: azure
|
||||
azureDisk:
|
||||
diskName: test.vhd
|
||||
diskURI: https://someaccount.blob.microsoft.net/vhds/test.vhd
|
Reference in New Issue
Block a user