Skip to content

Commit 4f6fb23

Browse files
Document changes to annotation examples
1 parent 5b24d8f commit 4f6fb23

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

modules/sbo-categories-of-exposable-binding-data.adoc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ metadata:
2323
----
2424

2525

26+
== Exposing a constant value as the binding item
27+
The following examples show how to expose constant value as annotations:
28+
29+
.Example: Exposing constant value as annotations
30+
[source,yaml]
31+
----
32+
apiVersion: postgres-operator.crunchydata.com/v1beta1
33+
kind: PostgresCluster
34+
metadata:
35+
name: hippo
36+
namespace: my-postgresql
37+
annotations:
38+
"service.binding/type": "postgresql" <1>
39+
----
40+
<1> Binding `type` that is to be exposed with the `postgresql` value.
41+
42+
2643
== Exposing an entire config map or secret that is referenced from a resource
2744
The following examples show how to expose an entire secret as annotations:
2845

@@ -107,7 +124,7 @@ The following example shows how to expose a specific entry from a config map as
107124

108125
This example uses the `path` attribute with an `X-Descriptors` update for `service.binding` and `sourceKey` by providing the following information:
109126

110-
* Name of the binding key that is to be injected
127+
* Name of the binding key that is to be projected
111128
* Name of the key in the Secret service resource
112129

113130

@@ -129,7 +146,7 @@ metadata:
129146

130147
The following example shows how to expose a resource definition value as OLM descriptors:
131148

132-
.Example: Exposing a resource definition value as OLM descriptors
149+
.Example: Exposing a resource definition value as OLM descriptors
133150
[source,yaml]
134151
----
135152
- path: data.connectionURL

modules/sbo-methods-of-exposing-binding-data.adoc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ You can use this method to annotate the resources of the backing service to expo
143143

144144
The following examples show the annotations that are added under the `metadata` section and a referenced `ConfigMap` object from a resource:
145145

146-
.Example: Exposing binding data from a `Secret` object in the `metadata.annotations.dbsecret` custom field
146+
.Example: Exposing binding data from a `Secret` object defined in the CR annotations
147147
[source,yaml]
148148
----
149149
apiVersion: postgres-operator.crunchydata.com/v1beta1
@@ -156,7 +156,21 @@ metadata:
156156
...
157157
----
158158

159-
.Example: Exposing binding data from a `ConfigMap` object in the `metadata.annotations.dbconfig` custom field
159+
The previous example places the name of the secret name in the `{.metadata.name}-pguser-{.metadata.name}` template that resolves to `hippo-pguser-hippo` eventually. The template can contain multiple JSONPath.
160+
161+
.Example: Referenced `Secret` object from a resource
162+
[source,yaml]
163+
----
164+
apiVersion: v1
165+
kind: Secret
166+
metadata:
167+
name: hippo-pguser-hippo
168+
data:
169+
password: "MTBz"
170+
user: "Z3Vlc3Q="
171+
----
172+
173+
.Example: Exposing binding data from a `ConfigMap` object defined in the CR annotations
160174
[source,yaml]
161175
----
162176
apiVersion: postgres-operator.crunchydata.com/v1beta1
@@ -169,7 +183,7 @@ metadata:
169183
...
170184
----
171185

172-
The previous example places the name of the config map in the `metadata.annotations.dbconfig` custom field and specifies to expose a single key from the config map.
186+
The previous example places the name of the config map in the `{.metadata.name}-config` template that resolves to `hippo-config` eventually. The template can contain multiple JSONPath.
173187

174188
.Example: Referenced `ConfigMap` object from a resource
175189
[source,yaml]

0 commit comments

Comments
 (0)