azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

In ContainerServiceManager, are some operations missing on KubernetesClusters?

Open agateaux opened this issue 1 year ago • 3 comments

Query/Question I'm wondering if I use correctly the KubernetesClusters resource.

var clusters = ContainerServiceManager
				.authenticate(clustersClientConfig.credential(), clustersClientConfig.azureProfile())
				.kubernetesClusters();

1st question When defining a cluster (interface KubernetesCluster and class KubernetesClustersImpl)

var cluster = kubernetesClusters.define(name)
				.withRegion(region)
				.withExistingResourceGroup(resourceGroupName)
				.withVersion(version)
				.withSystemAssignedManagedServiceIdentity()
				.withDnsPrefix(name.toLowerCase())
				.withTags(tags);

I don't see any withSku. Is there a way to define the SKU like in ManagedClusterInner line 96?

2nd question: When updating an existing cluster, there is no way to upgrade the kubernetes version, in:

kubernetesCluster.update()
                                .withoutAgentPool(agentPool)
				.applyAsync();

We should have a withNewKubernetesVersion, am I wrong?

Why is this not a Bug or a feature Request? I don't know for now, maybe it's a feature request, or a better documentation.

Setup (please complete the following information if applicable):

  • OS: Linux Ubuntu
  • IDE: Eclipse
  • Library/Libraries: com.azure.resourcemanager:azure-resourcemanager-containerservice:2.35.0

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Query Added
  • [x] Setup information Added

agateaux avatar Feb 19 '24 21:02 agateaux

@weidongxu-microsoft could you follow up with @agateaux

joshfree avatar Feb 20 '24 18:02 joshfree

@agateaux Thanks for the report. This part of the code is handwritten. Hence, sometimes it lags behind what backend offers.

We will add the way to set SKU, as well as e.g. withKubernetesVersion to set/update version.

weidongxu-microsoft avatar Feb 22 '24 03:02 weidongxu-microsoft

Thanks. For the creation, the definition stage already supports the 'withVersion', to specify the Kubernetes version. That's just for the update, the update stage doesn't offer this feature.

Present here: https://github.com/Azure/azure-sdk-for-java/blob/bcdd2d3eb121f03a5e0d4ae0ed32d0bc646f4b3d/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java#L178

Not here: https://github.com/Azure/azure-sdk-for-java/blob/bcdd2d3eb121f03a5e0d4ae0ed32d0bc646f4b3d/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java#L602

agateaux avatar Feb 22 '24 15:02 agateaux

PR merged: https://github.com/Azure/azure-sdk-for-java/pull/39110

2.37.0 will be around mid March.

XiaofeiCao avatar Mar 08 '24 02:03 XiaofeiCao

Thank you

agateaux avatar Mar 08 '24 23:03 agateaux

@agateaux 2.37.0 released. Let us know if it works for you.

XiaofeiCao avatar Mar 22 '24 08:03 XiaofeiCao

Hi @agateaux. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

github-actions[bot] avatar Mar 22 '24 08:03 github-actions[bot]

Yes sure, I'll keep you posted next week.

agateaux avatar Mar 22 '24 21:03 agateaux

Everything works fine. Thank you.

agateaux avatar Mar 27 '24 14:03 agateaux