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

[Bug]: cannot patch the managed resource via server-side apply: KubernetesCluster is invalid: spec: Invalid value: "object": spec.forProvider.defaultNodePool is a required parameter #738

Open
1 task done
haarchri opened this issue May 10, 2024 · 2 comments
Labels
bug Something isn't working needs:triage

Comments

@haarchri
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Affected Resource(s)

containerservice.azure.upbound.io/v1beta1 - KubernetesCluster

Resource MRs required to reproduce the bug

No response

Steps to Reproduce

think its realted to crossplane/crossplane#5055

What happened?

kubectl describe kubernetescluster.containerservice.azure.upbound.io/hostcluster-aks-aks 
Name:         hostcluster-aks-aks
Namespace:    
Labels:       crossplane.io/claim-name=hostcluster-aks
              crossplane.io/claim-namespace=default
              crossplane.io/composite=hostcluster-aks-kjldk
Annotations:  crossplane.io/composition-resource-name: kubernetesCluster
              crossplane.io/external-create-pending: 2024-05-10T09:55:43Z
              crossplane.io/external-create-succeeded: 2024-05-10T09:55:43Z
              crossplane.io/external-name: hostcluster-aks-aks
              upjet.upbound.io/test: true
API Version:  containerservice.azure.upbound.io/v1beta1
Kind:         KubernetesCluster
Metadata:
  Creation Timestamp:  2024-05-10T09:53:46Z
  Finalizers:
    finalizer.managedresource.crossplane.io
  Generate Name:  hostcluster-aks-kjldk-
  Generation:     9
  Owner References:
    API Version:           azure.platform.upbound.io/v1alpha1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  XAKS
    Name:                  hostcluster-aks-kjldk-46v89
    UID:                   9d163882-21c4-413f-9013-6fb8a6819465
  Resource Version:        5100
  UID:                     973f012f-8be0-4343-947b-aabced8055c6
Spec:
  Deletion Policy:  Delete
  For Provider:
    Default Node Pool:
      Name:            default
      Node Count:      1
      Vm Size:         standard_d8s_v3
      Vnet Subnet Id:  /subscriptions/038f2b7c-3265-43b8-8624-c9ad5da610a8/resourceGroups/hostcluster-aks-kjldk-xznc4/providers/Microsoft.Network/virtualNetworks/hostcluster-aks-vnet/subnets/hostcluster-aks-sn
      Vnet Subnet Id Ref:
        Name:  hostcluster-aks-sn
      Vnet Subnet Id Selector:
        Match Labels:
          azure.platform.upbound.io/network-id:  hostcluster-aks
    Dns Prefix:                                  hostcluster-aks
    Identity:
      Type:              SystemAssigned
    Kubernetes Version:  1.28
    Location:            westus
    Resource Group Name Selector:
      Match Labels:
        azure.platform.upbound.io/network-id:  hostcluster-aks
  Init Provider:
  Management Policies:
    *
  Provider Config Ref:
    Name:  default
  Write Connection Secret To Ref:
    Name:       9d163882-21c4-413f-9013-6fb8a6819465-akscluster
    Namespace:  upbound-system
Status:
  At Provider:
  Conditions:
    Last Transition Time:  2024-05-10T09:57:44Z
    Message:               cannot patch the managed resource via server-side apply: KubernetesCluster.containerservice.azure.upbound.io "hostcluster-aks-aks" is invalid: spec: Invalid value: "object": spec.forProvider.defaultNodePool is a required parameter
    Reason:                ReconcileError
    Status:                False
    Type:                  Synced
    Last Transition Time:  2024-05-10T09:55:43Z
    Reason:                Creating
    Status:                False
    Type:                  Ready
Events:
  Type     Reason                           Age                    From                                                                       Message
  ----     ------                           ----                   ----                                                                       -------
  Warning  CannotResolveResourceReferences  3m46s (x7 over 4m39s)  managed/containerservice.azure.upbound.io/v1beta1, kind=kubernetescluster  cannot resolve references: mg.Spec.ForProvider.DefaultNodePool[i3].VnetSubnetID: referenced field was empty (referenced resource may not yet be ready)
  Normal   CreatedExternalResource          2m42s                  managed/containerservice.azure.upbound.io/v1beta1, kind=kubernetescluster  Successfully requested creation of external resource
  Warning  CannotResolveResourceReferences  10s (x12 over 2m41s)   managed/containerservice.azure.upbound.io/v1beta1, kind=kubernetescluster  cannot patch the managed resource via server-side apply: KubernetesCluster.containerservice.azure.upbound.io "hostcluster-aks-aks" is invalid: spec: Invalid value: "object": spec.forProvider.defaultNodePool is a required parameter

Relevant Error Output Snippet

No response

Crossplane Version

1.15.2

Provider Version

1.1.0

Kubernetes Version

No response

Kubernetes Distribution

No response

Additional Info

No response

@haarchri haarchri added bug Something isn't working needs:triage labels May 10, 2024
@haarchri
Copy link
Member Author

after time it changes

NAME                                                                      READY   SYNCED   EXTERNAL-NAME         AGE
kubernetescluster.containerservice.azure.upbound.io/hostcluster-aks-aks   False   False    hostcluster-aks-aks   4m30s
NAME                                                                      READY   SYNCED   EXTERNAL-NAME         AGE
kubernetescluster.containerservice.azure.upbound.io/hostcluster-aks-aks   True    True     hostcluster-aks-aks   6m54s

@haarchri haarchri changed the title [Bug]: [Bug]: cannot patch the managed resource via server-side apply: KubernetesCluster is invalid: spec: Invalid value: "object": spec.forProvider.defaultNodePool is a required parameter May 10, 2024
@felfa01
Copy link

felfa01 commented May 14, 2024

Seeing the same issue running crossplane:v1.15.1 and provider-azure-containerservice:v1.0.1.

  - lastTransitionTime: "2024-05-13T14:57:46Z"
    message: 'cannot patch the managed resource via server-side apply: KubernetesCluster.containerservice.azure.upbound.io
      "aks123" is invalid: spec: Invalid value: "object": spec.forProvider.defaultNodePool
      is a required parameter'
    reason: ReconcileError
    status: "False"
    type: Synced

This causes the KubernetesCluster resource to show as unhealthy.

It appears that by not using resourceGroupNameSelector and instead opting for resourceGroupName is a valid workaround:

    resourceGroupName: aks-rg
    #resourceGroupNameSelector:
    #  matchLabels:
    #    app.kubernetes.io/name: aks-rg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage
Projects
None yet
Development

No branches or pull requests

2 participants