Kubernetes-acs-engine-autoscaler icon indicating copy to clipboard operation
Kubernetes-acs-engine-autoscaler copied to clipboard

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

Open wbuchwalter opened this issue 8 years ago • 3 comments

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

wbuchwalter avatar Oct 31 '17 16:10 wbuchwalter

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

kshmir avatar Jan 16 '18 05:01 kshmir

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)"
}

oryagel avatar Jan 16 '18 05:01 oryagel

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

El El mar, ene. 16, 2018 a las 2:48 a. m., oryagel [email protected] 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 .

kshmir avatar Jan 16 '18 05:01 kshmir