Skip to content

Commit 91c9183

Browse files
committed
Specify external network with OPENSTACK_EXTERNAL_NETWORK_ID
This allows the e2e tests to run against a cloud with multiple external networks.
1 parent 29180fb commit 91c9183

File tree

8 files changed

+8
-1
lines changed

8 files changed

+8
-1
lines changed

docs/book/src/clusteropenstack/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ When running CAPO with `--v=6` the gophercloud client logs its requests to the O
133133

134134
## External network
135135

136-
External network is automatically found, but you can specify the external network explicitly by `spec.externalNetworkId` of `OpenStackCluster`.
136+
If there is only a single external network it will be detected automatically. If there is more than one external network you can specify which one the cluster should use by setting the environment variable `OPENSTACK_EXTERNAL_NETWORK_ID`.
137137

138138
The public network id can be obtained by using command,
139139

templates/cluster-template-external-cloud-provider.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ spec:
3131
nodeCidr: 10.6.0.0/24
3232
dnsNameservers:
3333
- ${OPENSTACK_DNS_NAMESERVERS}
34+
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
3435
---
3536
kind: KubeadmControlPlane
3637
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4

templates/cluster-template-without-lb.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ spec:
3030
nodeCidr: 10.6.0.0/24
3131
dnsNameservers:
3232
- ${OPENSTACK_DNS_NAMESERVERS}
33+
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
3334
---
3435
kind: KubeadmControlPlane
3536
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4

templates/cluster-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ spec:
3131
nodeCidr: 10.6.0.0/24
3232
dnsNameservers:
3333
- ${OPENSTACK_DNS_NAMESERVERS}
34+
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
3435
---
3536
kind: KubeadmControlPlane
3637
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4

test/e2e/data/e2e_conf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ variables:
108108
OPENSTACK_IMAGE_NAME: "ubuntu-2004-kube-v1.18.15"
109109
OPENSTACK_NODE_MACHINE_FLAVOR: "m1.small"
110110
OPENSTACK_SSH_KEY_NAME: "cluster-api-provider-openstack-sigs-k8s-io"
111+
OPENSTACK_EXTERNAL_NETWORK_ID: ""
111112
CONFORMANCE_WORKER_MACHINE_COUNT: "5"
112113
CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT: "1"
113114

test/e2e/data/infrastructure-openstack/cluster-template-external-cloud-provider.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ spec:
4040
flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR}
4141
image: ${OPENSTACK_BASTION_IMAGE_NAME}
4242
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
43+
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
4344
---
4445
kind: KubeadmControlPlane
4546
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4

test/e2e/data/infrastructure-openstack/cluster-template-without-lb.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR}
3939
image: ${OPENSTACK_BASTION_IMAGE_NAME}
4040
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
41+
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
4142
---
4243
kind: KubeadmControlPlane
4344
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4

test/e2e/data/infrastructure-openstack/cluster-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ spec:
3939
flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR}
4040
image: ${OPENSTACK_BASTION_IMAGE_NAME}
4141
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
42+
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
4243
---
4344
kind: KubeadmControlPlane
4445
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4

0 commit comments

Comments
 (0)