aliyun-disk

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2018 License: MIT Imports: 8 Imported by: 0

README

aliyun-disk

Build Status

Aliyun Disk Kubernetes FlexVolume Driver

Usage

  1. Copy aliyun-disk binary to kubelet volume plugin directory. (/usr/libexec/kubernetes/kubelet-plugins/volume/exec/pragkent.me~aliyun-disk)
  2. Add four env variables to kube-controller-manager:
  • ALIYUN_ACCESS_KEY
  • ALIYUN_ACCESS_SECRET
  • ALIYUN_REGION
  • ALIYUN_CLUSTER

Install

To install, use go get:

$ go get github.com/pragkent/aliyun-disk

Examples

Volume
apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
  - name: myfrontend
    image: nginx
    volumeMounts:
    - mountPath: /var/www/html
      name: my-disk
  volumes:
    - name: my-disk
      flexVolume:
        driver: pragkent.me/aliyun-disk
        fsType: ext4
        options:
          diskId: "d-12345"
Static PersistentVolume
apiVersion: v1
kind: PersistentVolume
metadata:
  name: myvol
  labels:
    type: aliyundisk
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  flexVolume:
    driver: pragkent.me/aliyun-disk
    fsType: ext4
    options:
      diskId: "d-12345"
Dynamic PersistentVolume and StorageClass

Deploy aliyundisk-provisioner on your cluster first.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: ssd
provisioner: pragkent.me/aliyun-disk
parameters:
  category: cloud_ssd

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: my-pvd-claim
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ssd
  resources:
    requests:
      storage: 5Gi

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL