wbuchwalter / Kubernetes-acs-engine-autoscaler

[Deprecated] Node-level autoscaler for Kubernetes clusters created with acs-engine.
Other
71 stars 22 forks source link

"Creating the deployment would exceed the quota of '800'" #63

Open wbuchwalter opened 7 years ago

wbuchwalter commented 7 years ago

The autoscaler should either always use the same deployment name, or clean older deployments at some point.

kshmir commented 6 years ago

@wbuchwalter how could I check these deployments? Is there a way to clean them manually?

oryagel commented 6 years ago

We're using the following powershell code in Azure Automation:


(
    [Parameter(Mandatory=$true)][String]$clusterResourceGroup,
    [Parameter(Mandatory=$true)][Int]$daysToKeep
)
write-output "starting..."
$Conn = Get-AutomationConnection -Name AzureRunAsConnection
Add-AzureRMAccount -ServicePrincipal -Tenant $Conn.TenantID `
-ApplicationId $Conn.ApplicationID -CertificateThumbprint $Conn.CertificateThumbprint

$ResourceGroup = Get-AzureRmResourceGroup -Name $clusterResourceGroup
$daysToClean = $daysToKeep * (-1)
$AllDeployments = (Get-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroup.ResourceGroupName) | Where-Object { ($_.Timestamp -lt (Get-Date).AddDays($daysToClean)) -and $_.DeploymentName.StartsWith("autoscaler") }

Write-output "Removing $($AllDeployments.count) deployments from $clusterResourceGroup"
foreach($deployment in $AllDeployments)
{
    Remove-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroup.ResourceGroupName -Name $deployment.DeploymentName -force
    Write-output "Removed deployment $($deployment.DeploymentName)"
}
kshmir commented 6 years ago

Thanks! I’ll port it to bash I guess though.

El El mar, ene. 16, 2018 a las 2:48 a. m., oryagel notifications@github.com escribió:

We're using the following powershell code in Azure Automation:

( [Parameter(Mandatory=$true)][String]$clusterResourceGroup, [Parameter(Mandatory=$true)][Int]$daysToKeep ) write-output "starting..." $Conn = Get-AutomationConnection -Name AzureRunAsConnection Add-AzureRMAccount -ServicePrincipal -Tenant $Conn.TenantID ` -ApplicationId $Conn.ApplicationID -CertificateThumbprint $Conn.CertificateThumbprint

$ResourceGroup = Get-AzureRmResourceGroup -Name $clusterResourceGroup $daysToClean = $daysToKeep * (-1) $AllDeployments = (Get-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroup.ResourceGroupName) | Where-Object { ($.Timestamp -lt (Get-Date).AddDays($daysToClean)) -and $.DeploymentName.StartsWith("autoscaler") }

Write-output "Removing $($AllDeployments.count) deployments from $clusterResourceGroup" foreach($deployment in $AllDeployments) { Remove-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroup.ResourceGroupName -Name $deployment.DeploymentName -force Write-output "Removed deployment $($deployment.DeploymentName)" }```

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wbuchwalter/Kubernetes-acs-engine-autoscaler/issues/63#issuecomment-357860180, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKvqJ-ctCQJHWNMDOB8hGMWu5Z9PNzaks5tLDg4gaJpZM4QNBEQ .