Skip to content

Commit

Permalink
Introduce Azure Accelerated Networking
Browse files Browse the repository at this point in the history
for machine type/os image combinations which support it.
  • Loading branch information
dkistner committed Apr 17, 2020
1 parent 7f99c52 commit 554083b
Show file tree
Hide file tree
Showing 16 changed files with 340 additions and 45 deletions.
12 changes: 8 additions & 4 deletions charts/internal/machineclass/templates/machineclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ spec:
{{- if hasKey $machineClass "identityID" }}
identityID: {{ $machineClass.identityID }}
{{- end }}
{{- if hasKey $machineClass.network "acceleratedNetworking" }}
networkProfile:
acceleratedNetworking: {{ $machineClass.network.acceleratedNetworking }}
{{- end }}
hardwareProfile:
vmSize: {{ $machineClass.machineType }}
osProfile:
Expand Down Expand Up @@ -65,11 +69,11 @@ spec:
name: {{ $machineClass.name }}
namespace: {{ $.Release.Namespace }}
subnetInfo:
vnetName: {{ $machineClass.vnetName }}
{{- if hasKey $machineClass "vnetResourceGroup" }}
vnetResourceGroup: {{ $machineClass.vnetResourceGroup}}
vnetName: {{ $machineClass.network.vnet }}
{{- if hasKey $machineClass.network "vnetResourceGroup" }}
vnetResourceGroup: {{ $machineClass.network.vnetResourceGroup}}
{{- end }}
subnetName: {{ $machineClass.subnetName }}
subnetName: {{ $machineClass.network.subnet }}
{{- if $machineClass.tags }}
tags:
{{ toYaml $machineClass.tags | indent 4 }}
Expand Down
12 changes: 8 additions & 4 deletions charts/internal/machineclass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ machineClasses:
# foo: bar
region: westeurope
resourceGroup: my-resource-group
vnetName: my-vnet
subnetName: my-subnet-in-my-vnet
zone: 1
# identityID: /subscriptions/subscription-id/resourceGroups/resource-group-name/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name
network:
vnet: my-vnet
subnet: my-subnet-in-my-vnet
# vnetResourceGroup: my-vnet-resource-group
# acceleratedNetworking: true
tags:
Name: shoot-crazy-botany
kubernetes.io-cluster-shoot-crazy-botany: "1"
Expand All @@ -29,8 +32,9 @@ machineClasses:
- name: class-2-availability-set
region: westeurope
resourceGroup: my-resource-group
vnetName: my-vnet
subnetName: my-subnet-in-my-vnet
network:
vnet: my-vnet
subnet: my-subnet-in-my-vnet
availabilitySetID: /subscriptions/subscription-id/resourceGroups/resource-group-name/providers/Microsoft.Compute/availabilitySets/availablity-set-name
tags:
Name: shoot-crazy-botany
Expand Down
7 changes: 7 additions & 0 deletions docs/usage-as-end-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,10 @@ spec:
nginxIngress:
enabled: true
```

## Miscellaneous

### Azure Accelerated Networking
All worker machines of the cluster will be automatically configured to use [Azure Accelerated Networking](https://docs.microsoft.com/en-us/azure/virtual-network/create-vm-accelerated-networking-cli) if the prerequisites are fulfilled.
The prerequisites are that the used machine type and operating system image version are compatible for Accelerated Networking.
Supported machine types are listed in the CloudProfile in `.spec.providerConfig.machineTypes[].acceleratedNetworking` and the supported operating system image versions are defined in `.spec.providerConfig.machineImages[].versions[].acceleratedNetworking`.
30 changes: 26 additions & 4 deletions docs/usage-as-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ In this document we are describing how this configuration looks like for Azure a

## `CloudProfileConfig`

The cloud profile configuration contains information about the update and failure domain counts in the Azure regions you want to offer.
Additionally, it contains the real machine image identifiers in the Azure environment. You can provide either URN for Azure Market Place images or id of [Shared Image Gallery](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/shared-image-galleries) images.
When Shared Image Gallery is used, you have to ensure that the image is available in the desired regions and the end-user subscriptions have access to the image or to the whole gallery.
You have to map every version that you specify in `.spec.machineImages[].versions` here such that the Azure extension knows the machine image identifiers for every version you want to offer.


An example `CloudProfileConfig` for the Azure extension looks as follows:

Expand All @@ -22,17 +19,31 @@ countUpdateDomains:
countFaultDomains:
- region: westeurope
count: 3
machineTypes:
- name: Standard_D3_v2
acceleratedNetworking: true
- name: Standard_X
machineImages:
- name: coreos
versions:
- version: 2135.6.0
urn: "CoreOS:CoreOS:Stable:2135.6.0"
acceleratedNetworking: true
- name: myimage
versions:
- version: 1.0.0
id: "/subscriptions/<subscription ID where the gallery is located>/resourceGroups/myGalleryRG/providers/Microsoft.Compute/galleries/myGallery/images/myImageDefinition/versions/1.0.0"
```
The cloud profile configuration contains information about the update via `.countUpdateDomains[]` and failure domain via `.countFaultDomains[]` counts in the Azure regions you want to offer.

The `.machineTypes[]` list contain provider specific information to the machine types e.g. if the machine type support [Azure Accelerated Networking](https://docs.microsoft.com/en-us/azure/virtual-network/create-vm-accelerated-networking-cli), see `.machineTypes[].acceleratedNetworking`.

Additionally, it contains the real machine image identifiers in the Azure environment. You can provide either URN for Azure Market Place images or id of [Shared Image Gallery](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/shared-image-galleries) images.
When Shared Image Gallery is used, you have to ensure that the image is available in the desired regions and the end-user subscriptions have access to the image or to the whole gallery.
You have to map every version that you specify in `.spec.machineImages[].versions` here such that the Azure extension knows the machine image identifiers for every version you want to offer.
Furthermore, you can specify for each image version via `.machineImages[].versions[].acceleratedNetworking` if Azure Accelerated Networking is supported.

## Example `CloudProfile` manifest

The possible values for `.spec.volumeTypes[].name` on Azure are `Standard_LRS`, `StandardSSD_LRS` and `Premium_LRS`. There is another volume type called `UltraSSD_LRS` but this type is not supported to use as os disk. If an end user select a volume type whose name is not equal to one of the valid values then the machine will be created with the default volume type which belong to the selected machine type. Therefore it is recommended to configure only the valid values for the `.spec.volumeType[].name` in the `CloudProfile`.
Expand All @@ -56,6 +67,10 @@ spec:
versions:
- version: 2135.6.0
machineTypes:
- name: Standard_D3_v2
cpu: "4"
gpu: "0"
memory: 14Gi
- name: Standard_D4_v3
cpu: "4"
gpu: "0"
Expand All @@ -75,6 +90,10 @@ spec:
providerConfig:
apiVersion: azure.provider.extensions.gardener.cloud/v1alpha1
kind: CloudProfileConfig
machineTypes:
- name: Standard_D3_v2
acceleratedNetworking: true
- name: Standard_D4_v3
countUpdateDomains:
- region: westeurope
count: 5
Expand All @@ -84,6 +103,9 @@ spec:
machineImages:
- name: coreos
versions:
- version: 2303.3.0
urn: CoreOS:CoreOS:Stable:2303.3.0
acceleratedNetworking: true
- version: 2135.6.0
urn: "CoreOS:CoreOS:Stable:2135.6.0"
```
80 changes: 80 additions & 0 deletions hack/api-reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ string
logical names and versions to provider-specific identifiers.</p>
</td>
</tr>
<tr>
<td>
<code>machineTypes</code></br>
<em>
<a href="#azure.provider.extensions.gardener.cloud/v1alpha1.MachineType">
[]MachineType
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>MachineTypes is a list of machine types complete with provider specific information.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="azure.provider.extensions.gardener.cloud/v1alpha1.ControlPlaneConfig">ControlPlaneConfig
Expand Down Expand Up @@ -672,6 +686,18 @@ string
<p>ID is the VM image ID</p>
</td>
</tr>
<tr>
<td>
<code>acceleratedNetworking</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>AcceleratedNetworking is an indicator if the image supports Azure accelerated networking.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="azure.provider.extensions.gardener.cloud/v1alpha1.MachineImageVersion">MachineImageVersion
Expand Down Expand Up @@ -726,6 +752,18 @@ string
<p>ID is the Shared Image Gallery image id.</p>
</td>
</tr>
<tr>
<td>
<code>acceleratedNetworking</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>AcceleratedNetworking is an indicator if the image supports Azure accelerated networking.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="azure.provider.extensions.gardener.cloud/v1alpha1.MachineImages">MachineImages
Expand Down Expand Up @@ -771,6 +809,48 @@ string
</tr>
</tbody>
</table>
<h3 id="azure.provider.extensions.gardener.cloud/v1alpha1.MachineType">MachineType
</h3>
<p>
(<em>Appears on:</em>
<a href="#azure.provider.extensions.gardener.cloud/v1alpha1.CloudProfileConfig">CloudProfileConfig</a>)
</p>
<p>
<p>MachineType contains provider specific information to a machine type.</p>
</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>name</code></br>
<em>
string
</em>
</td>
<td>
<p>Name is the name of the machine type.</p>
</td>
</tr>
<tr>
<td>
<code>acceleratedNetworking</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>AcceleratedNetworking is an indicator if the machine type supports Azure accelerated networking.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="azure.provider.extensions.gardener.cloud/v1alpha1.NatGatewayConfig">NatGatewayConfig
</h3>
<p>
Expand Down
9 changes: 5 additions & 4 deletions pkg/apis/azure/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ func FindImageFromCloudProfile(cloudProfileConfig *api.CloudProfileConfig, image
for _, version := range machineImage.Versions {
if imageVersion == version.Version {
return &api.MachineImage{
Name: imageName,
Version: version.Version,
URN: version.URN,
ID: version.ID,
Name: imageName,
Version: version.Version,
URN: version.URN,
ID: version.ID,
AcceleratedNetworking: version.AcceleratedNetworking,
}, nil
}
}
Expand Down
12 changes: 12 additions & 0 deletions pkg/apis/azure/types_cloudprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type CloudProfileConfig struct {
// MachineImages is the list of machine images that are understood by the controller. It maps
// logical names and versions to provider-specific identifiers.
MachineImages []MachineImages
// MachineTypes is a list of machine types complete with provider specific information.
MachineTypes []MachineType
}

// DomainCount defines the region and the count for this domain count value.
Expand All @@ -57,4 +59,14 @@ type MachineImageVersion struct {
URN *string
// ID is the Shared Image Gallery image id.
ID *string
// AcceleratedNetworking is an indicator if the image supports Azure accelerated networking.
AcceleratedNetworking *bool
}

// MachineType contains provider specific information to a machine type.
type MachineType struct {
// Name is the name of the machine type.
Name string
// AcceleratedNetworking is an indicator if the machine type supports Azure accelerated networking.
AcceleratedNetworking *bool
}
2 changes: 2 additions & 0 deletions pkg/apis/azure/types_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ type MachineImage struct {
URN *string
// ID is the VM image ID
ID *string
// AcceleratedNetworking is an indicator if the image supports Azure accelerated networking.
AcceleratedNetworking *bool
}
15 changes: 15 additions & 0 deletions pkg/apis/azure/v1alpha1/types_cloudprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type CloudProfileConfig struct {
// MachineImages is the list of machine images that are understood by the controller. It maps
// logical names and versions to provider-specific identifiers.
MachineImages []MachineImages `json:"machineImages"`
// MachineTypes is a list of machine types complete with provider specific information.
// +optional
MachineTypes []MachineType `json:"machineTypes,omitempty"`
}

// DomainCount defines the region and the count for this domain count value.
Expand Down Expand Up @@ -60,4 +63,16 @@ type MachineImageVersion struct {
// ID is the Shared Image Gallery image id.
// +optional
ID *string `json:"id,omitempty"`
// AcceleratedNetworking is an indicator if the image supports Azure accelerated networking.
// +optional
AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"`
}

// MachineType contains provider specific information to a machine type.
type MachineType struct {
// Name is the name of the machine type.
Name string `json:"name"`
// AcceleratedNetworking is an indicator if the machine type supports Azure accelerated networking.
// +optional
AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"`
}
3 changes: 3 additions & 0 deletions pkg/apis/azure/v1alpha1/types_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ type MachineImage struct {
// ID is the VM image ID
// +optional
ID *string `json:"id,omitempty"`
// AcceleratedNetworking is an indicator if the image supports Azure accelerated networking.
// +optional
AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"`
}
Loading

0 comments on commit 554083b

Please sign in to comment.