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

OS type is not set for managed node pool when calling Azure API #1174

Closed
nprokopic opened this issue Feb 11, 2021 · 1 comment · Fixed by #1175
Closed

OS type is not set for managed node pool when calling Azure API #1174

nprokopic opened this issue Feb 11, 2021 · 1 comment · Fixed by #1175
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@nprokopic
Copy link
Contributor

/kind bug

What steps did you take and what happened:

Related to #1173

When CAPI and CAPZ objects are created to describe an existing AKS cluster, CAPZ AzureManagedMachinePool controller tries to reconcile the created AzureManagedMachinePool object. When it tries to call CreateOrUpdate for the agent pool, Azure API returns the following error:

"error creating AzureManagedMachinePool default/aks6pool1: failed to reconcile machine pool aks6pool1: failed to create or update agent pool: failed to begin operation: containerservice.AgentPoolsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=\"SystemPoolMustBeLinux\" Message=\"System node pool must be linux. Nodepool name: aks6pool1.\"" "controller"="azuremanagedmachinepool" "name"="aks6pool1" "namespace"="default"

Used CRs:

apiVersion: cluster.x-k8s.io/v1alpha3
kind: Cluster
metadata:
  name: aks6adopt
  namespace: default
spec:
  clusterNetwork:
    services:
      cidrBlocks:
        - 10.0.0.0/16
  controlPlaneRef:
    apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
    kind: AzureManagedControlPlane
    name: aks6adopt
  infrastructureRef:
    apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
    kind: AzureManagedCluster
    name: aks6adopt
---
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
kind: AzureManagedControlPlane
metadata:
  name: aks6adopt
  namespace: default
spec:
  defaultPoolRef:
    name: aks6pool1
  location: westeurope
  resourceGroupName: aks6adopt
  sshPublicKey: ""
  subscriptionID: AZURE_$SUBSCRIPTION_ID
  version: v1.19.6
  nodeResourceGroupName: ""   # populated automatically by the webhook
  networkPlugin: azure
  networkPolicy: calico
  virtualNetwork:
    cidrBlock: "10.0.0.0/8"
    name: "aks6adopt-vnet"
    subnet:
      cidrBlock: "10.240.0.0/16"
      name: "default"
  loadBalancerSKU: "Standard"
  dnsServiceIP: "10.0.0.10"
  additionalTags:
    tag1: "value1"
    tag2: "value2"
---
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
kind: AzureManagedCluster
metadata:
  name: aks6adopt
  namespace: default
---
apiVersion: exp.cluster.x-k8s.io/v1alpha3
kind: MachinePool
metadata:
  name: aks6pool1
  namespace: default
spec:
  clusterName: aks6adopt
  replicas: 2
  template:
    metadata: {}
    spec:
      bootstrap:
        dataSecretName: ""
      clusterName: aks6adopt
      infrastructureRef:
        apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
        kind: AzureManagedMachinePool
        name: aks6pool1
        namespace: default
      version: v1.19.6
---
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
kind: AzureManagedMachinePool
metadata:
  name: aks6pool1
  namespace: default
spec:
  osDiskSizeGB: 256
  sku: Standard_D4s_v3

What did you expect to happen:

AzureManagedMachinePool controller CreateOrUpdate call for the agent pool is successful and Azure API does not return errors.

This can be achieved by setting OsType field to Linux in ManagedClusterAgentPoolProfileProperties in containerservice.AgentPool.

Anything else you would like to add:

I have tested the suggested solution of setting OsType field to Linux in ManagedClusterAgentPoolProfileProperties in containerservice.AgentPool, and it's working. I'll submit a PR for this.

Environment:

  • cluster-api-provider-azure version: latest commit 417eccbe0ca8a433f44d1fb2a3a473c494a5ada3

  • Kubernetes version: (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.1", GitCommit:"206bcadf021e76c27513500ca24182692aabd17e", GitTreeState:"clean", BuildDate:"2020-09-14T07:30:52Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
  • OS (e.g. from /etc/os-release):
$ cat /etc/os-release
NAME="KDE neon"
VERSION="5.20"
ID=neon
ID_LIKE="ubuntu debian"
PRETTY_NAME="KDE neon User Edition 5.20"
VARIANT="User Edition"
VERSION_ID="20.04"
HOME_URL="https://neon.kde.org/"
SUPPORT_URL="https://neon.kde.org/"
BUG_REPORT_URL="https://bugs.kde.org/"
LOGO=start-here-kde-neon
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 11, 2021
@nprokopic
Copy link
Contributor Author

Proposed PR for fixing this #1175

@nprokopic nprokopic changed the title OS type is not set for AzureManagedMachinePool when calling Azure API OS type is not set for managed node pool when calling Azure API Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
2 participants