-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[AKS] az aks create/update
: Add support for KEDA workload auto-scaler
#24698
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7938,3 +7938,70 @@ def test_aks_nodepool_add_with_gpu_instance_profile(self, resource_group, resour | |
# delete | ||
self.cmd( | ||
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()]) | ||
|
||
@AllowLargeResponse() | ||
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2') | ||
def test_aks_create_with_keda(self, resource_group, resource_group_location): | ||
aks_name = self.create_random_name('cliakstest', 16) | ||
self.kwargs.update({ | ||
'resource_group': resource_group, | ||
'name': aks_name, | ||
'location': resource_group_location, | ||
'ssh_key_value': self.generate_ssh_keys(), | ||
}) | ||
|
||
# create: enable-keda | ||
create_cmd = 'aks create --resource-group={resource_group} --name={name} --location={location} --ssh-key-value={ssh_key_value} --output=json ' \ | ||
'--aks-custom-headers=AKSHTTPCustomFeatures=Microsoft.ContainerService/AKS-KedaPreview ' \ | ||
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. Does this feature still need the feature flag? If not, please remove this custom header 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. Currently, it does. Once all other changes are done for GA, we will remove the feature flag. I'll send in another PR to change that here as well. |
||
'--enable-keda' | ||
self.cmd(create_cmd, checks=[ | ||
self.check('provisioningState', 'Succeeded'), | ||
self.check('workloadAutoScalerProfile.keda.enabled', True), | ||
]) | ||
|
||
# delete | ||
delete_cmd = 'aks delete --resource-group={resource_group} --name={name} --yes --no-wait' | ||
self.cmd(delete_cmd, checks=[ | ||
self.is_empty(), | ||
]) | ||
|
||
@AllowLargeResponse() | ||
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2') | ||
def test_aks_update_with_keda(self, resource_group, resource_group_location): | ||
aks_name = self.create_random_name('cliakstest', 16) | ||
self.kwargs.update({ | ||
'resource_group': resource_group, | ||
'name': aks_name, | ||
'location': resource_group_location, | ||
'ssh_key_value': self.generate_ssh_keys(), | ||
}) | ||
|
||
# create: without enable-keda | ||
create_cmd = 'aks create --resource-group={resource_group} --name={name} --location={location} --ssh-key-value={ssh_key_value} --output=json' | ||
self.cmd(create_cmd, checks=[ | ||
self.check('provisioningState', 'Succeeded'), | ||
self.not_exists('workloadAutoScalerProfile.keda'), | ||
]) | ||
|
||
# update: enable-keda | ||
update_cmd = 'aks update --resource-group={resource_group} --name={name} --yes --output=json ' \ | ||
'--aks-custom-headers=AKSHTTPCustomFeatures=Microsoft.ContainerService/AKS-KedaPreview ' \ | ||
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. Also remove this header if the feature is not protected by AFEC anymore. 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. Please refer to my reply above. |
||
'--enable-keda' | ||
self.cmd(update_cmd, checks=[ | ||
self.check('provisioningState', 'Succeeded'), | ||
self.check('workloadAutoScalerProfile.keda.enabled', True), | ||
]) | ||
|
||
# update: disable-keda | ||
update_cmd = 'aks update --resource-group={resource_group} --name={name} --yes --output=json ' \ | ||
'--disable-keda' | ||
self.cmd(update_cmd, checks=[ | ||
self.check('provisioningState', 'Succeeded'), | ||
self.check('workloadAutoScalerProfile.keda.enabled', False), | ||
]) | ||
|
||
# delete | ||
cmd = 'aks delete --resource-group={resource_group} --name={name} --yes --no-wait' | ||
self.cmd(cmd, checks=[ | ||
self.is_empty(), | ||
]) |
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.
You should move this function to the other class
AKSManagedClusterUpdateDecorator
. The function to construct the updated profile (update_mc_profile_default
) is also in this class.