Skip to content

Adding Module that Utilizes Azure Key Vault - #1

Draft
nexilus18 wants to merge 1 commit into
mainfrom
nexilus/adding-kv
Draft

Adding Module that Utilizes Azure Key Vault#1
nexilus18 wants to merge 1 commit into
mainfrom
nexilus/adding-kv

Conversation

@nexilus18

Copy link
Copy Markdown
Owner

This PR adds module that utilizes Azure Key Vault to store secrets.

Comment thread 12-using-az-kv/readme.md
@@ -0,0 +1,237 @@
# Using Azure Key Vault to store secrets

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduction section on Azure Key Vault approach vs AKS Secrets described in prior lab

Comment thread 12-using-az-kv/readme.md
or
az extension update --name aks-preview
```
- Existing Azure Subscription with EnableWorkloadIdentityPreview feature enabled

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Existing Azure Subscription with EnableWorkloadIdentityPreview feature enabled
- Enable `EnableWorkloadIdentityPreview` feature on the existing Azure Subscription

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to add the command to add this feature or link out to the page

Comment thread 12-using-az-kv/readme.md

## Upgrade existing AKS cluster

Upgrade your AKS cluster with Azure Key Vaut Provider for Secrets store CSI Driver capability, enable-oidc-issuer

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Upgrade your AKS cluster with Azure Key Vaut Provider for Secrets store CSI Driver capability, enable-oidc-issuer
Upgrade your AKS cluster with Azure Key Vault Provider for Secrets store CSI Driver capability, `enable-oidc-issuer`

Comment thread 12-using-az-kv/readme.md
```

```bash
az keyvault secret set --vault-name $KEYVAULT_NAME -n admin-passsword --value kv_supersecret

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
az keyvault secret set --vault-name $KEYVAULT_NAME -n admin-passsword --value kv_supersecret
az keyvault secret set --vault-name $KEYVAULT_NAME -n admin-passsword --value supersecret

Comment thread 12-using-az-kv/readme.md

## Create Azure KeyVault

Create an Azure Key Vault resource to store secrets. You can store secret in your key vault using the `az keyvaul secret set` command

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Create an Azure Key Vault resource to store secrets. You can store secret in your key vault using the `az keyvaul secret set` command
Create an Azure Key Vault resource to store secrets. You can store the key-value pair of `admin-password` and related secret in the key vault using the `az keyvault secret set` command. The `admin-password` is the name of the secret and the actual secret is stored in value.

Comment thread 12-using-az-kv/readme.md

```

The following command outputs the user assigned client id. Save this output

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto add to vars.sh file

Comment thread 12-using-az-kv/readme.md
Update the values for `name` and `namespace` with the Kubernetes service account name and its namespace in the `service.yaml` file and apply the manifest.

<details markdown="1">
<summary>Click here for the Service YAML file</summary>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<summary>Click here for the Service YAML file</summary>
<summary>Click here for the Service.yaml file</summary>

Comment thread 12-using-az-kv/readme.md
kubectl apply -f service.yaml
```

Create the federated identity credential between the Managed Identity, the service account issuer, and the subject.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: to add link to federated identity credential

Comment thread 12-using-az-kv/readme.md
az identity federated-credential create --name $federatedIdentityName --identity-name $UAMI --resource-group $RES_GROUP --issuer ${AKS_OIDC_ISSUER} --subject system:serviceaccount:${serviceAccountNamespace}:${serviceAccountName}
```

In the secret-provider-class, change `ClientID`, `keyvaultName` and `tenantID` with the worload identity, keyvault name and the tenant ID of the keyvault. Update `ObjectName` with the name of your secret. Deploy the `SecretProviderClass` after making the changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the secret-provider-class, change `ClientID`, `keyvaultName` and `tenantID` with the worload identity, keyvault name and the tenant ID of the keyvault. Update `ObjectName` with the name of your secret. Deploy the `SecretProviderClass` after making the changes.
In the secret-provider-class, change `ClientID`, `keyvaultName` and `tenantID` with the workload identity, keyvault name and the tenant ID of the keyvault. Update `ObjectName` with the name of your secret. Deploy the `SecretProviderClass` after making the changes.

Comment thread 12-using-az-kv/readme.md
In the secret-provider-class, change `ClientID`, `keyvaultName` and `tenantID` with the worload identity, keyvault name and the tenant ID of the keyvault. Update `ObjectName` with the name of your secret. Deploy the `SecretProviderClass` after making the changes.

<details markdown="2">
<summary>Click here for the Secret Provider Class YAML</summary>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.yaml file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants