Giter VIP home page Giter VIP logo

Comments (7)

jackfrancis avatar jackfrancis commented on August 31, 2024

cc @nojnhuh if you want to sanity check this scenario as available in your ASO AKS prototype

from cluster-api-provider-azure.

nojnhuh avatar nojnhuh commented on August 31, 2024

@jackfrancis Yes, this kind of thing is possible with my prototype. Sorry @staerion I don't have anything to show for that yet, but keep your eyes on Slack and the PR queue in the coming weeks.

from cluster-api-provider-azure.

staerion avatar staerion commented on August 31, 2024

Great, thanksk for the heads up! We'll make sure to keep track of the slack channel and new releases.

from cluster-api-provider-azure.

dtzar avatar dtzar commented on August 31, 2024

How would this work with CAPZ new ASO v2 API? @nojnhuh @nawazkh

from cluster-api-provider-azure.

nojnhuh avatar nojnhuh commented on August 31, 2024

How would this work with CAPZ new ASO v2 API? @nojnhuh @nawazkh

You could add vnet and subnet resources to spec.resources of the AzureASOManagedCluster alongside the ResourceGroup and define them however you want:

from cluster-api-provider-azure.

nojnhuh avatar nojnhuh commented on August 31, 2024

How would this work with CAPZ new ASO v2 API? @nojnhuh @nawazkh

You could add vnet and subnet resources to spec.resources of the AzureASOManagedCluster alongside the ResourceGroup and define them however you want:

This would be the particular kind of change to apply to the flavor template to achieve this:

https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/21479a9a4c640b43e0bef028487c522c55605d06/templates/cluster-template-aks-aso.yaml

diff --git a/templates/cluster-template-aks-aso.yaml b/templates/cluster-template-aks-aso.yaml
index 29f77594e..1fb00a94e 100644
--- a/templates/cluster-template-aks-aso.yaml
+++ b/templates/cluster-template-aks-aso.yaml
@@ -54,6 +54,44 @@ spec:
       name: ${CLUSTER_NAME}
     spec:
       location: ${AZURE_LOCATION}
+  - apiVersion: network.azure.com/v1api20201101
+    kind: VirtualNetwork
+    metadata:
+      name: ${CLUSTER_NAME}
+    spec:
+      location: ${AZURE_LOCATION}
+      owner:
+        name: ${CLUSTER_NAME}
+      addressSpace:
+        addressPrefixes:
+          - 10.0.0.0/16
+  - apiVersion: network.azure.com/v1api20201101
+    kind: VirtualNetworksSubnet
+    metadata:
+      name: ${CLUSTER_NAME}-nodes
+    spec:
+      owner:
+        name: ${CLUSTER_NAME}
+      addressPrefix: 10.0.0.0/24
+  - apiVersion: network.azure.com/v1api20201101
+    kind: RouteTable
+    metadata:
+      name: ${CLUSTER_NAME}-nodes
+    spec:
+      location: ${AZURE_LOCATION}
+      owner:
+        name: ${CLUSTER_NAME}
+      disableBgpRoutePropagation: true
+  - apiVersion: network.azure.com/v1api20201101
+    kind: RouteTablesRoute
+    metadata:
+      name: ${CLUSTER_NAME}-route
+    spec:
+      owner:
+        name: ${CLUSTER_NAME}-nodes
+      addressPrefix: cab:cab::/96
+      nextHopType: VirtualAppliance
+      nextHopIpAddress: ace:cab:deca:f00d::1
 ---
 apiVersion: cluster.x-k8s.io/v1beta1
 kind: MachinePool
@@ -95,6 +133,10 @@ spec:
         name: ${CLUSTER_NAME}
       type: VirtualMachineScaleSets
       vmSize: ${AZURE_NODE_MACHINE_TYPE}
+      vnetSubnetReference:
+        group: network.azure.com
+        kind: VirtualNetworksSubnet
+        name: ${CLUSTER_NAME}-nodes
 ---
 apiVersion: cluster.x-k8s.io/v1beta1
 kind: MachinePool
@@ -136,3 +178,7 @@ spec:
         name: ${CLUSTER_NAME}
       type: VirtualMachineScaleSets
       vmSize: ${AZURE_NODE_MACHINE_TYPE}
+      vnetSubnetReference:
+        group: network.azure.com
+        kind: VirtualNetworksSubnet
+        name: ${CLUSTER_NAME}-nodes

Not that you'll have to set the ADDITIONAL_ASO_CRDS environment variable when you install CAPZ to a valid value for the --crd-pattern ASO command line flag as described here: https://azure.github.io/azure-service-operator/guide/crd-management/. You could set it to network.azure.com/* or more granularly depending on what you need.

https://azure.github.io/azure-service-operator/guide/crd-management/

These changes are mostly taken from the examples in the ASO docs, so tweak the parameters as-needed, but this should get you most of the way there.

All of the ASO resources' schemas are defined here: https://azure.github.io/azure-service-operator/reference/

/close

from cluster-api-provider-azure.

k8s-ci-robot avatar k8s-ci-robot commented on August 31, 2024

@nojnhuh: Closing this issue.

In response to this:

How would this work with CAPZ new ASO v2 API? @nojnhuh @nawazkh

You could add vnet and subnet resources to spec.resources of the AzureASOManagedCluster alongside the ResourceGroup and define them however you want:

This would be the particular kind of change to apply to the flavor template to achieve this:

https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/21479a9a4c640b43e0bef028487c522c55605d06/templates/cluster-template-aks-aso.yaml

diff --git a/templates/cluster-template-aks-aso.yaml b/templates/cluster-template-aks-aso.yaml
index 29f77594e..1fb00a94e 100644
--- a/templates/cluster-template-aks-aso.yaml
+++ b/templates/cluster-template-aks-aso.yaml
@@ -54,6 +54,44 @@ spec:
      name: ${CLUSTER_NAME}
    spec:
      location: ${AZURE_LOCATION}
+  - apiVersion: network.azure.com/v1api20201101
+    kind: VirtualNetwork
+    metadata:
+      name: ${CLUSTER_NAME}
+    spec:
+      location: ${AZURE_LOCATION}
+      owner:
+        name: ${CLUSTER_NAME}
+      addressSpace:
+        addressPrefixes:
+          - 10.0.0.0/16
+  - apiVersion: network.azure.com/v1api20201101
+    kind: VirtualNetworksSubnet
+    metadata:
+      name: ${CLUSTER_NAME}-nodes
+    spec:
+      owner:
+        name: ${CLUSTER_NAME}
+      addressPrefix: 10.0.0.0/24
+  - apiVersion: network.azure.com/v1api20201101
+    kind: RouteTable
+    metadata:
+      name: ${CLUSTER_NAME}-nodes
+    spec:
+      location: ${AZURE_LOCATION}
+      owner:
+        name: ${CLUSTER_NAME}
+      disableBgpRoutePropagation: true
+  - apiVersion: network.azure.com/v1api20201101
+    kind: RouteTablesRoute
+    metadata:
+      name: ${CLUSTER_NAME}-route
+    spec:
+      owner:
+        name: ${CLUSTER_NAME}-nodes
+      addressPrefix: cab:cab::/96
+      nextHopType: VirtualAppliance
+      nextHopIpAddress: ace:cab:deca:f00d::1
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
@@ -95,6 +133,10 @@ spec:
        name: ${CLUSTER_NAME}
      type: VirtualMachineScaleSets
      vmSize: ${AZURE_NODE_MACHINE_TYPE}
+      vnetSubnetReference:
+        group: network.azure.com
+        kind: VirtualNetworksSubnet
+        name: ${CLUSTER_NAME}-nodes
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
@@ -136,3 +178,7 @@ spec:
        name: ${CLUSTER_NAME}
      type: VirtualMachineScaleSets
      vmSize: ${AZURE_NODE_MACHINE_TYPE}
+      vnetSubnetReference:
+        group: network.azure.com
+        kind: VirtualNetworksSubnet
+        name: ${CLUSTER_NAME}-nodes

Not that you'll have to set the ADDITIONAL_ASO_CRDS environment variable when you install CAPZ to a valid value for the --crd-pattern ASO command line flag as described here: https://azure.github.io/azure-service-operator/guide/crd-management/. You could set it to network.azure.com/* or more granularly depending on what you need.

https://azure.github.io/azure-service-operator/guide/crd-management/

These changes are mostly taken from the examples in the ASO docs, so tweak the parameters as-needed, but this should get you most of the way there.

All of the ASO resources' schemas are defined here: https://azure.github.io/azure-service-operator/reference/

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

from cluster-api-provider-azure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.