sigs.k8s.io/cluster-api-provider-azure@v1.14.3/templates/flavors/README.md (about)

     1  # Flavors
     2  
     3  In `clusterctl` the infrastructure provider authors can provide different type of cluster templates,
     4  or flavors; use the --flavor flag to specify which flavor to use; e.g
     5  
     6  ```shell
     7  clusterctl generate cluster my-cluster --kubernetes-version v1.26.1 \
     8      --flavor private > my-cluster.yaml
     9  ```
    10  
    11  See [`clusterctl` flavors docs](https://cluster-api.sigs.k8s.io/clusterctl/commands/generate-cluster.html#flavors).
    12  
    13  This directory contains each of the flavors for CAPZ. Each directory besides `base` will be used to
    14  create a flavor by running `kustomize build` on the directory. The name of the directory will be
    15  appended to the end of the cluster-template.yaml, e.g cluster-template-{directory-name}.yaml. That
    16  flavor can be used by specifying `--flavor {directory-name}`.
    17  
    18  To generate all CAPZ flavors, run `make generate-flavors`.
    19  
    20  
    21  ## Running flavor clusters as a tilt resource
    22  
    23  #### From Tilt Config
    24  Tilt will auto-detect all available flavors from the `templates` directory.
    25  
    26  #### Requirements
    27  Please note your tilt-settings.yaml must contain at minimum the following fields when using tilt resources to deploy cluster flavors:
    28  ```yaml
    29  kustomize_substitutions:
    30    AZURE_SUBSCRIPTION_ID: "******"
    31    AZURE_TENANT_ID: "******"
    32    AZURE_CLIENT_SECRET: "******"
    33    AZURE_CLIENT_ID: "******"
    34  ```
    35  After updating tilt-settings.yaml, follow these two steps to deploy a workload cluster:
    36  
    37  1. Run ``make tilt up`` in the root of cluster-api-provider-azure repo. Note that the tilt-settings.yaml also resides here in the
    38  root of this repo. After tilt has initialized, press `space` to open the tilt web UI in a browser. See the following example:
    39     ![plot](../../docs/book/theme/tilt-up.png)
    40  2. Once your browser is open, click the clockwise arrow icon ⟳ on a resource listed. For example, `default` to deploy a default flavor.
    41     ![plot](../../docs/book/theme/flavour-deploy-from-ui.png)
    42  #### Defining Variable Overrides
    43  If you wish to override the default variables for flavor workers, you can specify them as part of your tilt-settings.yaml as seen in the example below.  Please note, the precedence of variables is as follows:
    44  
    45  1. explicitly defined vars for each flavor i.e. worker-templates.flavors[0].AZURE_VNET_NAME
    46  2. vars defined at 'metadata' level-- spans workers i.e. metadata.AZURE_VNET_NAME
    47  3. programmatically defined default vars i.e. everything except azure tenant, client, subscription
    48  
    49  
    50  ```yaml
    51  kustomize_substitutions:
    52    AZURE_SUBSCRIPTION_ID: "****"
    53    AZURE_TENANT_ID: "****"
    54    AZURE_CLIENT_SECRET: "****"
    55    AZURE_CLIENT_ID: "****"
    56  worker-templates:
    57    flavors:
    58      default:
    59        CLUSTER_NAME: example-default-cluster-name
    60        AZURE_VNET_NAME: example-vnet-one
    61      system-assigned-identity:
    62        CLUSTER_NAME: example-SAI-cluster-name
    63        AZURE_LOCATION: westus
    64        AZURE_VNET_NAME: example-vnet-two
    65    metadata:
    66      AZURE_LOCATION: eastus
    67      AZURE_RESOURCE_GROUP: test-resource-group-name
    68      CONTROL_PLANE_MACHINE_COUNT: "1"
    69      KUBERNETES_VERSION: v1.22.1
    70      AZURE_CONTROL_PLANE_MACHINE_TYPE: Standard_B2s
    71      WORKER_MACHINE_COUNT: "2"
    72      AZURE_NODE_MACHINE_TYPE: Standard_B2s
    73  ```
    74  
    75  Here is a practical example: creating a GPU-enabled cluster requires N-series nodes. You can set an
    76  N-series node type just for the `nvidia-gpu` flavor in `tilt-settings.yaml` to override any default:
    77  
    78  ```yaml
    79  kustomize_substitutions:
    80    AZURE_SUBSCRIPTION_ID: "****"
    81    AZURE_TENANT_ID: "****"
    82    AZURE_CLIENT_SECRET: "****"
    83    AZURE_CLIENT_ID: "****"
    84  worker-templates:
    85    flavors:
    86      nvidia-gpu:
    87        AZURE_NODE_MACHINE_TYPE: Standard_NC6s_v3
    88    metadata:
    89      AZURE_CONTROL_PLANE_MACHINE_TYPE: Standard_B2s
    90      AZURE_LOCATION: southcentralus
    91      KUBERNETES_VERSION: v1.22.1
    92      WORKER_MACHINE_COUNT: "1"
    93  ```