Adam Litke - alitke@redhat.com
Principle Software Engineer - Red Hat
FOSDEM 2018 - 04 February 2018
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: test-claim
spec:
storageClassName: standalone-cinder
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
options := volumes_v2.CreateOpts{
Name: name,
Size: sizeGB,
VolumeType: volType,
AvailabilityZone: availability,
SourceVolID: sourceVolID,
}
vol, err := volumes_v2.Create(vs, &options).Extract()
var conn volumeConnection
err := volumeactions.InitializeConnection(vs, volumeID, &opt).ExtractInto(&conn)
struct {
VolumeID: "ff7b41e1-09ab-4502-b672-e490378183e2",
Name: "cinder-dynamic-pvc-3f025a35-ffe4-11e7-a6aa-525400e1c724",
AuthMethod: "CHAP",
AuthUsername: "jhd9NXVedRvR5M5r8ybC",
AuthPassword: "3H7eXNWDzPzqPBdS",
TargetPortal: "192.168.122.221:3260",
TargetIqn: "iqn.2010-10.org.openstack:volume-ff7b41e1-09ab-4502-b672-e490378183e2",
TargetLun: 0
}
kind: PersistentVolume
metadata:
annotations:
cinderVolumeId: ff7b41e1-09ab-4502-b672-e490378183e2
pv.kubernetes.io/provisioned-by: openstack.org/standalone-cinder
name: pvc-3efe2d9c-ffe4-11e7-9d5b-525400e1c724
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
claimRef:
kind: PersistentVolumeClaim
name: test-claim
namespace: default
iscsi:
chapAuthSession: true
iqn: iqn.2010-10.org.openstack:volume-ff7b41e1-09ab-4502-b672-e490378183e2
iscsiInterface: default
lun: 0
secretRef:
name: pvc-3efe2d9c-ffe4-11e7-9d5b-525400e1c724-secret
targetPortal: 192.168.122.221:3260
persistentVolumeReclaimPolicy: Delete
storageClassName: standalone-cinder
status:
phase: Bound
Note that cinder is not involved
kind: Pod
metadata:
name: demo
spec:
containers:
- name: demo
image: alpine:latest
volumeMounts:
- name: data
mountPath: /storage
volumes:
- name: data
persistentVolumeClaim:
claimName: test-claim
$ sudo iscsiadm -m session
tcp: [3] 192.168.122.221:3260,1 iqn.2010-10.org.openstack:\
volume-c1aa5a52-8aef-4e2f-8dfa-5edea788568a (non-flash)
$ mount | grep kubelet/pods
/dev/sda on /var/lib/kubelet/pods/0673fee0-ffc4-11e7-9d5b-525400e1c724/ \
volumes/kubernetes.io~iscsi/pvc-1c8961d3-ffc3-11e7-9d5b-525400e1c724 \
type ext4 (rw,relatime,seclabel,stripe=16,data=ordered)