Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add secret formats to readme #326

Merged
merged 69 commits into from
Sep 20, 2023
Merged
Changes from 63 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
be9aa6c
add secret formats to readme
TalShorSap Sep 3, 2023
8efe8c6
add secret formats to readme
TalShorSap Sep 3, 2023
2d76ef2
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
2d5c0fd
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
cd03451
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
763cab5
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
b25d19f
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
89ee50e
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
e0d4154
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
62a4b3c
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
dd2aacd
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
1b707a7
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
8c3990c
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
a05010c
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 3, 2023
8f342b9
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 7, 2023
41578b6
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 7, 2023
f70cc27
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 10, 2023
a3d90a2
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 10, 2023
f8b1e1a
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
2fd0b4a
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
62ad24b
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
7dc511b
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
b907aaf
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
d4eea0a
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
e3d0d1e
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
6c98e80
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
9f5026f
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
2dd12fb
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
c61d835
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
b1986ec
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
84beade
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
b1011d5
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
473fa24
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
c285e0b
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
6f84179
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
e846b91
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
efa5efd
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
74f6250
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
9a48e57
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
49a890a
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
b781f7d
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
a1832ab
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
f6af6c0
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
e77aa7d
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
15223c0
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
035462b
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
ac108b5
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
e383ded
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
cbbc8c7
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
fecb171
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 11, 2023
a472753
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 12, 2023
4c0108b
add secret formats to readme
TalShorSap Sep 3, 2023
ded91aa
Merge branch 'main' into add_to_readme_secret_formats
TalShorSap Sep 14, 2023
3da3f1a
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 14, 2023
2d88bbe
Update README.md
danielforsap Sep 14, 2023
5bc19aa
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 14, 2023
fc05882
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 14, 2023
34347a5
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 14, 2023
dfcae1a
Merge remote-tracking branch 'origin/add_to_readme_secret_formats' in…
TalShorSap Sep 14, 2023
a8783ca
Update README.md
danielforsap Sep 14, 2023
17360dc
Merge branch 'main' into add_to_readme_secret_formats
TalShorSap Sep 18, 2023
2a2bb0a
Update README.md
danielforsap Sep 18, 2023
b268120
Update README.md
TalShorSap Sep 18, 2023
9ce5e92
Update README.md
TalShorSap Sep 18, 2023
45f8fc2
Update README.md
TalShorSap Sep 18, 2023
390a3a4
Update README.md
TalShorSap Sep 19, 2023
0d73806
Update README.md
TalShorSap Sep 20, 2023
6a42be4
Update README.md
TalShorSap Sep 20, 2023
763d75b
Update README.md
danielforsap Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 87 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The SAP BTP service operator is based on the [Kubernetes Operator pattern](https
* [Credentials Rotation](#credentials-rotation)
* [Multitenancy](#multitenancy)
* [Troubleshooting and Support](#troubleshooting-and-support)
* [Formats of Secret Objects](#formats-of-secret-objects)
* [Uninstalling the Operator](#uninstalling-the-operator)

## Architecture
Expand Down Expand Up @@ -145,18 +146,18 @@ Review the supported Kubernetes API versions for the following SAP BTP Service O
1. To create an instance of a service offered by SAP BTP, first create a `ServiceInstance` custom-resource file:

```yaml
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: my-service-instance
spec:
serviceOfferingName: sample-service
servicePlanName: sample-plan
externalName: my-service-instance-external
parameters:
key1: val1
key2: val2
```
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: my-service-instance
spec:
serviceOfferingName: sample-service
servicePlanName: sample-plan
externalName: my-service-btp-name
parameters:
key1: val1
key2: val2
```

* `<offering>` - The name of the SAP BTP service that you want to create.
To learn more about viewing and managing the available services for your subaccount in the SAP BTP cockpit, see [Service Marketplace](https://help.sap.com/viewer/09cc82baadc542a688176dce601398de/Cloud/en-US/affcc245c332433ba71917ff715b9971.html).
Expand Down Expand Up @@ -258,20 +259,20 @@ spec:

### Service Binding
#### Spec
| Parameter | Type | Description |
|:-----------------|:---------|:-----------------------------------------------------------------------------------------------------------|
| serviceInstanceName`*` | `string` | The Kubernetes name of the service instance to bind, should be in the namespace of the binding. |
| externalName | `string` | The name for the service binding in SAP BTP, defaults to the binding `metadata.name` if not specified. |
| secretName | `string` | The name of the secret where the credentials are stored, defaults to the binding `metadata.name` if not specified. |
| secretKey | `string` | The key inside the binding secret to store the credentials returned by the broker encoded as json to support complex data structures. |
| secretRootKey | `string` | The key inside the secret to store all binding data including credentials returned by the broker and additional info under single key.<br/>Convenient way to store whole binding data in single file when using `volumeMounts`. |
| parameters | `[]object` | Some services support the provisioning of additional configuration parameters during the bind request.<br/>For the list of supported parameters, check the documentation of the particular service offering.|
| parametersFrom | `[]object` | List of sources to populate parameters. |
| userInfo | `object` | Contains information about the user that last modified this service binding. |
| credentialsRotationPolicy | `object` | Holds automatic credentials rotation configuration. |
| credentialsRotationPolicy.enabled | `boolean` | Indicates whether automatic credentials rotation are enabled. |
| credentialsRotationPolicy.rotationFrequency | `duration` | Specifies the frequency at which the binding rotation is performed. |
| credentialsRotationPolicy.rotatedBindingTTL | `duration` | Specifies the time period for which to keep the rotated binding. |
| Parameter | Type | Description |
|:-----------------|:---------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| serviceInstanceName`*` | `string` | The Kubernetes name of the service instance to bind, should be in the namespace of the binding. |
| externalName | `string` | The name for the service binding in SAP BTP, defaults to the binding `metadata.name` if not specified. |
| secretName | `string` | The name of the secret where the credentials are stored, defaults to the binding `metadata.name` if not specified. |
| secretKey | `string` | Property of the Secret object that stores service binding data (credentials) returned from the broker. It is encoded as a JSON object to support complex data structures. [Example](#formats-of-secret-objects) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In rootKey you use 'property' while in secretRootKey we use 'key'. key is also baked in the attributes' name. And you also use it below in the format title ("Key- Value Pairs") and the description.

"...defines a name of a key in the secret object in which the service binding data (credentials) returned from the broker will be stored..."

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TalShorSap
Part of the Secret object that stores service binding data (credentials) received from the broker. When secretKey is used, credentials are stored in the JSON format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielforsap
The root key... -> The secretRootKey is the key in the secret object in which... (value is json)

| secretRootKey | `string` | The root key is a part of the Secret object, which stores service binding data (credentials) received from the broker, as well as additional information. When the root key is used, all data is stored under a single key. This makes it a convenient way to store data in one file when using volumeMounts. [Example](#formats-of-secret-objects) |
TalShorSap marked this conversation as resolved.
Show resolved Hide resolved
| parameters | `[]object` | Some services support the provisioning of additional configuration parameters during the bind request.<br/>For the list of supported parameters, check the documentation of the particular service offering. |
| parametersFrom | `[]object` | List of sources to populate parameters. |
| userInfo | `object` | Contains information about the user that last modified this service binding. |
| credentialsRotationPolicy | `object` | Holds automatic credentials rotation configuration. |
| credentialsRotationPolicy.enabled | `boolean` | Indicates whether automatic credentials rotation are enabled. |
| credentialsRotationPolicy.rotationFrequency | `duration` | Specifies the frequency at which the binding rotation is performed. |
| credentialsRotationPolicy.rotatedBindingTTL | `duration` | Specifies the time period for which to keep the rotated binding. |



Expand Down Expand Up @@ -517,6 +518,66 @@ The SAP BTP service operator project maintainers will respond to the best of the

[Back to top](#sap-business-technology-platform-sap-btp-service-operator-for-kubernetes)

## Formats of Secret Objects

### Key- Value Pairs (Default)
The binding object includes credentials returned from the broker and service instance info presented as key-value pairs.
```bash
#Credentials
uri: https://my-service.authentication.eu10.hana.ondemand.com
username: admin
password: ********

#Service instance info
instance_guid: <instance_guid> // The service instance ID
instance_name: my-service-btp-name // Taken from the service instance external_name field if set. Otherwise from metadata.name
plan: sample-plan // The service plan name
type: sample-service // The service offering name
```

### Credentials as JSON Object
To show credentials returned from the broker as a JSON object, add 'secretKey: your-secret-value' to the binding spec.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it shoud be clearer that 'your-secret-value' is a sample value.
"add 'secretKey: your-secret-value' to the binding spec" seems like straight forward instruction to follow.

"...specify your desired key name in add 'secretKey' attribute in the binding spec"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To show credentials returned from the broker as a JSON object, specify your desired key name for 'secretKey' attribute in the binding spec. 'secretKey: your-desired-key-name'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielforsap need to add reason and take care for Avi's comment


your-secret-vaue will be a key for a value in JSON format that contains credentials while service instance info remains presented in key-value pairs.
```bash
#Credentials
your-secret-value:
TalShorSap marked this conversation as resolved.
Show resolved Hide resolved
{
uri: https://my-service.authentication.eu10.hana.ondemand.com
username: admin
password: ********
}

#Service Instance info
instance_guid: <instance_guid> // The service instance ID
instance_name: my-service-btp-name // Taken from the service instance external_name field if set. Otherwise from metadata.name
plan: sample-plan // The service plan name
type: sample-service // The service offering name
```

## Credentials and Binding Info as One JSON Object
TalShorSap marked this conversation as resolved.
Show resolved Hide resolved
To show both credentials returned from the broker and service instance info as a JSON object, add 'secretRootKey: your-secret-value' to the binding spec.
TalShorSap marked this conversation as resolved.
Show resolved Hide resolved

your-secret-value becomes a key that contains credentials and service instance info in a JSON format.

```bash
your-secret-value:
TalShorSap marked this conversation as resolved.
Show resolved Hide resolved
{
#Credentials
uri: https://my-service.authentication.eu10.hana.ondemand.com
username: admin
password: ********

#Service Instance info
instance_guid: <instance_guid> // The service instance id
instance_name: my-service-btp-name // Taken from the service instance external_name field if set. Otherwise from metadata.name
plan: sample-plan // The service plan name
type: sample-service // The service offering name
}
```

[Back to top](#sap-business-technology-platform-sap-btp-service-operator-for-kubernetes)

## Uninstalling the Operator

Before you uninstall the operator, we recommend you manually delete all associated service instances and bindings. This way, you'll ensure all data stored with service instances and bindings are properly taken care of. Instances and bindings that were not manually deleted will be automatically deleted once you start the uninstallation process.
Expand Down
Loading