33:k8s-minor-version: 1.31
44:ocp-patch-version: {ocp-minor-version}.1
55:provider: cloudscale
6+ :needs_hieradata_edit: no
67
78[abstract]
89--
@@ -40,6 +41,7 @@ include::partial$install/prerequisites.adoc[]
4041* `mc` >= `RELEASE.2021-07-27T06-46-19Z` https://docs.min.io/docs/minio-client-quickstart-guide.html[Minio client] (aliased to `mc` if necessary)
4142* `aws` CLI https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html[Official install instructions].
4243You can also install the Python package with your favorite package manager (we recommend https://docs.astral.sh/uv/[`uv`]: `uv tool install awscli`).
44+ * `python3` as `python`
4345
4446
4547[WARNING]
@@ -53,13 +55,12 @@ include::partial$install/register.adoc[]
5355
5456=== Configure input
5557
56- Create 2 new cloudscale API tokens with read+write permissions and name them *`<cluster_id>`* and *`<cluster_id>_floaty `* on https://control.cloudscale.ch/service/<your-project>/api-token.
58+ Create a new cloudscale API token with read+write permissions and name *`<cluster_id>`* on https://control.cloudscale.ch/service/<your-project>/api-token.
5759
5860.Access to cloud API
5961[source,bash]
6062----
6163export CLOUDSCALE_API_TOKEN=<cloudscale-api-token>
62- export TF_VAR_lb_cloudscale_api_secret=<cloudscale-api-token-for-Floaty>
6364----
6465
6566include::partial$install/vshn-input.adoc[]
@@ -70,6 +71,68 @@ include::partial$install/vshn-input.adoc[]
7071export REGION=$(curl -sH "Authorization: Bearer $(commodore fetch-token)" ${COMMODORE_API_URL}/clusters/${CLUSTER_ID} | jq -r .facts.region)
7172----
7273
74+ === Create private network and subnet
75+
76+ . Create a private network via cloudscale API
77+ +
78+ [source,bash]
79+ ----
80+ response=$(curl -sH"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
81+ https://api.cloudscale.ch/v1/networks \
82+ -F name="privnet_${CLUSTER_ID}" \
83+ -F zone="${REGION}1" \
84+ -F mtu=9000 \
85+ -F auto_create_ipv4_subnet=false)
86+ export NETWORK_UUID=$(echo "$response" | jq -r '.uuid')
87+ ----
88+
89+ . Create a subnet in the private network via cloudscale API
90+ +
91+ [TIP]
92+ ====
93+ Customize `PRIVNET_CIDR` if you want to use a different CIDR for the cluster.
94+
95+ Use a custom value for `GATEWAY_ADDR` if you don't want to use `.1` in the configured network CIDR for the default gateway.
96+ ====
97+ +
98+ [source,bash]
99+ ----
100+ PRIVNET_CIDR="172.18.200.0/24"
101+
102+ GATEWAY_ADDR=$(python -c \
103+ "import ipaddress; print(next(ipaddress.ip_network(\"${PRIVNET_CIDR}\").hosts()))")
104+
105+ response=$(curl -sH"Authorization: Bearer ${CLOUDSCALE_API_TOKEN}" \
106+ https://api.cloudscale.ch/v1/subnets \
107+ -F network="${NETWORK_UUID}" \
108+ -F cidr="${PRIVNET_CIDR}" \
109+ -F gateway_address="${GATEWAY_ADDR}")
110+ export SUBNET_UUID=$(echo "$response" | jq -r '.uuid')
111+ ----
112+
113+ . Create a floating IP to use as the NAT source IP via cloudscale API
114+ +
115+ [source,bash]
116+ ----
117+ TBD if actually possible
118+ ----
119+
120+ . Ask cloudscale to provision a NAT gateway via chat.
121+ Run the command and provide the output with your request.
122+ +
123+ [source]
124+ ----
125+ cat <<EOF
126+ ---
127+ Network UUID: ${NETWORK_UUID}
128+ Subnet UUID: ${SUBNET_UUID}
129+ Nat Gateway Name: natgw_${CLUSTER_ID}
130+ Gateway IP: ${GATEWAY_ADDR}
131+ NAT source IP: TBD if possible
132+ ---
133+ EOF
134+ ----
135+
73136[#_bootstrap_bucket]
74137=== Set up S3 buckets for the cluster
75138
@@ -257,10 +320,6 @@ vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/cloudscale \
257320 s3_access_key=$(mc config host ls ${CLUSTER_ID} -json | jq -r .accessKey) \
258321 s3_secret_key=$(mc config host ls ${CLUSTER_ID} -json | jq -r .secretKey)
259322
260- # Put LB API key in Vault
261- vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/floaty \
262- iam_secret=${TF_VAR_lb_cloudscale_api_secret}
263-
264323# Generate an HTTP secret for the registry
265324vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/registry \
266325 httpSecret=$(LC_ALL=C tr -cd "A-Za-z0-9" </dev/urandom | head -c 128)
@@ -274,8 +333,6 @@ vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/cluster-backup \
274333 password=$(LC_ALL=C tr -cd "A-Za-z0-9" </dev/urandom | head -c 32)
275334----
276335
277- include::partial$get-hieradata-token-from-vault.adoc[]
278-
279336include::partial$install/prepare-commodore.adoc[]
280337
281338[#_configure_installer]
@@ -309,53 +366,6 @@ include::partial$cloudscale/configure-terraform-secrets.adoc[]
309366
310367include::partial$setup_terraform.adoc[]
311368
312- . Create LB hieradata
313- +
314- [source,bash]
315- ----
316- cat > override.tf <<EOF
317- module "cluster" {
318- bootstrap_count = 0
319- master_count = 0
320- infra_count = 0
321- worker_count = 0
322- additional_worker_groups = {}
323- }
324- EOF
325- terraform apply -target "module.cluster.module.lb.module.hiera"
326- ----
327-
328- . Review and merge the LB hieradata MR (listed in Terraform output `hieradata_mr`) and wait until the deploy pipeline after the merge is completed.
329-
330- . Create LBs
331- +
332- [source,bash]
333- ----
334- terraform apply
335- ----
336-
337- . Setup the DNS records shown in output variable `dns_entries` from the previous step in the cluster's parent zone.
338- If you use a custom apps domain, make the necessary changes to the DNS record for `*.apps`.
339-
340- . Make LB FQDNs available for later steps
341- +
342- .Store LB FQDNs in environment
343- [source,bash]
344- ----
345- declare -a LB_FQDNS
346- for id in 1 2; do
347- LB_FQDNS[$id]=$(terraform state show "module.cluster.module.lb.cloudscale_server.lb[$(expr $id - 1)]" | grep fqdn | awk '{print $2}' | tr -d ' "\r\n')
348- done
349- ----
350- +
351- .Verify FQDNs
352- [source,bash]
353- ----
354- for lb in "${LB_FQDNS[@]}"; do echo $lb; done
355- ----
356-
357- include::partial$install/bootstrap-lb.adoc[]
358-
359369include::partial$install/bootstrap-nodes.adoc[]
360370
361371include::partial$install/finalize_part1.adoc[]
0 commit comments