Skip to content

Commit c01d084

Browse files
committed
gcve: extend dhcp range and change boskos userdata ip range
1 parent a982da8 commit c01d084

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

infra/gcp/terraform/k8s-infra-gcp-gcve/vsphere/nsx-t.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ resource "nsxt_policy_segment" "k8s-ci" {
4343

4444
subnet {
4545
cidr = "192.168.32.1/21"
46-
dhcp_ranges = ["192.168.32.10-192.168.32.255"]
46+
dhcp_ranges = ["192.168.32.10-192.168.33.255"]
4747

4848
dhcp_v4_config {
4949
server_address = "192.168.32.2/21"

infra/gcp/terraform/k8s-infra-gcp-gcve/vsphere/scripts/boskos-userdata.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,28 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
# The network used is 192.168.0.32/21
18+
# Usable Host IP Range: 192.168.32.1 - 192.168.39.254:
19+
# DHCP Range: 192.168.32.10 - 192.168.33.255
20+
# Used IPPool for 40 Projects having 16 IPs each: 192.168.35.0 - 192.168.37.127
1721
function printProjectUserData() {
1822
NR="${1}"
1923

20-
S2="$(($(($((NR-1))*16))))"
21-
E2="$(($((NR*16))-1))"
24+
IPS_PER_PROJECT=16
25+
# Starting at 192.168.35.0 and allowing usage up to 192.168.39.254
26+
# allows a maximum of 79 projects
27+
RANGE_START=35
2228

23-
S1="$((S2/256))"
24-
E1="$((E2/256))"
25-
S2="$((S2%256))"
26-
E2="$((E2%256))"
29+
S2="$(( (NR - 1) * IPS_PER_PROJECT ))"
30+
E2="$(( (NR * IPS_PER_PROJECT) - 1 ))"
2731

28-
START="192.168.$((33+S1)).${S2}"
29-
END="192.168.$((33+E1)).${E2}"
32+
S1="$(( S2 / 256 ))"
33+
E1="$(( E2 / 256 ))"
34+
S2="$(( S2 % 256 ))"
35+
E2="$(( E2 % 256 ))"
36+
37+
START="192.168.$(( RANGE_START + S1 )).${S2}"
38+
END="192.168.$(( RANGE_START + E1 )).${E2}"
3039

3140
printf "k8s-infra-e2e-gcp-gcve-project-%03d:\n" "${NR}"
3241
printf " folder: /Datacenter/vm/prow/k8s-infra-e2e-gcp-gcve-project-%03d\n" "${NR}"

0 commit comments

Comments
 (0)