Skip to content

Commit

Permalink
Add support for enabling the Dapr extension (#350)
Browse files Browse the repository at this point in the history
* Add support for enabling the Dapr extension

Signed-off-by: Janusz Dziurzynski <[email protected]>

* Add "dapr" to cspell

Signed-off-by: Janusz Dziurzynski <[email protected]>

* Tweaks based on review feedback

Signed-off-by: Janusz Dziurzynski <[email protected]>

Signed-off-by: Janusz Dziurzynski <[email protected]>
  • Loading branch information
rzyns authored Aug 12, 2022
1 parent cdb7ef8 commit 296969f
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .github/workflows_dep/regressionparams/dapr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceName": {
"value": "az-k8s-dapr"
},
"agentVMSize": {
"value": "Standard_DS3_v2"
},
"daprAddon": {
"value": true
},
"daprAddonHA": {
"value": true
}
}
}
26 changes: 26 additions & 0 deletions bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,32 @@ resource fluxAddon 'Microsoft.KubernetesConfiguration/extensions@2022-04-02-prev
}
output fluxReleaseNamespace string = fluxGitOpsAddon ? fluxAddon.properties.scope.cluster.releaseNamespace : ''

@description('Add the Dapr extension')
param daprAddon bool = false
@description('Enable high availability (HA) mode for the Dapr control plane')
param daprAddonHA bool = false

resource daprExtension 'Microsoft.KubernetesConfiguration/extensions@2022-04-02-preview' = if(daprAddon) {
name: 'dapr'
scope: aks
properties: {
extensionType: 'Microsoft.Dapr'
autoUpgradeMinorVersion: true
releaseTrain: 'Stable'
configurationSettings: {
'global.ha.enabled': '${daprAddonHA}'
}
scope: {
cluster: {
releaseNamespace: 'dapr-system'
}
}
configurationProtectedSettings: {}
}
}

output daprReleaseNamespace string = daprAddon ? daprExtension.properties.scope.cluster.releaseNamespace : ''


/*__ ___. ______ .__ __. __ .___________. ______ .______ __ .__ __. _______
| \/ | / __ \ | \ | | | | | | / __ \ | _ \ | | | \ | | / _____|
Expand Down
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"currenttab",
"currt",
"currv",
"dapr",
"Dapr",
"Daemonset",
"demoapp",
"denydefault",
Expand Down
30 changes: 27 additions & 3 deletions helper/src/components/addonsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,32 @@ export default function ({ tabValues, updateFn, featureFlag, invalidArray }) {

</Stack.Item>

</Stack >

<Separator className="notopmargin" />

)
<Stack.Item align="start">
<Label required={true}>
dapr (Distributed Application Runtime)
(<a target="_new" href="https://docs.microsoft.com/en-us/azure/aks/dapr">docs</a>)
</Label>
<MessageBar messageBarType={MessageBarType.info} styles={{ root: { marginBottom: "10px" } }}>
Enabling this option installs dapr, but doesn't apply configuration
</MessageBar>
<Checkbox
styles={{ root: { marginLeft: "50px" } }}
inputProps={{ "data-testid": "addons-dapr-checkbox" }}
checked={addons.daprAddon}
onChange={(ev, v) => updateFn("daprAddon", v)}
label="Install the Dapr AddOn"
/>
<Checkbox
disabled={!addons.daprAddon}
styles={{ root: { marginLeft: "50px" } }}
inputProps={{ "data-testid": "addons-dapr-ha-checkbox" }}
checked={addons.daprAddonHA}
onChange={(ev, v) => updateFn("daprAddonHA", v)}
label="Enable high availability mode"
/>
</Stack.Item>
</Stack>
);
}
6 changes: 4 additions & 2 deletions helper/src/components/deployTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export default function DeployTab({ defaults, updateFn, tabValues, invalidArray,
...(addons.csisecret !== "none" && { keyVaultAksCSI: true }),
...(addons.csisecret === 'akvNew' && { keyVaultCreate: true, ...(deploy.kvCertSecretRole && { keyVaultOfficerRolePrincipalId: "$(az ad signed-in-user show --query id --out tsv)"}) }),
...(addons.csisecret !== "none" && addons.keyVaultAksCSIPollInterval !== defaults.addons.keyVaultAksCSIPollInterval && { keyVaultAksCSIPollInterval: addons.keyVaultAksCSIPollInterval }),
...(addons.fluxGitOpsAddon !== defaults.addons.fluxGitOpsAddon && { fluxGitOpsAddon: addons.fluxGitOpsAddon})
...(addons.fluxGitOpsAddon !== defaults.addons.fluxGitOpsAddon && { fluxGitOpsAddon: addons.fluxGitOpsAddon}),
...(addons.daprAddon !== defaults.addons.daprAddon && { daprAddon: addons.daprAddon }),
...(addons.daprAddonHA !== defaults.addons.daprAddonHA && { daprAddonHA: addons.daprAddonHA }),
}

const preview_params = {
Expand Down Expand Up @@ -516,4 +518,4 @@ az ad sp delete --id $(az ad sp show --id \${rmId[0]} --query id -o tsv)

</Stack>
)
}
}
2 changes: 2 additions & 0 deletions helper/src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"DefenderForContainers" : false
},
"addons": {
"daprAddon": false,
"daprAddonHA": false,
"fluxGitOpsAddon": false,
"networkPolicy": "none",
"kedaAddon": false,
Expand Down

0 comments on commit 296969f

Please sign in to comment.