Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

How to provision volumes on kubernetes of specific specific storageos namespace #22

Open
hgfjxn opened this issue Mar 29, 2019 · 0 comments

Comments

@hgfjxn
Copy link

hgfjxn commented Mar 29, 2019

storageos namespace: dev
storrageos user:dev, role user, group dev
storaegos policy: group dev -> namespace dev

on k8s,

  1. create secret (storageos-dev-secret) of user dev;
  2. create storageclass use storageos-dev-secret;
  3. create pvc.

Secret:

$ kubectl create -f - << END
apiVersion: v1
kind: Secret
metadata:
  name: storageos-dev-secret
type: "kubernetes.io/storageos"
data:
  apiAddress: dGNwOi8vMTAuNjEuMTUwLjE4OjU3MDU=
  apiUsername: ZGV2
  apiPassword: ***
END

storageclass

$ kubectl create -f - << END
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
  name: dev
provisioner: kubernetes.io/storageos
parameters:
  pool: default
  description: dev environment storage provisioner
  fsType: ext4
  adminSecretNamespace: default
  adminSecretName: storageos-dev-secret
END

PVC:

$ kubectl create -f - << END
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: claim
  annotations:
    volume.beta.kubernetes.io/storage-class: dev
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
END

result:

Events:
  Type       Reason              Age                   From                         Message
  ----       ------              ----                  ----                         -------
  Warning    ProvisioningFailed  4m6s (x389 over 14h)  persistentvolume-controller  Failed to provision volume with StorageClass "dev": API error (Forbidden request. Your user cannot perform this action):
Mounted By:  <none>

Please help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant