Skip to content

Commit 709b224

Browse files
committed
add tls type secret
1 parent 0957982 commit 709b224

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

articles/azure-app-configuration/reference-kubernetes-provider.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ The `spec.configuration.refresh.monitoring.keyValues` is an array of objects, wh
9797
|key|The key of a key-value.|true|string|
9898
|label|The label of a key-value.|false|string|
9999

100-
The `spec.secret` property has the following child properties. It is required if any Key Vault references are expected to be downloaded.
100+
The `spec.secret` property has the following child properties. It is required if any Key Vault references are expected to be downloaded. `Opaque`, `kubernetes.io/tls` [Secret types](https://kubernetes.io/docs/concepts/configuration/secret/#secret-types) are supported.
101101

102102
|Name|Description|Required|Type|
103103
|---|---|---|---|
104-
|target|The destination of the retrieved secrets in Kubernetes. `Opaque`, `kubernetes.io/tls` type are supported.|true|object|
104+
|target|The destination of the retrieved secrets in Kubernetes.|true|object|
105105
|auth|The authentication method to access Key Vaults.|false|object|
106106
|refresh|The settings for refreshing data from Key Vaults. If the property is absent, data from Key Vaults is not refreshed unless the corresponding Key Vault references are reloaded.|false|object|
107107

@@ -418,6 +418,23 @@ spec:
418418
servicePrincipalReference: <name-of-secret-containing-service-principal-credentials>
419419
```
420420

421+
By default, all key vault reference items will be projected as key-value pairs into the specified target Secret, and the type of that target secret is `opaque`, which cannot be customized. Given that Kubernetes has [various types](https://kubernetes.io/docs/concepts/configuration/secret/#secret-types) of Secret besides `opaque`, Azure App Configuration Kubernetes Provider currently give compatibility for `kubernetes.io/tls` type.
422+
If you want a key vault reference item to be projected as a secret of `kubernetes.io/tls` type, you need to tag that key vault reference item with a special label `".kubernetes.secret.type": "kubernetes.io/tls"` in Azure App Configuration, like this:
423+
424+
``` yaml
425+
{
426+
"key": "mycertificate",
427+
"label": null,
428+
"value": "{\"uri\":\"https://<your-key-valut-endpoint>/secrets/mycertificate\"}",
429+
"content_type": "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",
430+
"tags": {
431+
".kubernetes.secret.type": "kubernetes.io/tls"
432+
}
433+
}
434+
```
435+
436+
Then this key vault reference item will be generated as a `kubernetes.io/tls` type Secret naming with the key of it.
437+
421438
### Refresh of secrets from Key Vault
422439

423440
Refreshing secrets from Key Vaults usually requires reloading the corresponding Key Vault references from Azure App Configuration. However, with the `spec.secret.refresh` property, you can refresh the secrets from Key Vault independently. This is especially useful for ensuring that your workload automatically picks up any updated secrets from Key Vault during secret rotation. Note that to load the latest version of a secret, the Key Vault reference must not be a versioned secret.

0 commit comments

Comments
 (0)