-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add AKS data-gatherer #30
Conversation
It can be run with:
This is an example of the data that is gatherered: {
"aks": {
"Cluster": {
"properties": {
"networkProfile": {
"dockerBridgeCidr": "172.17.0.1/16",
"dnsServiceIP": "10.0.0.10",
"serviceCidr": "10.0.0.0/16",
"podCidr": "10.244.0.0/16",
"networkPlugin": "kubenet"
},
"enableRBAC": true,
"nodeResourceGroup": "MC_preflight_preflight-test_uksouth",
"addonProfiles": {
"httpApplicationRouting": {
"config": null,
"enabled": false
}
},
"servicePrincipalProfile": {
"clientId": "***********************"
},
"agentPoolProfiles": [
{
"osType": "Linux",
"maxPods": 110,
"storageProfile": "ManagedDisks",
"osDiskSizeGB": 100,
"vmSize": "Standard_B2s",
"count": 1,
"name": "agentpool"
}
],
"fqdn": "preflight-test-dns-f2de96e5.hcp.uksouth.azmk8s.io",
"dnsPrefix": "preflight-test-dns",
"kubernetesVersion": "1.14.8",
"provisioningState": "Succeeded"
},
"type": "Microsoft.ContainerService/ManagedClusters",
"name": "preflight-test",
"location": "uksouth",
"id": "/subscriptions/*****************/resourcegroups/preflight/providers/Microsoft.ContainerService/managedClusters/preflight-test"
}
}
} |
The credentials file required for this has been obtained with the Azure CLI by running This access token is very short-living (max 1 hour), which is suboptimal for this use case. I am exploring other alternatives to authenticate against Azure. |
|
||
// Fetch retrieves cluster information from AKS. | ||
func (g *AKSDataGatherer) Fetch() (interface{}, error) { | ||
client := &http.Client{} |
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.
Is there a reason for using the HTTP client rather than the Azure client? https://github.com/Azure-Samples/azure-sdk-for-go-samples/blob/master/compute/container_cluster.go
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 don't have a strong opinion about how it should be done, just comparing it to other gatherers.
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.
Actually, I didn't know about https://github.com/Azure-Samples/azure-sdk-for-go-samples.
I checked https://github.com/Azure/azure-sdk-for-go and https://github.com/Azure/aks-engine and none of them can serve as a client for what we wanted here.
I will give https://github.com/Azure-Samples/azure-sdk-for-go-samples a try.
@j-fuentes I can confirm I've been able to run this against an actual AKS cluster and it worked correctly, so I've approved it in its current form. If you change the AKS client I will give another test, or if you decide to leave it as is I can |
Signed-off-by: Jose Fuentes <[email protected]>
Signed-off-by: Jose Fuentes <[email protected]>
Signed-off-by: Jose Fuentes <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: j-fuentes, wwwil 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 |
I have just rebased the current master. After checking |
/lgtm |
This adds the first implementation of the AKS datagatherer and a sample package that uses it.
This also bumps Go version to 1.13 since that is the branch we are using in CI.
Signed-off-by: Jose Fuentes [email protected]