Skip to content

Commit

Permalink
Update Cloudscale install documentation to enable machine-api provider
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyTetrahedron committed Nov 15, 2024
1 parent a96ea70 commit b29884f
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 9 deletions.
79 changes: 70 additions & 9 deletions docs/modules/ROOT/partials/install/bootstrap-nodes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,32 @@ terraform apply

ifeval::["{provider}" == "cloudscale"]
. Add the DNS records for etcd shown in output variable `dns_entries` from the previous step to the cluster's parent zone

. Apply the manifests for the cloudscale machine-api provider
+
[source,bash,subs="attributes+"]
----
cat ../machine-api-provider-cloudscale/00_secrets.yaml | yq '(select(document_index==0) | .stringData.token) = "'$(vault kv get -format=json clusters/kv/${TENANT_ID}/${CLUSTER_ID}/cloudscale/ | jq -r .data.data.token)'" ' | kubectl apply -f -
kubectl apply -f ../machine-api-provider-cloudscale/10_clusterRoleBinding.yaml
kubectl apply -f ../machine-api-provider-cloudscale/10_serviceAccount.yaml
kubectl apply -f ../machine-api-provider-cloudscale/11_deployment.yaml
----
. Apply the machinesets from terraform
+
[source,bash,subs="attributes+"]
----
terraform output -raw worker-machineset_yml | grep -vP '^(│|╵|╷|There are some problems with the CLI configuration)' | yq -P > worker-machineset.yml
head worker-machineset.yml
kubectl apply -f worker-machineset.yml

terraform output -raw infra-machineset_yml | grep -vP '^(│|╵|╷|There are some problems with the CLI configuration)' | yq -P > infra-machineset.yml
head infra-machineset.yml
kubectl apply -f infra-machineset.yml
----
endif::[]

. Wait for bootstrap to complete
Expand All @@ -122,16 +148,58 @@ kubectl taint no -l node-role.kubernetes.io/master node.cloudprovider.kubernetes
----
--

ifeval::["{provider}" != "cloudscale"]
. Remove bootstrap node and provision remaining nodes
+
[source,bash,subs="attributes+"]
----
rm override.tf
terraform apply

popd
----
endif::[]
ifeval::["{provider}" == "cloudscale"]
. Remove bootstrap node
+
[source,bash,subs="attributes+"]
----
cat > override.tf <<EOF
module "cluster" {
infra_count = 0
worker_count = 0
additional_worker_groups = {}
}
EOF
terraform apply

popd
----

. Review and merge the LB hieradata MR (listed in Terraform output `hieradata_mr`) and run Puppet on the LBs after the deploy job has completed
+
[source,bash]
----
for fqdn in "${LB_FQDNS[@]}"; do
ssh "${fqdn}" sudo puppetctl run
done
----

. Scale up the infra and worker machinesets
+
[source,bash]
----
INFRA_NODES=3 # adjust to desired number of infra nodes
WORKER_NODES=3 # adjust to desired number of worker nodes
----
+
[source,bash]
----
kubectl scale machineset -nopenshift-machine-api infra --replicas="${INFRA_NODES}"
kubectl scale machineset -nopenshift-machine-api worker --replicas="${WORKER_NODES}"
----
endif::[]

. Disable OpenShift kube-proxy deployment and revert Cilium patch
+
[source,bash]
Expand All @@ -146,15 +214,7 @@ done && echo -e "\nCilium config updated"
kubectl -n cilium rollout restart ds/cilium
----

. Review and merge the LB hieradata MR (listed in Terraform output `hieradata_mr`) and run Puppet on the LBs after the deploy job has completed
+
[source,bash]
----
for fqdn in "${LB_FQDNS[@]}"; do
ssh "${fqdn}" sudo puppetctl run
done
----

ifeval::["{provider}" != "cloudscale"]
. Approve node certs
+
include::partial$install/approve-node-csrs.adoc[]
Expand Down Expand Up @@ -185,6 +245,7 @@ kubectl get node -ojson | \
+
[NOTE]
At this point you may want to add extra labels to the additional worker groups, if there are any.
endif::[]

. Enable proxy protocol on ingress controller
+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ifeval::["{provider}" == "cloudscale"]
. Prepare cloudscale machine-api provider
+
[source,bash,subs="attributes+"]
----
yq -i '.applications += "machine-api-provider-cloudscale"' \
${CLUSTER_ID}.yml
yq eval -i ".parameters.openshift4_terraform.terraform_variables.make_worker_adoptable_by_provider = true" \
${CLUSTER_ID}.yml
yq eval -i '.parameters.machine_api_provider_cloudscale.secrets["cloudscale-user-data"].stringData.ignitionCA = "${openshift4_terraform:terraform_variables:ignition_ca}"' \
${CLUSTER_ID}.yml
----
endif::[]
4 changes: 4 additions & 0 deletions docs/modules/ROOT/partials/install/prepare-syn-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ yq eval -i ".parameters.openshift4_version.spec.channel = \"fast-{ocp-minor-vers

ifeval::["{provider}" == "cloudscale"]
:is-terraform: yes
:use-machine-api: yes
endif::[]
ifeval::["{provider}" == "exoscale"]
:is-terraform: yes
Expand All @@ -70,6 +71,9 @@ endif::[]
ifeval::["{is-terraform}" == "yes"]
include::partial$install/prepare-syn-config-terraform.adoc[]
endif::[]
ifeval::["{use-machine-api}" == "yes"]
include::partial$install/prepare-syn-config-machine-api.adoc[]
endif::[]
ifeval::["{provider}" == "vsphere"]
include::partial$install/prepare-syn-config-vsphere.adoc[]
endif::[]
Expand Down

0 comments on commit b29884f

Please sign in to comment.