Skip to content

Commit c457af0

Browse files
Merge pull request #244246 from RichardChen820/junbchen/reference/dynamicConfiguration
Add preview3 content in reference doc
2 parents 31c1439 + 44d157c commit c457af0

File tree

1 file changed

+65
-3
lines changed

1 file changed

+65
-3
lines changed

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

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ The following reference outlines the properties supported by the Azure App Confi
1616

1717
## Properties
1818

19-
An `AzureAppConfigurationProvider` resource has the following top-level child properties under the `spec`.
19+
An `AzureAppConfigurationProvider` resource has the following top-level child properties under the `spec`. Either `endpoint` or `connectionStringReference` has to be specified.
2020

2121
|Name|Description|Required|Type|
2222
|---|---|---|---|
23-
|endpoint|The endpoint of Azure App Configuration, which you would like to retrieve the key-values from|true|string|
23+
|endpoint|The endpoint of Azure App Configuration, which you would like to retrieve the key-values from|alternative|string|
24+
|connectionStringReference|The name of the Kubernetes Secret that contains Azure App Configuration connection string|alternative|string|
2425
|target|The destination of the retrieved key-values in Kubernetes|true|object|
2526
|auth|The authentication method to access Azure App Configuration|false|object|
2627
|keyValues|The settings for querying and processing key-values|false|object|
@@ -45,6 +46,7 @@ The `spec.keyValues` has the following child properties. The `spec.keyValues.key
4546
|selectors|The list of selectors for key-value filtering|false|object array|
4647
|trimKeyPrefixes|The list of key prefixes to be trimmed|false|string array|
4748
|keyVaults|The settings for Key Vault references|conditional|object|
49+
|refresh|The settings for refreshing the key-values in ConfigMap or Secret|false|object|
4850

4951
If the `spec.keyValues.selectors` property isn't set, all key-values with no label will be downloaded. It contains an array of *selector* objects, which have the following child properties.
5052

@@ -53,7 +55,6 @@ If the `spec.keyValues.selectors` property isn't set, all key-values with no lab
5355
|keyFilter|The key filter for querying key-values|true|string|
5456
|labelFilter|The label filter for querying key-values|false|string|
5557

56-
5758
The `spec.keyValues.keyVaults` property has the following child properties.
5859

5960
|Name|Description|Required|Type|
@@ -83,6 +84,20 @@ The authentication method of each *vault* can be specified with the following pr
8384
|managedIdentityClientId|The client ID of a user-assigned managed identity used for authentication with a vault|false|string|
8485
|servicePrincipalReference|The name of the Kubernetes Secret that contains the credentials of a service principal used for authentication with a vault|false|string|
8586

87+
The `spec.keyValues.refresh` property has the following child properties.
88+
89+
|Name|Description|Required|Type|
90+
|---|---|---|---|
91+
|monitoring|The key-values that are monitored by the provider, provider automatically refreshes the ConfigMap or Secret if value change in any designated key-value|true|object|
92+
|interval|The interval for refreshing, default value is 30 seconds, must be greater than 1 second|false|duration string|
93+
94+
The `spec.keyValues.refresh.monitoring.keyValues` is an array of objects, which have the following child properties.
95+
96+
|Name|Description|Required|Type|
97+
|---|---|---|---|
98+
|key|The key of a key-value|true|string|
99+
|label|The label of a key-value|false|string|
100+
86101
## Examples
87102

88103
### Authentication
@@ -144,6 +159,22 @@ The authentication method of each *vault* can be specified with the following pr
144159
servicePrincipalReference: <your-service-principal-secret-name>
145160
```
146161

162+
#### Use Connection String
163+
164+
1. Create a Kubernetes Secret in the same namespace as the `AzureAppConfigurationProvider` resource and add Azure App Configuration connection string with key *azure_app_configuration_connection_string* in the Secret.
165+
2. Set the `spec.connectionStringReference` property to the name of the Secret in the following sample `AzureAppConfigurationProvider` resource and deploy it to the Kubernetes cluster.
166+
167+
``` yaml
168+
apiVersion: azconfig.io/v1beta1
169+
kind: AzureAppConfigurationProvider
170+
metadata:
171+
name: appconfigurationprovider-sample
172+
spec:
173+
connectionStringReference: <your-connection-string-secret-name>
174+
target:
175+
configMapName: configmap-created-by-appconfig-provider
176+
```
177+
147178
### Key-value selection
148179

149180
Use the `selectors` property to filter the key-values to be downloaded from Azure App Configuration.
@@ -222,3 +253,34 @@ spec:
222253
- uri: <your-key-vault-uri>
223254
servicePrincipalReference: <name-of-secret-containing-service-principal-credentials>
224255
```
256+
257+
### Dynamically refresh ConfigMap and Secret
258+
259+
Setting the `spec.keyValues.refresh` property enables dynamic configuration data refresh in ConfigMap and Secret by monitoring designated key-values. The provider periodically polls the key-values, if there is any value change, provider triggers ConfigMap and Secret refresh in accordance with the present data in Azure App Configuration.
260+
261+
The following sample instructs monitoring two key-values with 1 minute polling interval.
262+
263+
``` yaml
264+
apiVersion: azconfig.io/v1beta1
265+
kind: AzureAppConfigurationProvider
266+
metadata:
267+
name: appconfigurationprovider-sample
268+
spec:
269+
endpoint: <your-app-configuration-store-endpoint>
270+
target:
271+
configMapName: configmap-created-by-appconfig-provider
272+
keyValues:
273+
selectors:
274+
- keyFilter: app1*
275+
labelFilter: common
276+
- keyFilter: app1*
277+
labelFilter: development
278+
refresh:
279+
interval: 1m
280+
monitoring:
281+
keyValues:
282+
- key: sentinelKey
283+
label: common
284+
- key: sentinelKey
285+
label: development
286+
```

0 commit comments

Comments
 (0)