Skip to content

Commit 4af5f6c

Browse files
Move Profiles to stable
1 parent c62e03f commit 4af5f6c

File tree

8 files changed

+155
-64
lines changed

8 files changed

+155
-64
lines changed

deploy/base/controller/controller.yaml

Lines changed: 26 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -32,80 +32,31 @@ spec:
3232
serviceAccount: gcs-fuse-csi-controller-sa
3333
priorityClassName: csi-gcp-gcs-controller
3434
containers:
35-
- name: liveness-probe
36-
volumeMounts:
37-
- mountPath: /csi
38-
name: socket-dir
39-
image: registry.k8s.io/sig-storage/livenessprobe
40-
imagePullPolicy: IfNotPresent
41-
args:
42-
- --csi-address=/csi/csi.sock
43-
- --probe-timeout=3s
44-
- --health-port=29633
45-
- --v=2
46-
resources:
47-
limits:
48-
cpu: 50m
49-
memory: 100Mi
50-
requests:
51-
cpu: 10m
52-
memory: 20Mi
53-
- name: csi-external-provisioner
54-
image: registry.k8s.io/sig-storage/csi-provisioner
55-
imagePullPolicy: IfNotPresent
56-
args:
57-
- "--v=5"
58-
- "--csi-address=/csi/csi.sock"
59-
- "--timeout=250s"
60-
- "--extra-create-metadata"
61-
- "--http-endpoint=:22021"
62-
- "--leader-election-namespace=$(CLOUDSTORAGECSI_NAMESPACE)"
63-
- "--leader-election"
64-
- "--retry-interval-max=60s"
65-
resources:
66-
limits:
67-
cpu: 100m
68-
memory: 200Mi
69-
requests:
70-
cpu: 10m
71-
memory: 20Mi
72-
env:
73-
- name: CLOUDSTORAGECSI_NAMESPACE
74-
valueFrom:
75-
fieldRef:
76-
fieldPath: metadata.namespace
77-
ports:
78-
- containerPort: 22021
79-
name: http-endpoint
80-
protocol: TCP
81-
livenessProbe:
82-
failureThreshold: 1
83-
httpGet:
84-
path: /healthz/leader-election
85-
port: http-endpoint
86-
initialDelaySeconds: 10
87-
timeoutSeconds: 10
88-
periodSeconds: 20
89-
volumeMounts:
90-
- name: socket-dir
91-
mountPath: /csi
9235
- name: gcs-fuse-csi-driver
9336
image: gke.gcr.io/gcs-fuse-csi-driver
94-
imagePullPolicy: IfNotPresent
37+
imagePullPolicy: Always
9538
args:
9639
- "--v=5"
9740
- "--endpoint=unix:/csi/csi.sock"
9841
- "--nodeid=$(KUBE_NODE_NAME)"
9942
- "--controller=true"
43+
- "--enable-gcsfuse-profiles=true"
44+
- "--dataflux-batch-size=25000"
45+
- "--dataflux-parallelism=0"
46+
- "--leader-election=true"
47+
- "--leader-election-namespace=$(CLOUDSTORAGECSI_NAMESPACE)"
48+
- "--cluster-location=$(CLUSTER_LOCATION)"
49+
- "--project-number=$(PROJECT_NUMBER)"
50+
- "--http-endpoint=:29633"
10051
ports:
10152
- containerPort: 29633
102-
name: healthz
53+
name: http-endpoint
10354
protocol: TCP
10455
livenessProbe:
10556
failureThreshold: 5
10657
httpGet:
107-
path: /healthz
108-
port: healthz
58+
path: /healthz/leader-election
59+
port: http-endpoint
10960
initialDelaySeconds: 30
11061
timeoutSeconds: 10
11162
periodSeconds: 30
@@ -121,6 +72,20 @@ spec:
12172
valueFrom:
12273
fieldRef:
12374
fieldPath: spec.nodeName
75+
- name: CLOUDSTORAGECSI_NAMESPACE
76+
valueFrom:
77+
fieldRef:
78+
fieldPath: metadata.namespace
79+
- name: CLUSTER_LOCATION
80+
valueFrom:
81+
configMapKeyRef:
82+
name: gcsfusecsi-profiles-config
83+
key: cluster-location
84+
- name: PROJECT_NUMBER
85+
valueFrom:
86+
configMapKeyRef:
87+
name: gcsfusecsi-profiles-config
88+
key: project-number
12489
volumeMounts:
12590
- name: socket-dir
12691
mountPath: /csi

deploy/base/controller/controller_setup.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,42 @@ subjects:
100100
roleRef:
101101
kind: Role
102102
name: gcs-fuse-csi-leaderelection-role
103+
apiGroup: rbac.authorization.k8s.io
104+
---
105+
kind: ClusterRole
106+
apiVersion: rbac.authorization.k8s.io/v1
107+
metadata:
108+
name: gcs-fuse-csi-bucket-scanner-role
109+
rules:
110+
# Required to remove Pod scheduling gates.
111+
- apiGroups: [""]
112+
resources: ["pods"]
113+
verbs: ["get", "list", "watch", "patch"]
114+
# Required to patch PV annotations.
115+
- apiGroups: [""]
116+
resources: ["persistentvolumes"]
117+
verbs: ["get", "list", "watch", "patch"]
118+
# Required to map PVC to PV from Pod.
119+
- apiGroups: [""]
120+
resources: ["persistentvolumeclaims"]
121+
verbs: ["get", "list", "watch"]
122+
# Required to get gcsfuse profile configs.
123+
- apiGroups: ["storage.k8s.io"]
124+
resources: ["storageclasses"]
125+
verbs: ["get", "list", "watch"]
126+
# Required to get node zone to enable AnyC.
127+
- apiGroups: [""]
128+
resources: ["nodes"]
129+
verbs: ["get", "list", "watch"]
130+
---
131+
kind: ClusterRoleBinding
132+
apiVersion: rbac.authorization.k8s.io/v1
133+
metadata:
134+
name: gcs-fuse-csi-bucket-scanner-rolebinding
135+
subjects:
136+
- kind: ServiceAccount
137+
name: gcs-fuse-csi-controller-sa
138+
roleRef:
139+
kind: ClusterRole
140+
name: gcs-fuse-csi-bucket-scanner-role
103141
apiGroup: rbac.authorization.k8s.io

deploy/base/node/node.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
privileged: true
4747
readOnlyRootFilesystem: true
4848
image: gke.gcr.io/gcs-fuse-csi-driver
49-
imagePullPolicy: IfNotPresent
49+
imagePullPolicy: Always
5050
args:
5151
- --v=5
5252
- --endpoint=unix:/csi/csi.sock
@@ -58,6 +58,8 @@ spec:
5858
- --max-metric-collectors=10
5959
- --enable-sidecar-bucket-access-check=true
6060
- --enable-gcsfuse-kernel-params=true
61+
- --enable-gcsfuse-profiles=true
62+
- --enable-gcsfuse-profiles-internal=true
6163
ports:
6264
- containerPort: 9920
6365
name: metrics

deploy/base/node/node_setup.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ rules:
4242
- apiGroups: [""]
4343
resources: ["serviceaccounts"]
4444
verbs: ["get"]
45+
# Required to read PV annotations.
46+
- apiGroups: [""]
47+
resources: ["persistentvolumes"]
48+
verbs: ["get", "list", "watch"]
49+
# Required to get gcsfuse profile configs.
50+
- apiGroups: ["storage.k8s.io"]
51+
resources: ["storageclasses"]
52+
verbs: ["get", "list", "watch"]
4553
---
4654
apiVersion: rbac.authorization.k8s.io/v1
4755
kind: ClusterRoleBinding

deploy/base/setup/kustomization.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ kind: Kustomization
1818
namespace: gcs-fuse-csi-driver
1919
resources:
2020
- cluster_setup.yaml
21-
- csi_driver.yaml
21+
- csi_driver.yaml
22+
- storageclass.yaml
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright 2018 The Kubernetes Authors.
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
apiVersion: storage.k8s.io/v1
17+
kind: StorageClass
18+
metadata:
19+
name: gcsfusecsi-training
20+
labels:
21+
gke-gcsfuse/profile: "true"
22+
provisioner: gcsfuse.csi.storage.gke.io
23+
mountOptions:
24+
- profile:aiml-training
25+
parameters:
26+
skipCSIBucketAccessCheck: "true"
27+
gcsfuseMetadataPrefetchOnMount: "true"
28+
fuseFileCacheMediumPriority: "gpu:ram|lssd,tpu:ram,general_purpose:ram|lssd"
29+
fuseMemoryAllocatableFactor: "0.7"
30+
fuseEphemeralStorageAllocatableFactor: "0.85"
31+
bucketScanResyncPeriod: "168h"
32+
bucketScanTimeout: "2m"
33+
---
34+
apiVersion: storage.k8s.io/v1
35+
kind: StorageClass
36+
metadata:
37+
name: gcsfusecsi-serving
38+
labels:
39+
gke-gcsfuse/profile: "true"
40+
provisioner: gcsfuse.csi.storage.gke.io
41+
mountOptions:
42+
- profile:aiml-serving
43+
- read_ahead_kb=1024
44+
parameters:
45+
anywhereCacheZones: "*"
46+
anywhereCacheAdmissionPolicy: "admit-on-first-miss"
47+
anywhereCacheTTL: "1h"
48+
skipCSIBucketAccessCheck: "true"
49+
gcsfuseMetadataPrefetchOnMount: "true"
50+
fuseFileCacheMediumPriority: "gpu:ram|lssd,tpu:ram,general_purpose:ram|lssd"
51+
fuseMemoryAllocatableFactor: "0.7"
52+
fuseEphemeralStorageAllocatableFactor: "0.85"
53+
bucketScanResyncPeriod: "168h"
54+
bucketScanTimeout: "2m"
55+
---
56+
apiVersion: storage.k8s.io/v1
57+
kind: StorageClass
58+
metadata:
59+
name: gcsfusecsi-checkpointing
60+
labels:
61+
gke-gcsfuse/profile: "true"
62+
provisioner: gcsfuse.csi.storage.gke.io
63+
mountOptions:
64+
- profile:aiml-checkpointing
65+
- read_ahead_kb=1024
66+
parameters:
67+
skipCSIBucketAccessCheck: "true"
68+
gcsfuseMetadataPrefetchOnMount: "true"
69+
fuseFileCacheMediumPriority: "gpu:ram|lssd,tpu:ram,general_purpose:ram|lssd"
70+
fuseMemoryAllocatableFactor: "0.7"
71+
fuseEphemeralStorageAllocatableFactor: "0.85"
72+
bucketScanResyncPeriod: "168h"
73+
bucketScanTimeout: "2m"

deploy/base/webhook/deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ spec:
6060
- --port=22030
6161
- --health-probe-bind-address=:22031
6262
- --should-inject-sa-vol=true
63+
- --enable-gcsfuse-profiles=true
6364
env:
6465
- name: SIDECAR_IMAGE_PULL_POLICY
65-
value: "IfNotPresent"
66+
value: "Always"
6667
- name: SIDECAR_IMAGE
6768
valueFrom:
6869
configMapKeyRef:

deploy/base/webhook/webhook_setup.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ rules:
3636
- apiGroups: [""]
3737
resources: ["nodes", "persistentvolumes", "persistentvolumeclaims", "configmaps"]
3838
verbs: ["get","list","watch"]
39+
- apiGroups: ["storage.k8s.io"]
40+
resources: ["storageclasses"]
41+
verbs: ["get","list","watch"]
3942
---
4043
apiVersion: rbac.authorization.k8s.io/v1
4144
kind: ClusterRoleBinding

0 commit comments

Comments
 (0)