-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] KEP 3751 volume attribute class #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 21 commits
c72a290
ac50923
e6f9f4a
f310525
97ee951
e53aee4
3677935
38715f3
799ca64
61fe1b9
8c533de
cd1c0f2
fe32894
8c180b7
fc0f5db
13b4ca4
ad56d4c
282eaeb
27eed2c
0a87a40
858f2d1
6cc24f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Package", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"program": "${fileDirname}", | ||
"args" : ["--run-in-prow", "false", "--gke-cluster-prefix", "csitest-", | ||
"--gke-is-alpha", "true", "--machine-type", "n4-standard-8", "--deploy-overlay-name", "noauth-debug", | ||
"--staging-image", "europe-west3-docker.pkg.dev/kimambo-sandbox/csi-dev/gce-pd-csi-driver", | ||
"--service-account-file", "/usr/local/google/home/kimambo/dev/go/src/github.com/maxkimambo/creds/cloud-sa.json", | ||
"--deploy-overlay-name", "noauth-debug", "--storageclass-files", "sc-standard.yaml,sc-balanced.yaml,sc-ssd.yaml", | ||
"--test-focus", "External.Storage", "--gce-zone", "us-central1-b", "--deployment-strategy", "gke", "--gke-cluster-version", "${gke_cluster_version}", "--test-version", "${test_version}", "--num-nodes", "3"] | ||
}, | ||
{ | ||
"name": "Cluster", | ||
"type": "go", | ||
"request": "attach", | ||
"mode": "remote", | ||
"debugAdapter": "dlv-dap", | ||
"substitutePath": [ | ||
{"from": "${workspaceFolder}", "to": "/go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver"} | ||
], | ||
"port": 2345, | ||
"host": "127.0.0.1" | ||
}, | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,3 +313,28 @@ roleRef: | |
kind: Role | ||
name: csi-gce-pd-leaderelection-role | ||
apiGroup: rbac.authorization.k8s.io | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you intend to check this in? This in handing over admin privileges to CSI driver. I assume you needed that for testing but we should limit the permissions required by CSI driver as good practice. |
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: cluster-admin | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] | ||
- nonResourceURLs: ["*"] | ||
verbs: ["*"] | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Role added temporarily, I need to find correct set of permissions that are required before this is final. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need view access to VolumeAttributesClasses similar to how CSI driver gets access to StorageClasses |
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: csi-gce-pd-controller-sa-cluster-admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: csi-gce-pd-controller-sa | ||
namespace: gce-pd-csi-driver | ||
roleRef: | ||
kind: ClusterRole | ||
name: cluster-admin | ||
apiGroup: rbac.authorization.k8s.io |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,11 @@ if [[ ! "$tmpDir" || ! -d "$tmpDir" ]]; then | |
exit 1 | ||
fi | ||
|
||
function cleanup { | ||
rm -rf "$tmpDir" | ||
} | ||
# function cleanup { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't check this in |
||
# rm -rf "$tmpDir" | ||
# } | ||
|
||
trap cleanup EXIT | ||
# trap cleanup EXIT | ||
|
||
pushd $tmpDir >& /dev/null | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
apiVersion: storage.k8s.io/v1alpha1 | ||
kind: VolumeAttributesClass | ||
metadata: | ||
name: silver | ||
driverName: pd.csi.storage.gke.io | ||
parameters: | ||
throughput: "350" | ||
iops: "6000" | ||
--- | ||
apiVersion: storage.k8s.io/v1alpha1 | ||
kind: VolumeAttributesClass | ||
metadata: | ||
name: gold | ||
driverName: pd.csi.storage.gke.io | ||
parameters: | ||
throughput: "550" | ||
iops: "15000" | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: balanced | ||
provisioner: pd.csi.storage.gke.io | ||
allowVolumeExpansion: true | ||
volumeBindingMode: WaitForFirstConsumer | ||
parameters: | ||
type: hyperdisk-balanced | ||
provisioned-throughput-on-create: "300Mi" | ||
provisioned-iops-on-create: "5000" | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: throughput-optimized | ||
provisioner: pd.csi.storage.gke.io | ||
volumeBindingMode: WaitForFirstConsumer | ||
allowVolumeExpansion: true | ||
parameters: | ||
type: hyperdisk-balanced | ||
provisioned-throughput-on-create: "500Mi" | ||
provisioned-iops-on-create: "10000" | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: balanced-pvc | ||
spec: | ||
volumeAttributesClassName: silver | ||
storageClassName: balanced | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 256Gi | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: throughput-optimized-pvc | ||
spec: | ||
volumeAttributesClassName: silver | ||
storageClassName: throughput-optimized | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 256Gi | ||
--- | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: pod-demo | ||
spec: | ||
volumes: | ||
- name: pvc-demo-vol | ||
persistentVolumeClaim: | ||
claimName: balanced-pvc | ||
- name: data-vol | ||
persistentVolumeClaim: | ||
claimName: throughput-optimized-pvc | ||
containers: | ||
- name: pod-demo | ||
image: nginx:latest | ||
resources: | ||
limits: | ||
cpu: 10m | ||
memory: 80Mi | ||
requests: | ||
cpu: 10m | ||
memory: 80Mi | ||
ports: | ||
- containerPort: 80 | ||
name: "http-server" | ||
volumeMounts: | ||
- mountPath: "/usr/share/nginx/html" | ||
name: pvc-demo-vol | ||
- mountPath: "/data" | ||
name: data-vol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you intend to check this in?