-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update bundles per arm mixin usage #862
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4bb68a9
ref(workshop/porter-tf-aci): update bundle per arm mixin
vdice 19cbeff
ref(workshop/porter-tf): update bundle per arm mixin
vdice ef33c91
ref(examples/azure-wordpress): update bundle per arm mixin
vdice b8caba9
ref(examples/azure-terraform): update bundle per arm mixin
vdice df7a833
docs(wiring.md): update docs per arm mixin usage
vdice 7613f75
ref(examples/aks-spring-music): update per arm mixin
vdice a0bf4ed
docs(wiring.md): update step structure
vdice 24831a9
chore(Makefile): swap out azure with arm mixin
vdice dcb57ad
address review feedback
vdice 0eb4b47
add issue link to TODO in azure-wordpress bundle
vdice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
|
||
This bundle demonstrates advanced use cases for Porter. | ||
|
||
The bundle leverages a base Dockerfile (cnab/app/Dockerfile.base) to customize the resulting invocation image for the bundle by first installing the `azure cli` so that it can be used by the `exec` mixin. It then uses 4 mixins to access your Azure subscription and deploy the app. These values need to be updated in the porter.yaml. | ||
The bundle leverages a base Dockerfile (Dockerfile.tmpl) to customize the resulting invocation image for the bundle by first installing the `azure cli` so that it can be used by the `exec` mixin. It then uses 4 mixins to access your Azure subscription and deploy the app. These values need to be updated in the porter.yaml. | ||
|
||
* The `azure` mixin is used to create an AKS cluster using ARM. This requires subscription and tenant info. | ||
* The `arm` mixin is used to create an AKS cluster using ARM. This requires subscription and tenant info. | ||
* The `exec` mixin uses an Azure Service Principal to access via the CLI and install Helm's Tiller into an AKS cluster. | ||
* The `kubernetes` mixin applys RBAC policies for Helm | ||
* The `helm` mixin deploys the chart into the AKS cluster. | ||
|
@@ -37,7 +37,7 @@ The bundle will use the service principal created above to interact with Azure. | |
``` | ||
|
||
* Update params for your deployment | ||
* change the `invocationImage` Docker repo to match your Docker Hub account (line 4) | ||
* change the `tag` Docker repo to match your Docker Hub account (line 5) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit/suggestion: leave off the line # as it's easy to drift without us noticing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call; will remove. |
||
* Cosmos and AKS names must be unique. You can either edit the `porter.yaml` file default values (starting on line 90) or you can supply the with the porter CLI as shown below. | ||
|
||
* Build the innvocation image | ||
|
@@ -50,5 +50,10 @@ The bundle will use the service principal created above to interact with Azure. | |
|
||
```bash | ||
export INSTALL_ID=314 | ||
porter install -c azure --param app-resource-group=spring-music-demo-$INSTALL_ID --param aks-resource-group=spring-music-demo-$INSTALL_ID --param aks-cluster-name=briar-aks-spring-$INSTALL_ID --param cosmosdb-service-name=briarspringmusic$INSTALL_ID --param azure-location=eastus | ||
porter install -c azure \ | ||
--param app-resource-group=spring-music-demo-$INSTALL_ID \ | ||
--param aks-resource-group=spring-music-demo-$INSTALL_ID \ | ||
--param aks-cluster-name=briar-aks-spring-$INSTALL_ID \ | ||
--param cosmosdb-service-name=briarspringmusic$INSTALL_ID \ | ||
--param azure-location=eastus | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"clusterName": { | ||
"type": "string", | ||
"defaultValue": "[concat('cnab-aks-', uniqueString(resourceGroup().id))]", | ||
"metadata": { | ||
"description": "AKS cluster name. Defaults to cnab-aks-xxxxxxxxxxxxx, where xxx... is a unique string based of the hash of your resource group id." | ||
} | ||
}, | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]", | ||
"metadata": { | ||
"description": "The location of the Managed Cluster resource." | ||
} | ||
}, | ||
"dnsPrefix": { | ||
"type": "string", | ||
"defaultValue": "[concat('cnab-aks-', uniqueString(resourceGroup().id))]", | ||
"metadata": { | ||
"description": "Optional DNS prefix to use with hosted Kubernetes API server FQDN." | ||
} | ||
}, | ||
"osDiskSizeGB": { | ||
"type": "int", | ||
"defaultValue": 0, | ||
"metadata": { | ||
"description": "Disk size (in GB) to provision for each of the agent pool nodes. This value ranges from 0 to 1023. Specifying 0 will apply the default disk size for that agentVMSize." | ||
}, | ||
"minValue": 0, | ||
"maxValue": 1023 | ||
}, | ||
"agentCount": { | ||
"type": "int", | ||
"defaultValue": 3, | ||
"metadata": { | ||
"description": "The number of nodes for the cluster." | ||
}, | ||
"minValue": 1, | ||
"maxValue": 50 | ||
}, | ||
"agentVMSize": { | ||
"type": "string", | ||
"defaultValue": "Standard_DS2_v2", | ||
"metadata": { | ||
"description": "The size of the Virtual Machine." | ||
} | ||
}, | ||
"servicePrincipalClientId": { | ||
"metadata": { | ||
"description": "Client ID (used by cloudprovider)" | ||
}, | ||
"type": "securestring" | ||
}, | ||
"servicePrincipalClientSecret": { | ||
"metadata": { | ||
"description": "The Service Principal Client Secret." | ||
}, | ||
"type": "securestring" | ||
}, | ||
"osType": { | ||
"type": "string", | ||
"defaultValue": "Linux", | ||
"allowedValues": [ | ||
"Linux" | ||
], | ||
"metadata": { | ||
"description": "The type of operating system." | ||
} | ||
}, | ||
"kubernetesVersion": { | ||
"type": "string", | ||
"defaultValue": "1.15.7", | ||
"metadata": { | ||
"description": "The version of Kubernetes." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"apiVersion": "2018-03-31", | ||
"type": "Microsoft.ContainerService/managedClusters", | ||
"location": "[parameters('location')]", | ||
"name": "[parameters('clusterName')]", | ||
"properties": { | ||
"kubernetesVersion": "[parameters('kubernetesVersion')]", | ||
"dnsPrefix": "[parameters('dnsPrefix')]", | ||
"agentPoolProfiles": [ | ||
{ | ||
"name": "agentpool", | ||
"osDiskSizeGB": "[parameters('osDiskSizeGB')]", | ||
"count": "[parameters('agentCount')]", | ||
"vmSize": "[parameters('agentVMSize')]", | ||
"osType": "[parameters('osType')]", | ||
"storageProfile": "ManagedDisks" | ||
} | ||
], | ||
"servicePrincipalProfile": { | ||
"clientId": "[parameters('servicePrincipalClientId')]", | ||
"Secret": "[parameters('servicePrincipalClientSecret')]" | ||
} | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"controlPlaneFQDN": { | ||
"type": "string", | ||
"value": "[reference(parameters('clusterName')).fqdn]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"name": { | ||
"type": "string", | ||
"defaultValue": "[concat('cnab-cosmos-', uniqueString(resourceGroup().id))]", | ||
"metadata": { | ||
"description": "Cosmos DB account name. Defaults to cnab-cosmos-xxxxxxxxxxxxx, where xxx... is a unique string based of the hash of your resource group id." | ||
} | ||
}, | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]", | ||
"metadata": { | ||
"description": "Location for the Cosmos DB account. Defaults to the resource group location." | ||
} | ||
}, | ||
"apiVersion": { | ||
"type": "string", | ||
"defaultValue": "2016-03-31", | ||
"metadata": { | ||
"description": "API Version. Defaults to '2016-03-31'." | ||
} | ||
}, | ||
"kind": { | ||
"type": "string", | ||
"defaultValue": "MongoDB", | ||
"metadata": { | ||
"description": "The type/kind of API for the Cosmos Database. Defaults to MongoDB." | ||
} | ||
}, | ||
"mongoCapabilities": { | ||
"type": "array", | ||
"defaultValue": [ | ||
{ | ||
"name": "EnableAggregationPipeline" | ||
}, | ||
{ | ||
"name": "MongoDBv3.4" | ||
} | ||
], | ||
"metadata": { | ||
"description": "MongoDB API capabilities that should be enabled by default." | ||
} | ||
}, | ||
"enableMongoCapabilities": { | ||
"type": "array", | ||
"defaultValue": "[if(equals(parameters('kind'), 'MongoDB'), parameters('mongoCapabilities'), '[]')]", | ||
"metadata": { | ||
"description": "Conditional to enable api specific capabilities if MongoDB is the API chosen." | ||
} | ||
} | ||
}, | ||
"variables": {}, | ||
"resources": [ | ||
{ | ||
"apiVersion": "[parameters('apiVersion')]", | ||
"kind": "[parameters('kind')]", | ||
"type": "Microsoft.DocumentDB/databaseAccounts", | ||
"name": "[parameters('name')]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"databaseAccountOfferType": "Standard", | ||
"locations": [ | ||
{ | ||
"id": "[concat(parameters('name'), '-', parameters('location'))]", | ||
"failoverPriority": 0, | ||
"locationName": "[parameters('location')]" | ||
} | ||
], | ||
"enableMultipleWriteLocations": true, | ||
"isVirtualNetworkFilterEnabled": false, | ||
"virtualNetworkRules": [], | ||
"dependsOn": [], | ||
"capabilities": "[parameters('enableMongoCapabilities')]" | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"HOST": { | ||
"type": "string", | ||
"value": "[reference(parameters('name')).documentEndpoint]" | ||
}, | ||
"primary_key": { | ||
"type": "string", | ||
"value": "[listKeys(resourceId('Microsoft.DocumentDb/databaseAccounts', parameters('name')), parameters('apiVersion')).primaryMasterKey]" | ||
}, | ||
"connection_string": { | ||
"type": "string", | ||
"value": "[listConnectionStrings(resourceId('Microsoft.DocumentDb/databaseAccounts', parameters('name')), parameters('apiVersion')).connectionStrings[0].connectionString]" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Dang I thought I had gotten all of these, so glad you noticed! 🙇♀