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,17 +55,84 @@ 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[]
6667
68+ .Read cloudscale region from Project Syn cluster
69+ [source,bash]
70+ ----
71+ export REGION=$(curl -sH "Authorization: Bearer $(commodore fetch-token)" ${COMMODORE_API_URL}/clusters/${CLUSTER_ID} | jq -r .facts.region)
72+ ----
73+
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 details:
128+
129+ Private network UUID: ${NETWORK_UUID}
130+ Subnet UUID: ${SUBNET_UUID}
131+ SNAT VIP: TBD
132+ ---
133+ EOF
134+ ----
135+
67136[#_bootstrap_bucket]
68137=== Set up S3 buckets for the cluster
69138
@@ -253,10 +322,6 @@ vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/cloudscale \
253322 s3_access_key=$(mc config host ls ${CLUSTER_ID} -json | jq -r .accessKey) \
254323 s3_secret_key=$(mc config host ls ${CLUSTER_ID} -json | jq -r .secretKey)
255324
256- # Put LB API key in Vault
257- vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/floaty \
258- iam_secret=${TF_VAR_lb_cloudscale_api_secret}
259-
260325# Generate an HTTP secret for the registry
261326vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/registry \
262327 httpSecret=$(LC_ALL=C tr -cd "A-Za-z0-9" </dev/urandom | head -c 128)
@@ -270,8 +335,6 @@ vault kv put clusters/kv/${TENANT_ID}/${CLUSTER_ID}/cluster-backup \
270335 password=$(LC_ALL=C tr -cd "A-Za-z0-9" </dev/urandom | head -c 32)
271336----
272337
273- include::partial$get-hieradata-token-from-vault.adoc[]
274-
275338include::partial$install/prepare-commodore.adoc[]
276339
277340[#_configure_installer]
@@ -305,53 +368,6 @@ include::partial$cloudscale/configure-terraform-secrets.adoc[]
305368
306369include::partial$setup_terraform.adoc[]
307370
308- . Create LB hieradata
309- +
310- [source,bash]
311- ----
312- cat > override.tf <<EOF
313- module "cluster" {
314- bootstrap_count = 0
315- master_count = 0
316- infra_count = 0
317- worker_count = 0
318- additional_worker_groups = {}
319- }
320- EOF
321- terraform apply -target "module.cluster.module.lb.module.hiera"
322- ----
323-
324- . Review and merge the LB hieradata MR (listed in Terraform output `hieradata_mr`) and wait until the deploy pipeline after the merge is completed.
325-
326- . Create LBs
327- +
328- [source,bash]
329- ----
330- terraform apply
331- ----
332-
333- . Setup the DNS records shown in output variable `dns_entries` from the previous step in the cluster's parent zone.
334- If you use a custom apps domain, make the necessary changes to the DNS record for `*.apps`.
335-
336- . Make LB FQDNs available for later steps
337- +
338- .Store LB FQDNs in environment
339- [source,bash]
340- ----
341- declare -a LB_FQDNS
342- for id in 1 2; do
343- 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')
344- done
345- ----
346- +
347- .Verify FQDNs
348- [source,bash]
349- ----
350- for lb in "${LB_FQDNS[@]}"; do echo $lb; done
351- ----
352-
353- include::partial$install/bootstrap-lb.adoc[]
354-
355371include::partial$install/bootstrap-nodes.adoc[]
356372
357373include::partial$install/finalize_part1.adoc[]
0 commit comments