Skip to content

Commit 394946f

Browse files
Merge pull request #37 from siddhibhor-56/sbhor-eso-106
ESO-106: Adds sample CR's for example purpose
2 parents 851a767 + 069c2ed commit 394946f

File tree

8 files changed

+287
-0
lines changed

8 files changed

+287
-0
lines changed

bundle/manifests/external-secrets-operator.clusterserviceversion.yaml

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,178 @@ metadata:
44
annotations:
55
alm-examples: |-
66
[
7+
{
8+
"apiVersion": "external-secrets.io/v1alpha1",
9+
"kind": "PushSecret",
10+
"metadata": {
11+
"annotations": {
12+
"external-secrets.io/example": "true"
13+
},
14+
"name": "pushsecret-sample",
15+
"namespace": "external-secrets"
16+
},
17+
"spec": {
18+
"config": {
19+
"gcp": {
20+
"projectID": "openshift-sample-project",
21+
"secret": {
22+
"name": "test",
23+
"replicationPolicy": "automatic",
24+
"version": "latest"
25+
}
26+
}
27+
},
28+
"secretStoreRefs": [
29+
{
30+
"kind": "ClusterSecretStore",
31+
"name": "gcp-cluster-secretstore"
32+
}
33+
],
34+
"selector": {
35+
"secret": {
36+
"name": "gcp-secret-k8s"
37+
}
38+
}
39+
}
40+
},
41+
{
42+
"apiVersion": "external-secrets.io/v1beta1",
43+
"kind": "ClusterExternalSecret",
44+
"metadata": {
45+
"annotations": {
46+
"external-secrets.io/example": "true"
47+
},
48+
"name": "secret-cluster"
49+
},
50+
"spec": {
51+
"externalSecretSpec": {
52+
"data": [
53+
{
54+
"remoteRef": {
55+
"key": "gcp-secret",
56+
"version": "latest"
57+
},
58+
"secretKey": "key"
59+
}
60+
],
61+
"refreshInterval": "1h",
62+
"secretStoreRef": {
63+
"kind": "ClusterSecretStore",
64+
"name": "gcp-cluster-secretstore"
65+
},
66+
"target": {
67+
"creationPolicy": "Owner",
68+
"name": "gcp-secret-k8s"
69+
}
70+
},
71+
"namespaceSelector": {
72+
"matchLabels": {
73+
"app.kubernetes.io/managed-by": "external-secrets-operator"
74+
}
75+
}
76+
}
77+
},
78+
{
79+
"apiVersion": "external-secrets.io/v1beta1",
80+
"kind": "ClusterSecretStore",
81+
"metadata": {
82+
"annotations": {
83+
"external-secrets.io/example": "true"
84+
},
85+
"name": "gcp-cluster-secretstore"
86+
},
87+
"spec": {
88+
"provider": {
89+
"gcpsm": {
90+
"auth": {
91+
"secretRef": {
92+
"secretAccessKeySecretRef": {
93+
"key": "secret-access-key.json",
94+
"name": "gcp-creds",
95+
"namespace": "external-secrets"
96+
}
97+
}
98+
},
99+
"projectID": "openshift-sample-project"
100+
}
101+
}
102+
}
103+
},
104+
{
105+
"apiVersion": "external-secrets.io/v1beta1",
106+
"kind": "ExternalSecret",
107+
"metadata": {
108+
"annotations": {
109+
"external-secrets.io/example": "true"
110+
},
111+
"name": "gcp-secret",
112+
"namespace": "external-secrets"
113+
},
114+
"spec": {
115+
"data": [
116+
{
117+
"remoteRef": {
118+
"key": "gcp-secret",
119+
"version": "latest"
120+
},
121+
"secretKey": "Key"
122+
}
123+
],
124+
"refreshInterval": "1h",
125+
"secretStoreRef": {
126+
"kind": "SecretStore",
127+
"name": "secretstore"
128+
},
129+
"target": {
130+
"creationPolicy": "Owner",
131+
"name": "k8s-secret"
132+
}
133+
}
134+
},
135+
{
136+
"apiVersion": "external-secrets.io/v1beta1",
137+
"kind": "SecretStore",
138+
"metadata": {
139+
"annotations": {
140+
"external-secrets.io/disable-maintenance-checks": "true"
141+
},
142+
"name": "secretstore",
143+
"namespace": "external-secrets"
144+
},
145+
"spec": {
146+
"provider": {
147+
"gcpsm": {
148+
"auth": {
149+
"secretRef": {
150+
"secretAccessKeySecretRef": {
151+
"key": "secret-access-key.json",
152+
"name": "gcp-creds"
153+
}
154+
}
155+
},
156+
"projectID": "openshift-sample-project"
157+
}
158+
}
159+
}
160+
},
161+
{
162+
"apiVersion": "generators.external-secrets.io/v1alpha1",
163+
"kind": "Password",
164+
"metadata": {
165+
"annotations": {
166+
"external-secrets.io/example": "true"
167+
},
168+
"name": "password-sample",
169+
"namespace": "external-secrets"
170+
},
171+
"spec": {
172+
"excludeLowercase": false,
173+
"excludeNumbers": false,
174+
"excludeUppercase": false,
175+
"includeSymbols": true,
176+
"length": 20
177+
}
178+
},
7179
{
8180
"apiVersion": "operator.openshift.io/v1alpha1",
9181
"kind": "ExternalSecrets",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: external-secrets.io/v1beta1
2+
kind: ClusterSecretStore
3+
metadata:
4+
name: gcp-cluster-secretstore # ! Replace with a unique name for your ClusterSecretStore.
5+
annotations:
6+
external-secrets.io/example: "true"
7+
spec:
8+
provider:
9+
gcpsm:
10+
projectID: openshift-sample-project # ! Replace with your GCP project ID.
11+
auth:
12+
secretRef:
13+
secretAccessKeySecretRef:
14+
name: gcp-creds # ! Replace with the name of the Kubernetes Secret containing your GCP credentials.
15+
key: secret-access-key.json # ! Replace with the key in the Secret that holds the GCP service account JSON.
16+
namespace: external-secrets # ! Replace with the namespace where the above Secret is located.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: external-secrets.io/v1beta1
2+
kind: ExternalSecret
3+
metadata:
4+
name: gcp-secret # ! Name of the ExternalSecret resource in your cluster.
5+
namespace: external-secrets # ! Replace with the namespace where this ExternalSecret should be created.
6+
annotations:
7+
external-secrets.io/example: "true"
8+
spec:
9+
refreshInterval: 1h # ! How often to sync the secret from the external provider.
10+
secretStoreRef:
11+
name: secretstore # ! Replace with the name of your SecretStore or ClusterSecretStore.
12+
kind: SecretStore # ! Use 'ClusterSecretStore' if referring to a cluster-wide store.
13+
target:
14+
name: k8s-secret # ! Name of the resulting Kubernetes Secret.
15+
creationPolicy: Owner # ! Determines if the secret should be created ('Owner'), adopted, or left unchanged.
16+
data:
17+
- secretKey: Key # ! Key name inside the Kubernetes Secret.
18+
remoteRef:
19+
key: gcp-secret # ! Name of the secret in GCP Secret Manager.
20+
version: latest # ! Replace with a specific version if needed.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: external-secrets.io/v1beta1
2+
kind: ClusterExternalSecret
3+
metadata:
4+
name: secret-cluster # ! Name of the ClusterExternalSecret resource.
5+
annotations:
6+
external-secrets.io/example: "true"
7+
spec:
8+
namespaceSelector:
9+
matchLabels:
10+
app.kubernetes.io/managed-by: external-secrets-operator # ! Label used to select target namespaces. Adjust as needed.
11+
externalSecretSpec:
12+
refreshInterval: 1h # ! Frequency to sync secrets from the external provider.
13+
secretStoreRef:
14+
name: gcp-cluster-secretstore # ! Name of the ClusterSecretStore to use.
15+
kind: ClusterSecretStore
16+
target:
17+
name: gcp-secret-k8s # ! Name of the resulting Kubernetes Secret in each selected namespace.
18+
creationPolicy: Owner # ! Policy for creating/adopting the Kubernetes Secret.
19+
data:
20+
- secretKey: key # ! Key name inside the resulting Kubernetes Secret.
21+
remoteRef:
22+
key: gcp-secret # ! Name of the secret in GCP Secret Manager.
23+
version: latest # ! Replace with a specific version if needed.

config/samples/kustomization.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
resources:
33
- operator_v1alpha1_externalsecrets.yaml
44
- operator_v1alpha1_externalsecretsmanager.yaml
5+
- password.yaml
6+
- cluster_secretstore.yaml
7+
- external_secret.yaml
8+
- external_secretstore.yaml
9+
- push_secret.yaml
10+
- secret_store.yaml
511
# +kubebuilder:scaffold:manifestskustomizesamples

config/samples/password.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: generators.external-secrets.io/v1alpha1
2+
kind: Password
3+
metadata:
4+
name: password-sample
5+
namespace: external-secrets # ! Replace with the namespace where the generator should be created.
6+
annotations:
7+
external-secrets.io/example: "true"
8+
spec:
9+
length: 20 # ! Desired length of the generated password.
10+
includeSymbols: true # ! Set to true to include symbols (e.g., !, @, #).
11+
excludeUppercase: false # ! Set to true to exclude uppercase letters.
12+
excludeLowercase: false # ! Set to true to exclude lowercase letters.
13+
excludeNumbers: false # ! Set to true to exclude numeric characters.

config/samples/push_secret.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: external-secrets.io/v1alpha1
2+
kind: PushSecret
3+
metadata:
4+
name: pushsecret-sample
5+
namespace: external-secrets # ! Replace with the namespace where the PushSecret should be created.
6+
annotations:
7+
"external-secrets.io/example": "true"
8+
spec:
9+
secretStoreRefs:
10+
- name: gcp-cluster-secretstore # ! Replace with the name of your ClusterSecretStore.
11+
kind: ClusterSecretStore
12+
selector:
13+
secret:
14+
name: gcp-secret-k8s # ! Replace with the name of the Kubernetes Secret you want to push to the external store.
15+
config:
16+
gcp:
17+
projectID: openshift-sample-project # ! Replace with your GCP project ID.
18+
secret:
19+
name: test # ! Replace with the name for the secret in GCP Secret Manager.
20+
version: latest # ! You can change this to a specific version if required.
21+
replicationPolicy: automatic # ! Use "automatic" or "user-managed" based on your replication needs.

config/samples/secret_store.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: external-secrets.io/v1beta1
2+
kind: SecretStore
3+
metadata:
4+
name: secretstore
5+
namespace: external-secrets # ! Replace this with your preferred namespace name.
6+
annotations:
7+
external-secrets.io/disable-maintenance-checks: "true"
8+
spec:
9+
provider:
10+
gcpsm:
11+
projectID: openshift-sample-project # ! Replace this with your GCP project ID.
12+
auth:
13+
secretRef:
14+
secretAccessKeySecretRef:
15+
name: gcp-creds # ! Replace with the name of the Kubernetes secret that contains your GCP credentials.
16+
key: secret-access-key.json # ! Replace with the key inside the secret that holds the GCP service account JSON.

0 commit comments

Comments
 (0)