Skip to content

Commit 74dd773

Browse files
authored
Merge pull request #445 from aramase/update-readme
docs: update readme to reference docs site
2 parents 2878bf8 + c2dbad0 commit 74dd773

File tree

3 files changed

+6
-270
lines changed

3 files changed

+6
-270
lines changed

README.md

Lines changed: 6 additions & 266 deletions
Original file line numberDiff line numberDiff line change
@@ -26,279 +26,19 @@ Join us to help define the direction and implementation of this project!
2626
- Supports pod portability with the SecretProviderClass CRD
2727
- Supports windows containers (Kubernetes version v1.18+)
2828
- Supports sync with Kubernetes Secrets (Secrets Store CSI Driver v0.0.10+)
29-
30-
#### Table of Contents
31-
32-
- [Kubernetes Secrets Store CSI Driver](#kubernetes-secrets-store-csi-driver)
33-
- [Want to help?](#want-to-help)
34-
- [Features](#features)
35-
- [Table of Contents](#table-of-contents)
36-
- [How It Works](#how-it-works)
37-
- [Demo](#demo)
38-
- [Usage](#usage)
39-
- [Prerequisites](#prerequisites)
40-
- [Supported kubernetes versions](#supported-kubernetes-versions)
41-
- [Install the Secrets Store CSI Driver](#install-the-secrets-store-csi-driver)
42-
- [Use the Secrets Store CSI Driver with a Provider](#use-the-secrets-store-csi-driver-with-a-provider)
43-
- [Create your own SecretProviderClass Object](#create-your-own-secretproviderclass-object)
44-
- [Update your Deployment Yaml](#update-your-deployment-yaml)
45-
- [Secret Content is Mounted on Pod Start](#secret-content-is-mounted-on-pod-start)
46-
- [[OPTIONAL] Sync with Kubernetes Secrets](#optional-sync-with-kubernetes-secrets)
47-
- [[OPTIONAL] Set ENV VAR](#optional-set-env-var)
48-
- [[OPTIONAL] Enable Auto Rotation of Secrets](#optional-enable-auto-rotation-of-secrets)
49-
- [Providers](#providers)
50-
- [Criteria for Supported Providers](#criteria-for-supported-providers)
51-
- [Removal from Supported Providers](#removal-from-supported-providers)
52-
- [Testing](#testing)
53-
- [Unit Tests](#unit-tests)
54-
- [End-to-end Tests](#end-to-end-tests)
55-
- [Known Limitations](#known-limitations)
56-
- [Troubleshooting](#troubleshooting)
57-
- [Code of conduct](#code-of-conduct)
58-
59-
## How It Works
60-
61-
The diagram below illustrates how Secrets Store CSI Volume works.
62-
63-
![diagram](img/diagram.png)
29+
- Supports multiple secrets stores providers in the same cluster.
6430

6531
## Demo
6632

67-
![Secrets Store CSI Driver Demo](img/demo.gif "Secrets Store CSI Driver Azure Key Vault Provider Demo")
68-
69-
## Usage
70-
71-
### Prerequisites
72-
73-
#### Supported kubernetes versions
74-
75-
Recommended Kubernetes version: v1.16.0+
76-
77-
> NOTE: The CSI Inline Volume feature was introduced in Kubernetes v1.15.x. Version 1.15.x will require the `CSIInlineVolume` feature gate to be updated in the cluster. Version 1.16+ does not require any feature gate.
78-
79-
<details>
80-
<summary><strong> For v1.15.x, update CSI Inline Volume feature gate </strong></summary>
81-
82-
The CSI Inline Volume feature was introduced in Kubernetes v1.15.x. We need to make the following updates to include the `CSIInlineVolume` feature gate:
83-
84-
- Update the API Server manifest to append the following feature gate:
85-
86-
```yaml
87-
--feature-gates=CSIInlineVolume=true
88-
```
89-
90-
- Update Kubelet manifest on each node to append the `CSIInlineVolume` feature gate:
91-
92-
```yaml
93-
--feature-gates=CSIInlineVolume=true
94-
```
95-
</details>
96-
97-
### Install the Secrets Store CSI Driver
98-
99-
**Using Helm Chart**
100-
101-
Follow the [guide to install driver using Helm](charts/secrets-store-csi-driver/README.md)
102-
103-
104-
<details>
105-
<summary><strong>[ALTERNATIVE DEPLOYMENT OPTION] Using Deployment Yamls</strong></summary>
106-
107-
```bash
108-
kubectl apply -f deploy/rbac-secretproviderclass.yaml # update the namespace of the secrets-store-csi-driver ServiceAccount
109-
kubectl apply -f deploy/csidriver.yaml
110-
kubectl apply -f deploy/secrets-store.csi.x-k8s.io_secretproviderclasses.yaml
111-
kubectl apply -f deploy/secrets-store.csi.x-k8s.io_secretproviderclasspodstatuses.yaml
112-
kubectl apply -f deploy/secrets-store-csi-driver.yaml
113-
114-
# If using the driver to sync secrets-store content as Kubernetes Secrets, deploy the additional RBAC permissions
115-
# required to enable this feature
116-
kubectl apply -f deploy/rbac-secretprovidersyncing.yaml
117-
118-
# [OPTIONAL] For kubernetes version < 1.16 running `kubectl apply -f deploy/csidriver.yaml` will fail. To install the driver run
119-
kubectl apply -f deploy/csidriver-1.15.yaml
120-
121-
# [OPTIONAL] To deploy driver on windows nodes
122-
kubectl apply -f deploy/secrets-store-csi-driver-windows.yaml
123-
```
124-
125-
To validate the installer is running as expected, run the following commands:
126-
127-
```bash
128-
kubectl get po --namespace=kube-system
129-
```
130-
131-
You should see the Secrets Store CSI driver pods running on each agent node:
132-
133-
```bash
134-
csi-secrets-store-qp9r8 3/3 Running 0 4m
135-
csi-secrets-store-zrjt2 3/3 Running 0 4m
136-
```
137-
138-
You should see the following CRDs deployed:
139-
140-
```bash
141-
kubectl get crd
142-
NAME
143-
secretproviderclasses.secrets-store.csi.x-k8s.io
144-
secretproviderclasspodstatuses.secrets-store.csi.x-k8s.io
145-
```
146-
147-
**Note**: v0.0.17 and earlier installed the driver to the `default` namespace.
148-
Newer versions of the driver will install the driver to the `kube-system`
149-
namespace. After applying the new YAML files to your cluster run the following
150-
to clean up old resources:
151-
152-
```bash
153-
kubectl delete daemonset csi-secrets-store --namespace=default
154-
kubectl delete daemonset csi-secrets-store-windows --namespace=default
155-
kubectl delete serviceaccount secrets-store-csi-driver --namespace=default
156-
```
157-
158-
</details>
159-
160-
### Use the Secrets Store CSI Driver with a Provider
161-
162-
Select a provider from the following list, then follow the installation steps for the provider:
163-
- [Azure Provider](https://github.com/Azure/secrets-store-csi-driver-provider-azure#usage)
164-
- [Vault Provider](https://github.com/hashicorp/secrets-store-csi-driver-provider-vault)
165-
- [GCP Provider](https://github.com/GoogleCloudPlatform/secrets-store-csi-driver-provider-gcp)
166-
167-
### Create your own SecretProviderClass Object
168-
169-
To use the Secrets Store CSI driver, create a `SecretProviderClass` custom resource to provide driver configurations and provider-specific parameters to the CSI driver.
170-
171-
A `SecretProviderClass` custom resource should have the following components:
172-
```yaml
173-
apiVersion: secrets-store.csi.x-k8s.io/v1alpha1
174-
kind: SecretProviderClass
175-
metadata:
176-
name: my-provider
177-
spec:
178-
provider: vault # accepted provider options: azure or vault or gcp
179-
parameters: # provider-specific parameters
180-
```
181-
182-
Here is a sample [`SecretProviderClass` custom resource](test/bats/tests/vault/vault_v1alpha1_secretproviderclass.yaml)
183-
184-
### Update your Deployment Yaml
185-
186-
To ensure your application is using the Secrets Store CSI driver, update your deployment yaml to use the `secrets-store.csi.k8s.io` driver and reference the `SecretProviderClass` resource created in the previous step.
187-
188-
```yaml
189-
volumes:
190-
- name: secrets-store-inline
191-
csi:
192-
driver: secrets-store.csi.k8s.io
193-
readOnly: true
194-
volumeAttributes:
195-
secretProviderClass: "my-provider"
196-
```
197-
198-
Here is a sample [deployment yaml](test/bats/tests/vault/nginx-pod-vault-inline-volume-secretproviderclass.yaml) using the Secrets Store CSI driver.
199-
200-
### Secret Content is Mounted on Pod Start
201-
202-
On pod start and restart, the driver will communicate with the provider using gRPC to retrieve the secret content from the external Secrets Store you have specified in the `SecretProviderClass` custom resource. Then the volume is mounted in the pod as `tmpfs` and the secret contents are written to the volume.
203-
204-
To validate, once the pod is started, you should see the new mounted content at the volume path specified in your deployment yaml.
205-
206-
```bash
207-
kubectl exec -it nginx-secrets-store-inline ls /mnt/secrets-store/
208-
foo
209-
```
210-
211-
### [OPTIONAL] Sync with Kubernetes Secrets
212-
213-
In some cases, you may want to create a Kubernetes Secret to mirror the mounted content. Use the optional `secretObjects` field to define the desired state of the synced Kubernetes secret objects. **The volume mount is required for the Sync With Kubernetes Secrets**
214-
> NOTE: If the provider supports object alias for the mounted file, then make sure the `objectName` in `secretObjects` matches the name of the mounted content. This could be the object name or the object alias.
215-
216-
A `SecretProviderClass` custom resource should have the following components:
217-
```yaml
218-
apiVersion: secrets-store.csi.x-k8s.io/v1alpha1
219-
kind: SecretProviderClass
220-
metadata:
221-
name: my-provider
222-
spec:
223-
provider: vault # accepted provider options: azure or vault or gcp
224-
secretObjects: # [OPTIONAL] SecretObject defines the desired state of synced K8s secret objects
225-
- data:
226-
- key: username # data field to populate
227-
objectName: foo1 # name of the mounted content to sync. this could be the object name or the object alias
228-
secretName: foosecret # name of the Kubernetes Secret object
229-
type: Opaque # type of the Kubernetes Secret object e.g. Opaque, kubernetes.io/tls
230-
```
231-
> NOTE: Here is the list of supported Kubernetes Secret types: `Opaque`, `kubernetes.io/basic-auth`, `bootstrap.kubernetes.io/token`, `kubernetes.io/dockerconfigjson`, `kubernetes.io/dockercfg`, `kubernetes.io/ssh-auth`, `kubernetes.io/service-account-token`, `kubernetes.io/tls`.
232-
233-
Here is a sample [`SecretProviderClass` custom resource](test/bats/tests/vault/vault_synck8s_v1alpha1_secretproviderclass.yaml) that syncs Kubernetes secrets.
234-
235-
### [OPTIONAL] Set ENV VAR
236-
237-
Once the secret is created, you may wish to set an ENV VAR in your deployment to reference the new Kubernetes secret.
238-
239-
```yaml
240-
spec:
241-
containers:
242-
- image: nginx
243-
name: nginx
244-
env:
245-
- name: SECRET_USERNAME
246-
valueFrom:
247-
secretKeyRef:
248-
name: foosecret
249-
key: username
250-
```
251-
Here is a sample [deployment yaml](test/bats/tests/vault/nginx-deployment-synck8s.yaml) that creates an ENV VAR from the synced Kubernetes secret.
252-
253-
### [OPTIONAL] Enable Auto Rotation of Secrets
254-
255-
You can setup the Secrets Store CSI Driver to periodically update the pod mount and Kubernetes Secret with the latest content from external secrets-store. Refer to [doc](docs/README.rotation.md) for steps on enabling auto rotation.
256-
257-
**NOTE** The CSI driver **does not restart** the application pods. It only handles updating the pod mount and Kubernetes secret similar to how Kubernetes handles updates to Kubernetes secret mounted as volumes.
258-
259-
260-
## Providers
261-
262-
This project features a pluggable provider interface developers can implement that defines the actions of the Secrets Store CSI driver. This enables retrieval of sensitive objects stored in an enterprise-grade external secrets store into Kubernetes while continue to manage these objects outside of Kubernetes.
263-
264-
### Criteria for Supported Providers
265-
266-
Here is a list of criteria for supported provider:
267-
1. Code audit of the provider implementation to ensure it adheres to the required provider-driver interface - [Implementing a Provider for Secrets Store CSI Driver](docs/README.new-provider.md)
268-
2. Add provider to the e2e test suite to demonstrate it functions as expected https://github.com/kubernetes-sigs/secrets-store-csi-driver/tree/master/test/bats Please use existing providers e2e tests as a reference.
269-
3. If any update is made by a provider (not limited to security updates), the provider is expected to update the provider's e2e test in this repo
270-
271-
### Removal from Supported Providers
272-
273-
Failure to adhere to the [Criteria for Supported Providers](#criteria-for-supported-providers) will result in the removal of the provider from the supported list and subject to another review before it can be added back to the list of supported providers.
274-
275-
When a provider's e2e tests are consistently failing with the latest version of the driver, the driver maintainers will coordinate with the provider maintainers to provide a fix. If the test failures are not resolved within 4 weeks, then the provider will be removed from the list of supported providers.
276-
277-
## Testing
278-
279-
### Unit Tests
280-
281-
Run unit tests locally with `make test`.
282-
283-
### End-to-end Tests
284-
285-
End-to-end tests automatically runs on Prow when a PR is submitted. If you want to run using a local or remote Kubernetes cluster, make sure to have `kubectl`, `helm` and `bats` set up in your local environment and then run `make e2e-azure` or `make e2e-vault` with custom images.
286-
287-
Job config for test jobs run for each PR in prow can be found [here](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-sigs/secrets-store-csi-driver/secrets-store-csi-driver-config.yaml)
288-
289-
## Known Limitations
33+
![Secrets Store CSI Driver Demo](/img/demo.gif "Secrets Store CSI Driver Azure Key Vault Provider Demo")
29034

291-
- [Mounted content and Kubernetes Secret not updated after secret is updated in external secrets-store](docs/README.limitations.md#mounted-content-and-kubernetes-secret-not-updated-after-secret-is-updated-in-external-secrets-store)
35+
## Getting Started
29236

293-
## Troubleshooting
37+
Check out the [installation instructions](https://secrets-store-csi-driver.sigs.k8s.io/getting-started/installation.html) to deploy the Secrets Store CSI Driver and providers. Get familiar with our [CRDs and core components](https://secrets-store-csi-driver.sigs.k8s.io/concepts.html)
29438

295-
- To troubleshoot issues with the csi driver, you can look at logs from the `secrets-store` container of the csi driver pod running on the same node as your application pod:
296-
```bash
297-
kubectl get pod -o wide
298-
# find the secrets store csi driver pod running on the same node as your application pod
39+
## Documentation
29940

300-
kubectl logs csi-secrets-store-secrets-store-csi-driver-7x44t secrets-store
301-
```
41+
Please see the [docs](https://secrets-store-csi-driver.sigs.k8s.io) for more in-depth information and supported features.
30242

30343
## Code of conduct
30444

docs/book/src/introduction.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ Join us to help define the direction and implementation of this project!
2222
- Supports windows containers (Kubernetes version v1.18+)
2323
- Supports sync with Kubernetes Secrets (Secrets Store CSI Driver v0.0.10+)
2424
- Support auto rotation of mounted contents and synced Kubernetes secret (Secrets Store CSI Driver v0.0.15+)
25-
26-
## Code of conduct
27-
28-
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md).

img/diagram.png

-123 KB
Binary file not shown.

0 commit comments

Comments
 (0)