Skip to content

Commit

Permalink
fix secret example, add some details (kubernetes-retired#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Boyd authored and pmorie committed May 1, 2018
1 parent 57eea81 commit 73661dd
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions docs/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ spec:
name: value
parametersFrom:
- secretKeyRef:
name: secretName
key: myKey
name: my-secret
key: secret-parameter
```
or, in JSON format
```json
Expand All @@ -64,24 +64,24 @@ or, in JSON format
},
"parametersFrom": {
"secretKeyRef": {
"name": "secretName",
"key": "myKey"
"name": "my-secret",
"key": "secret-parameter"
}
}
}
```
and the secret would need to have a key named myKey:
and the secret would need to have a key named secret-parameter:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: secretName
name: my-secret
type: Opaque
stringData:
myKey: >
{
secret-parameter:
'{
"password": "letmein"
}
}'
```
The final JSON payload to be sent to the broker would then look like:
```json
Expand All @@ -91,6 +91,17 @@ The final JSON payload to be sent to the broker would then look like:
}
```

Multiple parameters could be listed in the secret - simply separate key/value pairs with a comma as in this example:
```yaml
secret-parameter:
'{
"password": "letmein",
"key2": "value2",
"key3": "value3"
}'
```
### Basic example
Let's say we want to create a `ServiceInstance` of EC2 running on AWS using a
Expand Down Expand Up @@ -186,7 +197,7 @@ be stored in a single `Secret` key, and passed using a `secretKeyRef` field:
parametersFrom:
- secretKeyRef:
name: mysecret
key: mykey
key: secret-parameter
```

The value stored in a secret key must be a valid JSON.

0 comments on commit 73661dd

Please sign in to comment.