Fake
We provide a fake
implementation to help with testing. This provider returns static key/value pairs and nothing else.
To use the fake
provider simply create a SecretStore
or ClusterSecretStore
and configure it like in the following example:
Note
The provider returns static data configured in value
. You can define a version
, too. If set the remoteRef
from an ExternalSecret must match otherwise no value is returned.
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
name: fake
spec:
provider:
fake:
data:
- key: "/foo/bar"
value: "HELLO1"
version: "v1"
- key: "/foo/bar"
value: "HELLO2"
version: "v2"
- key: "/foo/baz"
value: '{"john": "doe"}'
version: "v1"
Please note that value
is intended for exclusive use with data
for dataFrom
. You can use the data
to set a JSON
compliant value to be used as dataFrom
.
Here is an example ExternalSecret
that displays this behavior:
Warning
This provider supports specifying different data[].version
configurations. However, data[].property
is ignored.
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: example
spec:
refreshInterval: 1h
secretStoreRef:
name: fake
kind: ClusterSecretStore
target:
name: secret-to-be-created
data:
- secretKey: foo_bar
remoteRef:
key: /foo/bar
version: v1
dataFrom:
- extract:
key: /foo/baz
version: v1
This results in the following secret:
apiVersion: v1
kind: Secret
metadata:
name: secret-to-be-created
namespace: default
data:
foo_bar: SEVMTE8x # HELLO1 (via data)
john: ZG9l #doe (via dataFrom)