Skip to content
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

why this happens when I use asoctl, and kubectl apply, it shows below #3270

Closed
mingmingshiliyu opened this issue Sep 10, 2023 · 5 comments
Closed

Comments

@mingmingshiliyu
Copy link

wtst45x@MacBook-Pro additional % kubectl apply -f resources.yaml                                                            
Error from server (Invalid): error when creating "resources.yaml": ManagedCluster.containerservice.azure.com "testcluster" is invalid: spec.owner: Required value
Error from server (Invalid): error when creating "resources.yaml": ManagedClustersAgentPool.containerservice.azure.com "testcluster-agentpool" is invalid: spec.type: Unsupported value: "Microsoft.ContainerService/managedClusters/agentPools": supported values: "AvailabilitySet", "VirtualMachineScaleSets"
Error from server (Invalid): error when creating "resources.yaml": ManagedClustersAgentPool.containerservice.azure.com "testcluster-userpool" is invalid: spec.type: Unsupported value: "Microsoft.ContainerService/managedClusters/agentPools": supported values: "AvailabilitySet", "VirtualMachineScaleSets"
@mingmingshiliyu
Copy link
Author

so confused! new in azure, how can I resolve it

@theunrepentantgeek
Copy link
Member

These are errors coming from your cluster because your resources.yaml file has issues - you'll need to fix those in order for kubectl to work.

Since you haven't shared resources.yaml, I can't do much to assist, but here are some pointers.

ManagedCluster.containerservice.azure.com "testcluster" is invalid: spec.owner: Required value

You haven't provided a value for the owner property with the spec of your ManagedCluster definition. From the ManagedCluster documentation, we see that owner is a reference to the owner of the cluster.

Populate this with a reference to the Azure ResourceGroup into which the cluster should be created.

ManagedClustersAgentPool.containerservice.azure.com "testcluster-agentpool" is invalid: spec.type: 
Unsupported value: "Microsoft.ContainerService/managedClusters/agentPools": 
supported values: "AvailabilitySet", "VirtualMachineScaleSets"`

For the type of your AgentPool, you need to specify either AvailablilitySet or VirtualMachineScaleSets (see documentation).

The Microsoft.ContainerService/managedClusters/agentPools you provided is the type of the Custom Resource from a Kubernetes perspective and doesn't belong within the spec. It should be set on the apiVersion line of your file.

ManagedClustersAgentPool.containerservice.azure.com "testcluster-userpool" is invalid: spec.type: 
Unsupported value: "Microsoft.ContainerService/managedClusters/agentPools": 
supported values: "AvailabilitySet", "VirtualMachineScaleSets"

This is the same problem, on your other agent pool.

@theunrepentantgeek
Copy link
Member

Have a look at the samples we have for ManagedCluster and AgentPool, these show simple configurations that may be a useful reference.

@theunrepentantgeek theunrepentantgeek added waiting-on-user-response Waiting on more information from the original user before progressing. and removed needs-triage 🔍 labels Sep 11, 2023
@theunrepentantgeek
Copy link
Member

No update from user, closing.

@github-project-automation github-project-automation bot moved this from Backlog to Recently Completed in Azure Service Operator Roadmap Sep 28, 2023
@theunrepentantgeek theunrepentantgeek removed the waiting-on-user-response Waiting on more information from the original user before progressing. label Sep 28, 2023
@arsdragonfly
Copy link

@theunrepentantgeek still an issue for latest asoctl in that it won't populate owner field of spec when importing a ManagedCluster azure-resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants