Skip to content

Commit d45bcc1

Browse files
Merge pull request #290527 from linglingye001/k8sprovider/addSecretExample
Add secret example for different types
2 parents 2bfab83 + 6e1a529 commit d45bcc1

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,57 @@ Two Kubernetes built-in [types of Secrets](https://kubernetes.io/docs/concepts/c
445445
|---|---|
446446
|.kubernetes.secret.type|kubernetes.io/tls|
447447

448+
The following examples show how the data is populated in the generated Secrets with different types.
449+
450+
Assuming an App Configuration store has these Key Vault references:
451+
452+
|key|value|tags|
453+
|---|---|---|
454+
|app1-secret1|<Key Vault reference 1>|`{}`|
455+
|app1-secret2|<Key Vault reference 2>|`{}`|
456+
|app1-certificate|<Key Vault reference 3>|`{".kubernetes.secret.type": "kubernetes.io/tls"}`|
457+
458+
The following sample generates Secrets of both Opaque and TLS types.
459+
460+
``` yaml
461+
apiVersion: azconfig.io/v1
462+
kind: AzureAppConfigurationProvider
463+
metadata:
464+
name: appconfigurationprovider-sample
465+
spec:
466+
endpoint: <your-app-configuration-store-endpoint>
467+
target:
468+
configMapName: configmap-created-by-appconfig-provider
469+
configuration:
470+
selectors:
471+
- keyFilter: app1*
472+
secret:
473+
target:
474+
secretName: secret-created-by-appconfig-provider
475+
auth:
476+
managedIdentityClientId: <your-user-assigned-managed-identity-client-id>
477+
```
478+
479+
The generated Secrets are populated with the following data:
480+
481+
```yaml
482+
name: secret-created-by-appconfig-provider
483+
type: Opaque
484+
data:
485+
app1-secret1: <secret value retrieved from Key Vault>
486+
app1-secret2: <secret value retrieved from Key Vault>
487+
```
488+
489+
```yaml
490+
name: app1-certificate
491+
type: kubernetes.io/tls
492+
data:
493+
tls.crt: |
494+
<certificate data retrieved from Key Vault>
495+
tls.key: |
496+
<certificate key retrieved from Key Vault>
497+
```
498+
448499
#### Refresh of secrets from Key Vault
449500

450501
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)