kubernetes-sigs / cluster-api-provider-azure

Cluster API implementation for Microsoft Azure
https://capz.sigs.k8s.io/
Apache License 2.0
293 stars 422 forks source link

Allow omitting the k8s patch version in `azuremanagedcontrolplanes` #4111

Closed felfa01 closed 4 months ago

felfa01 commented 12 months ago

/kind feature

Describe the solution you'd like AKS allows to omit the patch version and thus defaulting to latest patch. When trying to configure this via CAPZ the following error is thrown:

Error: admission webhook "validation.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io" denied the request: must be a valid semantic version

Support docs: https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#alias-minor-version

dtzar commented 12 months ago

This is possible today in the current Go SDK we use as well as in ASO.
The problematic code is here.

Tagging @nojnhuh in case he wants to consider lighting this up in his PR.

nojnhuh commented 11 months ago

I think this would fit better as a change separate from #4069. This might be a bit more complicated than changing a regex since that value is currently shared in the templates between AzureManagedControlPlane spec.version and MachinePool spec.template.spec.version and I'm not sure if CAPI accepts MAJOR.MINOR versions there.

LochanRn commented 11 months ago

@nojnhuh how do we support this if we want ?

Should I raise a support request in CAPI ?

nojnhuh commented 11 months ago

I think bringing this up in CAPI makes the most sense to me. That may have already been discussed at some point, so it would be worth a quick look through the CAPI issue queue, Slack, and weekly meeting notes to see if that has been previously brought up.

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 7 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

nojnhuh commented 4 months ago

This is possible with the new ASO-based API: https://capz.sigs.k8s.io/topics/aso#experimental-aso-api

The way you would do this is to not specify spec.template.spec.version on the MachinePool, then set spec.orchestratorVersion to anything allowed by AKS on the ManagedClustersAgentPool definition in spec.resources for the AzureASOManagedMachinePool. orchestratorVersion would be set under this spec in the example template: https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/32ebb7709bfd89a0d06c8dd40d25cf1ab39f8ac9/templates/cluster-template-aks-aso.yaml#L91

/close

k8s-ci-robot commented 4 months ago

@nojnhuh: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/4111#issuecomment-2115882479): >This is possible with the new ASO-based API: https://capz.sigs.k8s.io/topics/aso#experimental-aso-api > >The way you would do this is to not specify `spec.template.spec.version` on the MachinePool, then set `spec.orchestratorVersion` to anything allowed by AKS on the ManagedClustersAgentPool definition in `spec.resources` for the AzureASOManagedMachinePool. `orchestratorVersion` would be set under this `spec` in the example template: https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/32ebb7709bfd89a0d06c8dd40d25cf1ab39f8ac9/templates/cluster-template-aks-aso.yaml#L91 > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.