Skip to content

Commit 1f99bef

Browse files
committed
deploy: set namespace as kube-system
The CSI driver needs permissions across all namespaces for secrets syncing and access to the host filesystem. A non-cluster admin user should not have the ability to update or modify the CSI driver due to these high level of privileges. This change would require users upgrading from previous verisons of the driver to run the following to cleanup old resources: kubectl delete DaemonSet csi-secrets-store -namespace default kubectl delete DaemonSet csi-secrets-store-windows -namespace default kubectl delete ServiceAccount secrets-store-csi-driver -namespace default
1 parent 245c9c9 commit 1f99bef

File tree

8 files changed

+22
-9
lines changed

8 files changed

+22
-9
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ kubectl apply -f deploy/rbac-secretproviderclass.yaml # update the namespace of
109109
kubectl apply -f deploy/csidriver.yaml
110110
kubectl apply -f deploy/secrets-store.csi.x-k8s.io_secretproviderclasses.yaml
111111
kubectl apply -f deploy/secrets-store.csi.x-k8s.io_secretproviderclasspodstatuses.yaml
112-
kubectl apply -f deploy/secrets-store-csi-driver.yaml --namespace $NAMESPACE
112+
kubectl apply -f deploy/secrets-store-csi-driver.yaml
113113

114114
# If using the driver to sync secrets-store content as Kubernetes Secrets, deploy the additional RBAC permissions
115115
# required to enable this feature
@@ -119,13 +119,13 @@ kubectl apply -f deploy/rbac-secretprovidersyncing.yaml
119119
kubectl apply -f deploy/csidriver-1.15.yaml
120120

121121
# [OPTIONAL] To deploy driver on windows nodes
122-
kubectl apply -f deploy/secrets-store-csi-driver-windows.yaml --namespace $NAMESPACE
122+
kubectl apply -f deploy/secrets-store-csi-driver-windows.yaml
123123
```
124124

125125
To validate the installer is running as expected, run the following commands:
126126

127127
```bash
128-
kubectl get po --namespace $NAMESPACE
128+
kubectl get po --namespace=kube-system
129129
```
130130

131131
You should see the Secrets Store CSI driver pods running on each agent node:
@@ -143,6 +143,17 @@ NAME
143143
secretproviderclasses.secrets-store.csi.x-k8s.io
144144
```
145145

146+
**Note**: v0.0.17 and earlier installed the driver to the `default` namespace.
147+
Newer versions of the driver will install the driver to the `kube-system`
148+
namespace. After applying the new YAML files to your cluster run the following
149+
to clean up old resources:
150+
151+
```bash
152+
kubectl delete daemonset csi-secrets-store --namespace=default
153+
kubectl delete daemonset csi-secrets-store-windows --namespace=default
154+
kubectl delete serviceaccount secrets-store-csi-driver --namespace=default
155+
```
156+
146157
</details>
147158

148159
### Use the Secrets Store CSI Driver with a Provider

config/rbac-syncsecret/role_binding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ roleRef:
99
subjects:
1010
- kind: ServiceAccount
1111
name: secrets-store-csi-driver
12-
namespace: default
12+
namespace: kube-system

config/rbac/role_binding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ roleRef:
99
subjects:
1010
- kind: ServiceAccount
1111
name: secrets-store-csi-driver
12-
namespace: default
12+
namespace: kube-system

config/rbac/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: secrets-store-csi-driver
5-
namespace: default
5+
namespace: kube-system

manifest_staging/deploy/rbac-secretproviderclass.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: secrets-store-csi-driver
5-
namespace: default
5+
namespace: kube-system
66
---
77
apiVersion: rbac.authorization.k8s.io/v1
88
kind: ClusterRole
@@ -65,4 +65,4 @@ roleRef:
6565
subjects:
6666
- kind: ServiceAccount
6767
name: secrets-store-csi-driver
68-
namespace: default
68+
namespace: kube-system

manifest_staging/deploy/rbac-secretprovidersyncing.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ roleRef:
2828
subjects:
2929
- kind: ServiceAccount
3030
name: secrets-store-csi-driver
31-
namespace: default
31+
namespace: kube-system

manifest_staging/deploy/secrets-store-csi-driver-windows.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ kind: DaemonSet
22
apiVersion: apps/v1
33
metadata:
44
name: csi-secrets-store-windows
5+
namespace: kube-system
56
spec:
67
selector:
78
matchLabels:

manifest_staging/deploy/secrets-store-csi-driver.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ kind: DaemonSet
22
apiVersion: apps/v1
33
metadata:
44
name: csi-secrets-store
5+
namespace: kube-system
56
spec:
67
selector:
78
matchLabels:

0 commit comments

Comments
 (0)