Skip to content

Commit

Permalink
Specify external network with OPENSTACK_EXTERNAL_NETWORK_ID
Browse files Browse the repository at this point in the history
This allows the e2e tests to run against a cloud with multiple external
networks.
  • Loading branch information
mdbooth committed Sep 1, 2021
1 parent 29180fb commit 91c9183
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/book/src/clusteropenstack/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ When running CAPO with `--v=6` the gophercloud client logs its requests to the O

## External network

External network is automatically found, but you can specify the external network explicitly by `spec.externalNetworkId` of `OpenStackCluster`.
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`.

The public network id can be obtained by using command,

Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-external-cloud-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
nodeCidr: 10.6.0.0/24
dnsNameservers:
- ${OPENSTACK_DNS_NAMESERVERS}
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-without-lb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ spec:
nodeCidr: 10.6.0.0/24
dnsNameservers:
- ${OPENSTACK_DNS_NAMESERVERS}
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
nodeCidr: 10.6.0.0/24
dnsNameservers:
- ${OPENSTACK_DNS_NAMESERVERS}
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
Expand Down
1 change: 1 addition & 0 deletions test/e2e/data/e2e_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ variables:
OPENSTACK_IMAGE_NAME: "ubuntu-2004-kube-v1.18.15"
OPENSTACK_NODE_MACHINE_FLAVOR: "m1.small"
OPENSTACK_SSH_KEY_NAME: "cluster-api-provider-openstack-sigs-k8s-io"
OPENSTACK_EXTERNAL_NETWORK_ID: ""
CONFORMANCE_WORKER_MACHINE_COUNT: "5"
CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT: "1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ spec:
flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR}
image: ${OPENSTACK_BASTION_IMAGE_NAME}
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ spec:
flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR}
image: ${OPENSTACK_BASTION_IMAGE_NAME}
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ spec:
flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR}
image: ${OPENSTACK_BASTION_IMAGE_NAME}
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID}
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
Expand Down

0 comments on commit 91c9183

Please sign in to comment.