You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/capi/capi.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,8 @@ The `images/capi/packer/config` directory includes several JSON files that defin
38
38
|`packer/config/containerd.json`| The version of containerd to install and customizations specific to the containerd runtime |
39
39
|`packer/config/kubernetes.json`| The version of Kubernetes to install |
40
40
41
+
Due to OS differences, Windows images has additional configuration in the `packer/config/windows` folder. See [Windows documentation](windows/windows.md) for more details.
42
+
41
43
### Customization
42
44
43
45
Several variables can be used to customize the image build.
Copy file name to clipboardExpand all lines: docs/book/src/capi/providers/azure.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Building Images for Azure
2
2
3
+
These images are designed for use with [Cluster API Provider Azure]([Cluster API Provider Azure](https://capz.sigs.k8s.io/introduction.html#what-is-the-cluster-api-provider-azure)) (CAPZ). Learn more on using [custom images with CAPZ](https://capz.sigs.k8s.io/topics/custom-images.html).
4
+
3
5
## Prerequisites for Azure
4
6
5
7
- An Azure account
@@ -22,3 +24,21 @@ From the `images/capi` directory, run `make build-azure-sig-ubuntu-1804`
22
24
### Building VHDs
23
25
24
26
From the `images/capi` directory, run `make build-azure-vhd-ubuntu-1804`
27
+
28
+
> If building the windows images from a Mac there is a known issue with connectivity. Please see details on running [MacOS with ansible](../windows/windows.md#macos-with-ansible).
29
+
30
+
## Developer
31
+
32
+
If you are adding features to image builder than it is sometimes useful to work with the images directly. This section gives some tips.
33
+
34
+
### Provision a VM directly from a VHD
35
+
36
+
After creating a VHD, create a managed image using the url output from `make build-azure-vhd-<image>` and use it to [create the VM](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer#create-a-vm-from-the-packer-image):
37
+
38
+
```bash
39
+
az image create -n testvmimage -g cluster-api-images --os-type <Windows/Linux> --source <storage url for vhd file>
40
+
az vm create -n testvm --image testvmimage -g cluster-api-images
41
+
```
42
+
43
+
### Debugging packer scripts
44
+
There are several ways to debug packer scripts: https://www.packer.io/docs/other/debugging.html
The `images/capi/packer/config/windows` directory includes several JSON files that define the default configuration for the Windows images:
6
+
7
+
| File | Description |
8
+
|------|-------------|
9
+
|`packer/config/windows/ansible-args.json`| A common set of variables that are sent to the Ansible playbook |
10
+
|`packer/config/windows/cloudbase-init.json`| The version of [Cloudbase Init](https://github.com/cloudbase/cloudbase-init) to install |
11
+
|`packer/config/windows/common.json`| Settings for things like which runtime (Docker or Containerd), pause image and other configuration |
12
+
|`packer/config/windows/kubernetes.json`| The version of Kubernetes to install and it's install path |
13
+
|`packer/config/windows/containerd.json`| The version of containerd to install |
14
+
15
+
## Using the Ansible Scripts directly
16
+
17
+
Ansible doesn't run on directly on Windows (wsl works) but can used to configure a remote Windows host. For faster development you can create a VM and run Ansible against the Windows VM directly with out using packer. This document gives the high level steps to use Ansible from Linux machine.
18
+
19
+
## Set up Windows machine
20
+
Follow the documentation for configuring WinRm on the Windows machine: https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html#winrm-setup. Note the [ConfigureRemotingForAnsible.ps1](https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1) is for development only. Refer to [Ansible WinRM documentation](https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html) for details for advance configuration.
21
+
22
+
After WinRM is installed you can edit or `/etc/ansible/hosts` file with the following:
23
+
24
+
```
25
+
[winhost]
26
+
<windows ip>
27
+
28
+
[winhost:vars]
29
+
ansible_user=username
30
+
ansible_password=<your password>
31
+
ansible_connection=winrm
32
+
ansible_winrm_server_cert_validation=ignore
33
+
```
34
+
35
+
Then run: `ansible-playbook -vvv node_windows.yml --extra-vars "@example.vars.yml`
36
+
37
+
## MacOS with ansible
38
+
The Winrm connection plugin for Ansible on MacOS causes connection issues which can result in `ERROR! A worker was found in a dead state`. See https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html#what-is-winrm for more details.
39
+
40
+
To fix the issue on MacOS is to set the no_proxy environment variable. Example:
cmd.exe/c winrm set "winrm/config"'@{MaxTimeoutms="1800000"}'
37
+
cmd.exe/c winrm set "winrm/config/winrs"'@{MaxMemoryPerShellMB="1024"}'
38
+
cmd.exe/c winrm set "winrm/config/service"'@{AllowUnencrypted="true"}'
39
+
cmd.exe/c winrm set "winrm/config/client"'@{AllowUnencrypted="true"}'
40
+
cmd.exe/c winrm set "winrm/config/service/auth"'@{Basic="true"}'
41
+
cmd.exe/c winrm set "winrm/config/client/auth"'@{Basic="true"}'
42
+
cmd.exe/c winrm set "winrm/config/service/auth"'@{CredSSP="true"}'
43
+
cmd.exe/c winrm set "winrm/config/listener?Address=*+Transport=HTTPS""@{Port=`"5986`";Hostname=`"packer`";CertificateThumbprint=`"$($Cert.Thumbprint)`"}"
44
+
cmd.exe/c netsh advfirewall firewall set rule group="remote administration" new enable=yes
0 commit comments