You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2022. It is now read-only.
feat: add general support for isBinary for all backends (#585)
* feat: add general support for isBinary for all backends
- Add support for `isBinary` in `KVBackend` + tests
- Remove specific implementation of `isBinary` from Azure Key Vault & GCP Secrets Manager backends
- Update description for `isBinary` field in the CRD to remove Azure-specific details
- Update docs
* chore: add test for isBinary explicitly set to false
Copy file name to clipboardExpand all lines: README.md
+27-17
Original file line number
Diff line number
Diff line change
@@ -443,23 +443,6 @@ spec:
443
443
name: password
444
444
```
445
445
446
-
Due to the way Azure handles binary files, you need to explicitly let the ExternalSecret know that the secret is binary.
447
-
You can do that with the `isBinary` field on the key. This is necessary for certificates and other secret binary files.
448
-
449
-
```yml
450
-
apiVersion: kubernetes-client.io/v1
451
-
kind: ExternalSecret
452
-
metadata:
453
-
name: hello-keyvault-service
454
-
spec:
455
-
backendType: azureKeyVault
456
-
keyVaultName: hello-world
457
-
data:
458
-
- key: hello-service/credentials
459
-
name: password
460
-
isBinary: true
461
-
```
462
-
463
446
### Alibaba Cloud KMS Secret Manager
464
447
465
448
kubernetes-external-secrets supports fetching secrets from [Alibaba Cloud KMS Secret Manager](https://www.alibabacloud.com/help/doc-detail/152001.htm)
@@ -623,6 +606,33 @@ To retrieve an individual secret's content, use the following where "mysecret" i
623
606
624
607
The secrets will persist even if the helm installation is removed, although they will no longer sync to Google Secret Manager.
625
608
609
+
## Binary Secrets
610
+
Most backends do not treat binary secrets any differently than text secrets. Since you typically store a binary secret as a base64-encoded string in the backend, you need to explicitly let the ExternalSecret know that the secret is binary, otherwise it will be encoded in base64 again.
611
+
You can do that with the `isBinary` field on the key. This is necessary for certificates and other secret binary files.
612
+
613
+
```yml
614
+
apiVersion: kubernetes-client.io/v1
615
+
kind: ExternalSecret
616
+
metadata:
617
+
name: hello-service
618
+
spec:
619
+
backendType: anySupportedBackend
620
+
# ...
621
+
data:
622
+
- key: hello-service/archives/secrets_zip
623
+
name: secrets.zip
624
+
isBinary: true # Default: false
625
+
# also works with `property`
626
+
- key: hello-service/certificates
627
+
name: cert.p12
628
+
property: cert.p12
629
+
isBinary: true
630
+
```
631
+
632
+
AWS Secrets Manager is a notable exception to this. If you create/update a secret using [SecretBinary](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_CreateSecret.html#API_CreateSecret_RequestSyntax) parameter of the API, then AWS API will return the secret data as `SecretBinary` in the response and ExternalSecret will handle it accordingly. In that case, you do not need to use the `isBinary` field.
633
+
634
+
Note that `SecretBinary` parameter is not available when using the AWS Secrets Manager console. For any binary secrets (represented by a base64-encoded strings) created/updated via the AWS console, or stored in key-value pairs instead of text strings, you can just use the `isBinary` field explicitly as above.
635
+
626
636
## Metrics
627
637
628
638
kubernetes-external-secrets exposes the following metrics over a prometheus endpoint:
0 commit comments