Skip to content

Commit

Permalink
Merge pull request #681 from kkeshavamurthy/kk-azure-nw
Browse files Browse the repository at this point in the history
Support building Azure images using custom networks
  • Loading branch information
k8s-ci-robot authored Aug 20, 2021
2 parents 30f5e71 + 23189a1 commit 7cd6d9a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/book/src/capi/providers/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ make build-azure-sig-ubuntu-1804-gen2

Generation 2 images may only be used with Shared Image Gallery, not VHD.

### Configuration
#### Common Azure options

This table lists several common options that a user may want to set via
`PACKER_VAR_FILES` to customize their build behavior. This is not an exhaustive
list, and greater explanation can be found in the
[Packer documentation for the Azure ARM builder](https://www.packer.io/docs/builders/azure/arm).

| Variable | Description | Default |
|----------|-------------|---------|
| `private_virtual_network_with_public_ip` | This value allows you to set a virtual_network_name and obtain a public IP. If this value is not set and virtual_network_name is defined Packer is only allowed to be executed from a host on the same subnet / virtual network. | `""` |
| `virtual_network_name` | Use a pre-existing virtual network for the VM. This option enables private communication with the VM, no public IP address is used or provisioned (unless you set private_virtual_network_with_public_ip). | `""` |
| `virtual_network_resource_group_name` | If virtual_network_name is set, this value may also be set. If virtual_network_name is set, and this value is not set the builder attempts to determine the subnet to use with the virtual network. If the subnet cannot be found, or it cannot be disambiguated, this value should be set. | `""` |
| `virtual_network_subnet_name` | If virtual_network_name is set, this value may also be set. If virtual_network_name is set, and this value is not set the builder attempts to determine the resource group containing the virtual network. If the resource group cannot be found, or it cannot be disambiguated, this value should be set.. | `""` |

## Developer

If you are adding features to image builder than it is sometimes useful to work with the images directly. This section gives some tips.
Expand Down
8 changes: 8 additions & 0 deletions images/capi/packer/azure/packer-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
"location": "{{user `azure_location`}}",
"name": "vhd-{{user `build_name`}}",
"os_type": "Windows",
"private_virtual_network_with_public_ip": "{{user `private_virtual_network_with_public_ip`}}",
"resource_group_name": "{{user `resource_group_name`}}",
"storage_account": "{{user `storage_account_name`}}",
"subscription_id": "{{user `subscription_id`}}",
"type": "azure-arm",
"virtual_network_name": "{{user `virtual_network_name`}}",
"virtual_network_resource_group_name": "{{user `virtual_network_resource_group_name`}}",
"virtual_network_subnet_name": "{{user `virtual_network_subnet_name`}}",
"vm_size": "{{user `vm_size`}}",
"winrm_insecure": true,
"winrm_timeout": "10m",
Expand Down Expand Up @@ -185,7 +189,11 @@
"manifest_output": "manifest.json",
"nssm_url": null,
"prepull": null,
"private_virtual_network_with_public_ip": "",
"subscription_id": null,
"virtual_network_name": "",
"virtual_network_resource_group_name": "",
"virtual_network_subnet_name": "",
"vm_size": "",
"windows_service_manager": null,
"windows_updates_kbs": null,
Expand Down
8 changes: 8 additions & 0 deletions images/capi/packer/azure/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
"location": "{{user `azure_location`}}",
"name": "vhd-{{user `build_name`}}",
"os_type": "Linux",
"private_virtual_network_with_public_ip": "{{user `private_virtual_network_with_public_ip`}}",
"resource_group_name": "{{user `resource_group_name`}}",
"ssh_username": "packer",
"storage_account": "{{user `storage_account_name`}}",
"subscription_id": "{{user `subscription_id`}}",
"type": "azure-arm",
"virtual_network_name": "{{user `virtual_network_name`}}",
"virtual_network_resource_group_name": "{{user `virtual_network_resource_group_name`}}",
"virtual_network_subnet_name": "{{user `virtual_network_subnet_name`}}",
"vm_size": "{{user `vm_size`}}"
},
{
Expand Down Expand Up @@ -190,7 +194,11 @@
"kubernetes_series": null,
"kubernetes_source_type": null,
"manifest_output": "manifest.json",
"private_virtual_network_with_public_ip": "",
"subscription_id": null,
"virtual_network_name": "",
"virtual_network_resource_group_name": "",
"virtual_network_subnet_name": "",
"vm_size": ""
}
}

0 comments on commit 7cd6d9a

Please sign in to comment.