Skip to content

Instantly share code, notes, and snippets.

View j-griffith's full-sized avatar

John Griffith j-griffith

  • Bozeman, Montana
View GitHub Profile
// ignored when VolumeName is set
// +optional
Selector *metav1.LabelSelector
// Resources represents the minimum resources required
// +optional
Resources ResourceRequirements
// VolumeName is the binding reference to the PersistentVolume backing this
// claim. When set to non-empty value Selector is not evaluated
// +optional
VolumeName string
@j-griffith
j-griffith / kubeadm-setup.bash
Created January 11, 2019 15:29
my-kubeadm-setup
#!/bin/bash
#sudo kubeadm init --pod-network-cidr=10.244.0.0/16
#rm -rf .kube/
#mkdir -p .kube
#sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
#sudo chown $(id -u):$(id -g) $HOME/.kube/config
# Apply networking
#kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

DataSource Proposal

Background

This document proposes the extension of the DataSources field for PVC creation in Kubernetes. Snapshots as DataSources have already been added to Kubernetes, enabling a user to create a new PVC based off of a specified Snapshot. There are other common DataSources that can be used for PVC creation, including Cloning and Populators.

DataSources in general provides a clean abstraction to expose these other storage device related features (Cloning) and Services that retrieve data from remote sources (Populators).

Terminology

spec:
accessModes:
- ReadWriteOnce
storageClassName: csi-gce-pd
dataSource:
kind: PersistentVolumeClaim
name: pvc-1
..................
spec:
# cirros-image.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "cirros-pvc"
labels:
app: containerized-data-importer
annotations:
cdi.kubevirt.io/storage.import.endpoint: "http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-i386-disk.img" # Required. Format: (http||s3)://www.myUrl.com/path/of/data
cdi.kubevirt.io/storage.import.secretName: "" # Optional. The name of the secret containing credentials for the data source
spec:
persistentVolumeReclaimPolicy: Recycle
claimRef:
name: my-xfr-volume
namespace: nottheNSyourlookingfor
spec:
claimRef:
#name: my-xfr-volume
name: pvc-788dffb5-b60f-11e8-a6f8-54e1ada90ebb
namespace: nottheNSyourlookingfor
spec:
persistentVolumeReclaimPolicy: Recycle
diff --git a/tests/transport_test.go b/tests/transport_test.go
index 17d5def..e54a235 100644
--- a/tests/transport_test.go
+++ b/tests/transport_test.go
@@ -7,10 +7,10 @@ import (
"net/url"
+ "github.com/golang/glog"
. "github.com/onsi/ginkgo"
@j-griffith
j-griffith / gofmt.diff
Created September 7, 2018 16:34
gofmt diffs
diff --git a/tests/transport_test.go b/tests/transport_test.go
index 2c371c9..e54a235 100644
--- a/tests/transport_test.go