-
Notifications
You must be signed in to change notification settings - Fork 522
feat: create kms key as part of cluster bootstrap #4170
Conversation
83bd5b4
to
c142de6
Compare
Codecov Report
@@ Coverage Diff @@
## master #4170 +/- ##
==========================================
+ Coverage 73.27% 73.31% +0.03%
==========================================
Files 135 135
Lines 20720 20765 +45
==========================================
+ Hits 15183 15224 +41
- Misses 4562 4566 +4
Partials 975 975
Continue to review full report at Codecov.
|
CI failures are because of cloud-init payload limit:
|
@@ -192,9 +193,11 @@ func createKubernetesMasterResourcesVMSS(cs *api.ContainerService) []interface{} | |||
} | |||
|
|||
if isKMSEnabled { | |||
// TODO (aramase) remove storage account creation as part of kms plugin v0.0.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do this in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current release v0.0.10
is still dependent on the storage account to exist. I'll remove it when we cut a kms release v0.0.11
and update the version in aks-engine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@@ -64,7 +64,7 @@ jobs: | |||
k8sRelease: '1.18' | |||
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json' | |||
createVNET: true | |||
enableKMSEncryption: true | |||
enableKMSEncryption: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to test this as part of PR gate anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new implementation brings excess cloud-init data overhead, which exceeds the allowed (64k bytes) limit when incorporated into the cluster config we're testing.
So we've added a discrete KMS-enabled cluster config to the set of jenkins-enabled cluster configs we test out of band.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's document how to run the kms-enabled jenkins job.
Tried to get the key version by using Example arm snippet used: "resources": [
{
"type": "Microsoft.KeyVault/vaults/keys",
"apiVersion": "2019-09-01",
"name": "[concat(parameters('vaultName'), '/', parameters('keyName'))]",
"location": "southcentralus",
"properties": {
"kty": "[parameters('keyType')]",
"keyOps": "[parameters('keyOps')]",
"keySize": "[parameters('keySize')]",
"curveName": "[parameters('curveName')]"
}
}
],
"variables": {
"kmsEncryptionKey": "[resourceId('Microsoft.KeyVault/vaults/keys', parameters('vaultName'), parameters('keyName'))]"
},
"outputs": {
"kmsKey": {
"type": "string",
"value": "[reference(resourceId('Microsoft.KeyVault/vaults/keys', parameters('vaultName'), parameters('keyName'))).keyUriWithVersion]"
}
} https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-outputs?tabs=azure-powershell |
SERVICE_PRINCIPAL_CLIENT_SECRET=$(jq -r '.aadClientSecret' ${AZURE_JSON_PATH}) | ||
TENANT_ID=$(jq -r '.tenantId' ${AZURE_JSON_PATH}) | ||
KMS_KEYVAULT_NAME=$(jq -r '.providerVaultName' ${AZURE_JSON_PATH}) | ||
KMS_KEY_NAME=$(jq -r '.providerKeyName' ${AZURE_JSON_PATH}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do you set the vault name and the key name in azure.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 values are already set when azure.json is created the first time - https://github.com/Azure/aks-engine/blob/master/parts/k8s/cloud-init/artifacts/cse_config.sh#L212-L215
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to how the keyname is passed into the cse_config.sh. But I see you are hardcoding it in the ARM template:
[concat(variables('clusterKeyVaultName'), '/', 'k8s')]",
@jackfrancis The @ritazh Addressed comments. PTAL! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aramase, jackfrancis, ritazh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Reason for Change:
premium
sku with user-assigned managed identityIssue Fixed:
Credit Where Due:
Does this change contain code from or inspired by another project?
If "Yes," did you notify that project's maintainers and provide attribution?
Requirements:
Notes:
cc @ritazh