Skip to content

Commit c805b6f

Browse files
Merge pull request #270887 from linglingye001/user/linglingye/k8sRefV1.3.0
Azure App Configuration Kubernetes provider reference v1.3.0
2 parents d936207 + ae75fdd commit c805b6f

File tree

2 files changed

+66
-10
lines changed

2 files changed

+66
-10
lines changed

articles/azure-app-configuration/howto-geo-replication.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ You can specify one or more endpoints of a geo-replication-enabled App Configura
179179

180180
The automatically discovered replicas will be selected and used randomly. If you have a preference for specific replicas, you can explicitly specify their endpoints. This feature is enabled by default, but you can refer to the following sample code to disable it.
181181

182+
### [.NET](#tab/Dotnet)
183+
182184
Edit the call to the `AddAzureAppConfiguration` method, which is often found in the `program.cs` file of your application.
183185

184186
```csharp
@@ -197,6 +199,27 @@ configurationBuilder.AddAzureAppConfiguration(options =>
197199
> - `Microsoft.Azure.AppConfiguration.AspNetCore`
198200
> - `Microsoft.Azure.AppConfiguration.Functions.Worker`
199201
202+
### [Kubernetes](#tab/kubernetes)
203+
204+
Update the `AzureAppConfigurationProvider` resource of your Azure App Configuration Kubernetes Provider. Add a `replicaDiscoveryEnabled` property and set it to `false`.
205+
206+
``` yaml
207+
apiVersion: azconfig.io/v1
208+
kind: AzureAppConfigurationProvider
209+
metadata:
210+
name: appconfigurationprovider-sample
211+
spec:
212+
endpoint: <your-app-configuration-store-endpoint>
213+
replicaDiscoveryEnabled: false
214+
target:
215+
configMapName: configmap-created-by-appconfig-provider
216+
```
217+
218+
> [!NOTE]
219+
> The automatic replica discovery and failover support is available if you use version **1.3.0** or later of [Azure App Configuration Kubernetes Provider](./quickstart-azure-kubernetes-service.md).
220+
221+
---
222+
200223
## Next steps
201224
202225
> [!div class="nextstepaction"]

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

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: junbchen
1212

1313
# Azure App Configuration Kubernetes Provider reference
1414

15-
The following reference outlines the properties supported by the Azure App Configuration Kubernetes Provider `v1.2.0`. See [release notes](https://github.com/Azure/AppConfiguration/blob/main/releaseNotes/KubernetesProvider.md) for more information on the change.
15+
The following reference outlines the properties supported by the Azure App Configuration Kubernetes Provider `v1.3.0`. See [release notes](https://github.com/Azure/AppConfiguration/blob/main/releaseNotes/KubernetesProvider.md) for more information on the change.
1616

1717
## Properties
1818

@@ -22,6 +22,7 @@ An `AzureAppConfigurationProvider` resource has the following top-level child pr
2222
|---|---|---|---|
2323
|endpoint|The endpoint of Azure App Configuration, which you would like to retrieve the key-values from.|alternative|string|
2424
|connectionStringReference|The name of the Kubernetes Secret that contains Azure App Configuration connection string.|alternative|string|
25+
|replicaDiscoveryEnabled|The setting that determines whether replicas of Azure App Configuration are automatically discovered and used for failover. If the property is absent, a default value of `true` is used.|false|bool|
2526
|target|The destination of the retrieved key-values in Kubernetes.|true|object|
2627
|auth|The authentication method to access Azure App Configuration.|false|object|
2728
|configuration|The settings for querying and processing key-values in Azure App Configuration.|false|object|
@@ -73,12 +74,13 @@ The `spec.configuration` has the following child properties.
7374
|trimKeyPrefixes|The list of key prefixes to be trimmed.|false|string array|
7475
|refresh|The settings for refreshing key-values from Azure App Configuration. If the property is absent, key-values from Azure App Configuration are not refreshed.|false|object|
7576

76-
If the `spec.configuration.selectors` property isn't set, all key-values with no label are downloaded. It contains an array of *selector* objects, which have the following child properties.
77+
If the `spec.configuration.selectors` property isn't set, all key-values with no label are downloaded. It contains an array of *selector* objects, which have the following child properties. Note that the key-values of the last selector take precedence and override any overlapping keys from the previous selectors.
7778

7879
|Name|Description|Required|Type|
7980
|---|---|---|---|
80-
|keyFilter|The key filter for querying key-values.|true|string|
81-
|labelFilter|The label filter for querying key-values.|false|string|
81+
|keyFilter|The key filter for querying key-values. This property and the `snapshotName` property should not be set at the same time.|alternative|string|
82+
|labelFilter|The label filter for querying key-values. This property and the `snapshotName` property should not be set at the same time.|false|string|
83+
|snapshotName|The name of a snapshot from which key-values are loaded. This property should not be used in conjunction with other properties.|alternative|string|
8284

8385
The `spec.configuration.refresh` property has the following child properties.
8486

@@ -95,7 +97,7 @@ The `spec.configuration.refresh.monitoring.keyValues` is an array of objects, wh
9597
|key|The key of a key-value.|true|string|
9698
|label|The label of a key-value.|false|string|
9799

98-
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. To learn more about the support for Kubernetes built-in types of Secrets, see [Types of Secret](#types-of-secret).
99101

100102
|Name|Description|Required|Type|
101103
|---|---|---|---|
@@ -141,12 +143,13 @@ The `spec.featureFlag` property has the following child properties. It is requir
141143
|selectors|The list of selectors for feature flag filtering.|false|object array|
142144
|refresh|The settings for refreshing feature flags from Azure App Configuration. If the property is absent, feature flags from Azure App Configuration are not refreshed.|false|object|
143145

144-
If the `spec.featureFlag.selectors` property isn't set, feature flags are not downloaded. It contains an array of *selector* objects, which have the following child properties.
146+
If the `spec.featureFlag.selectors` property isn't set, feature flags are not downloaded. It contains an array of *selector* objects, which have the following child properties. Note that the feature flags of the last selector take precedence and override any overlapping keys from the previous selectors.
145147

146148
|Name|Description|Required|Type|
147149
|---|---|---|---|
148-
|keyFilter|The key filter for querying feature flags.|true|string|
149-
|labelFilter|The label filter for querying feature flags.|false|string|
150+
|keyFilter|The key filter for querying feature flags. This property and the `snapshotName` property should not be set at the same time.|alternative|string|
151+
|labelFilter|The label filter for querying feature flags. This property and the `snapshotName` property should not be set at the same time.|false|string|
152+
|snapshotName|The name of a snapshot from which feature flags are loaded. This property should not be used in conjunction with other properties.|alternative|string|
150153

151154
The `spec.featureFlag.refresh` property has the following child properties.
152155

@@ -324,6 +327,24 @@ spec:
324327
labelFilter: development
325328
```
326329

330+
A snapshot can be used alone or together with other key-value selectors. In the following sample, you load key-values of common configuration from a snapshot and then override some of them with key-values for development.
331+
332+
``` yaml
333+
apiVersion: azconfig.io/v1
334+
kind: AzureAppConfigurationProvider
335+
metadata:
336+
name: appconfigurationprovider-sample
337+
spec:
338+
endpoint: <your-app-configuration-store-endpoint>
339+
target:
340+
configMapName: configmap-created-by-appconfig-provider
341+
configuration:
342+
selectors:
343+
- snapshotName: app1_common_configuration
344+
- keyFilter: app1*
345+
labelFilter: development
346+
```
347+
327348
### Key prefix trimming
328349

329350
The following sample uses the `trimKeyPrefixes` property to trim two prefixes from key names before adding them to the generated ConfigMap.
@@ -371,6 +392,8 @@ spec:
371392

372393
### Key Vault references
373394

395+
#### Authentication
396+
374397
In the following sample, one Key Vault is authenticated with a service principal, while all other Key Vaults are authenticated with a user-assigned managed identity.
375398

376399
``` yaml
@@ -395,7 +418,15 @@ spec:
395418
servicePrincipalReference: <name-of-secret-containing-service-principal-credentials>
396419
```
397420

398-
### Refresh of secrets from Key Vault
421+
#### Types of Secret
422+
423+
Two Kubernetes built-in [types of Secrets](https://kubernetes.io/docs/concepts/configuration/secret/#secret-types), Opaque and TLS, are currently supported. Secrets resolved from Key Vault references are saved as the [Opaque Secret](https://kubernetes.io/docs/concepts/configuration/secret/#opaque-secrets) type by default. If you have a Key Vault reference to a certificate and want to save it as the [TLS Secret](https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets) type, you can add a **tag** with the following name and value to the Key Vault reference in Azure App Configuration. By doing so, a Secret with the `kubernetes.io/tls` type will be generated and named after the key of the Key Vault reference.
424+
425+
|Name|Value|
426+
|---|---|
427+
|.kubernetes.secret.type|kubernetes.io/tls|
428+
429+
#### Refresh of secrets from Key Vault
399430

400431
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.
401432

@@ -564,4 +595,6 @@ data:
564595
key1=value1
565596
key2=value2
566597
key3=value3
567-
```
598+
```
599+
600+
---

0 commit comments

Comments
 (0)