Skip to content

Commit c78267c

Browse files
Move Profiles to stable
1 parent 154b98e commit c78267c

32 files changed

+141
-524
lines changed

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,8 @@ generate-spec-yaml:
274274
cd ./deploy/overlays/${OVERLAY}; ${BINDIR}/kustomize edit set image gke.gcr.io/gcs-fuse-csi-driver-webhook=${WEBHOOK_IMAGE}:${STAGINGVERSION};
275275
cd ./deploy/overlays/${OVERLAY}; ${BINDIR}/kustomize edit add configmap gcsfusecsi-image-config --behavior=merge --disableNameSuffixHash --from-literal=sidecar-image=${SIDECAR_IMAGE}:${STAGINGVERSION};
276276
cd ./deploy/overlays/${OVERLAY}; ${BINDIR}/kustomize edit add configmap gcsfusecsi-image-config --behavior=merge --disableNameSuffixHash --from-literal=metadata-sidecar-image=${PREFETCH_IMAGE}:${STAGINGVERSION};
277-
if [ "$(OVERLAY)" = "profiles" ]; then \
278-
echo "Applying profiles configmap..."; \
279-
cd ./deploy/overlays/profiles; ${BINDIR}/kustomize edit add configmap gcsfusecsi-profiles-config --behavior=create --disableNameSuffixHash --from-literal=cluster-location=${CLUSTER_LOCATION}; \
280-
cd ./deploy/overlays/profiles; ${BINDIR}/kustomize edit add configmap gcsfusecsi-profiles-config --behavior=create --disableNameSuffixHash --from-literal=project-number=${PROJECT_NUMBER}; \
281-
fi
277+
cd ./deploy/overlays/${OVERLAY}; ${BINDIR}/kustomize edit add configmap gcsfusecsi-profiles-config --behavior=merge --disableNameSuffixHash --from-literal=cluster-location=${CLUSTER_LOCATION};
278+
cd ./deploy/overlays/${OVERLAY}; ${BINDIR}/kustomize edit add configmap gcsfusecsi-profiles-config --behavior=merge --disableNameSuffixHash --from-literal=project-number=${PROJECT_NUMBER};
282279
# Must be unindented. When Make sees indented text, it attempts to pass it to the shell (/bin/sh) to execute. The shell doesn't know what ifeq is, so it crashes.
283280
ifeq ($(SELF_MANAGED_K8S), true)
284281
echo "[{\"op\": \"replace\",\"path\": \"/spec/tokenRequests/0/audience\",\"value\": \"${IDENTITY_PROVIDER}\"}]" > ./deploy/overlays/${OVERLAY}/project_patch_csi_driver.json

deploy/base/controller/controller.yaml

Lines changed: 21 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -32,95 +32,52 @@ 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
9437
imagePullPolicy: IfNotPresent
9538
args:
9639
- "--v=5"
9740
- "--endpoint=unix:/csi/csi.sock"
98-
- "--nodeid=$(KUBE_NODE_NAME)"
9941
- "--controller=true"
42+
- "--enable-gcsfuse-profiles=true"
43+
- "--leader-election=true"
44+
- "--leader-election-namespace=$(CLOUDSTORAGECSI_NAMESPACE)"
45+
- "--cluster-location=$(CLUSTER_LOCATION)"
46+
- "--project-number=$(PROJECT_NUMBER)"
47+
- "--http-endpoint=:29633"
10048
ports:
10149
- containerPort: 29633
102-
name: healthz
50+
name: http-endpoint
10351
protocol: TCP
10452
livenessProbe:
10553
failureThreshold: 5
10654
httpGet:
107-
path: /healthz
108-
port: healthz
55+
path: /healthz/leader-election
56+
port: http-endpoint
10957
initialDelaySeconds: 30
11058
timeoutSeconds: 10
11159
periodSeconds: 30
11260
resources:
11361
limits:
114-
cpu: 200m
11562
memory: 200Mi
11663
requests:
11764
cpu: 10m
11865
memory: 80Mi
11966
env:
120-
- name: KUBE_NODE_NAME
67+
- name: CLOUDSTORAGECSI_NAMESPACE
12168
valueFrom:
12269
fieldRef:
123-
fieldPath: spec.nodeName
70+
fieldPath: metadata.namespace
71+
- name: CLUSTER_LOCATION
72+
valueFrom:
73+
configMapKeyRef:
74+
name: gcsfusecsi-profiles-config
75+
key: cluster-location
76+
- name: PROJECT_NUMBER
77+
valueFrom:
78+
configMapKeyRef:
79+
name: gcsfusecsi-profiles-config
80+
key: project-number
12481
volumeMounts:
12582
- name: socket-dir
12683
mountPath: /csi

deploy/base/controller/controller_setup.yaml

Lines changed: 39 additions & 1 deletion
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
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
141+
apiGroup: rbac.authorization.k8s.io

deploy/base/node/node.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ spec:
5858
- --max-metric-collectors=-1
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ rules:
4242
- apiGroups: [""]
4343
resources: ["serviceaccounts"]
4444
verbs: ["get"]
45-
# Required to list PV annotations.
45+
# PV is required to read PV annotations.
46+
# PVC required to map PVC to PV from Pod.
4647
- apiGroups: [""]
47-
resources: ["persistentvolumes"]
48+
resources: ["persistentvolumes", "persistentvolumeclaims"]
4849
verbs: ["get", "list", "watch"]
49-
# Required to map PVC to PV from Pod.
50-
- apiGroups: [""]
51-
resources: ["persistentvolumeclaims"]
50+
# Required to get gcsfuse profile configs.
51+
- apiGroups: ["storage.k8s.io"]
52+
resources: ["storageclasses"]
5253
verbs: ["get", "list", "watch"]
5354
---
5455
apiVersion: rbac.authorization.k8s.io/v1

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

deploy/overlays/profiles/storageclass.yaml renamed to deploy/base/setup/storageclass.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,8 @@ parameters:
7474
fuseEphemeralStorageAllocatableFactor: "0.85"
7575
bucketScanResyncPeriod: "168h"
7676
bucketScanTimeout: "2m"
77+
---
78+
apiVersion: v1
79+
kind: ConfigMap
80+
metadata:
81+
name: gcsfusecsi-profiles-config

deploy/base/webhook/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ 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
6566
value: "IfNotPresent"

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

deploy/overlays/profiles/caBundle_patch_MutatingWebhookConfiguration.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)