Install ocp4 UPI cluster on hetzner cloud with Ansible
# pip3 install ansible hcloud
- Create ssh-key
# ssh-keygen -f auth/ssh-key -t ed25519
- Create auth/hcloud.yml
plugin: hcloud
keyed_groups:
- key: labels
prefix: label
token: <your hetzner token>
pull_secret: '<your pull_secret>'
ssh_pub_key: '<your ssh_pub_key>'
base_domain: <your base domain>
cluster_name: <your cluster name>
- Choose your type of cluster in inventory and set it in playbooks/manage_cluster.yml
# ansible-playbook playbooks/manage_cluster.yml -i auth/hcloud.yml
# ansible-playbook playbooks/fileserver.yml -i auth/hcloud.yml
ssh -i auth/ssh-key root@<fileserver-ip>
If you want to modify your install-config.yaml you can do it now.
# ./create_ignites.sh
# ansible-playbook playbooks/restart-rescue.yml -i auth/hcloud.yml
# ansible-playbook playbooks/openshift4.yml -i auth/hcloud.yml
api; api-int; *.apps
api.<cluster_name>.<base_domain> A <lb-ocp4-api IP> ttl 1min
api-int.<cluster_name>.<base_domain> A <lb-ocp4-api IP> ttl 1min
*.apps.<cluster_name>.<base_domain> A <lb-ocp4-apps IP> ttl 1min
# ansible-playbook playbooks/restart-hosts.yml -i auth/hcloud.yml
# ansible-playbook playbooks/manage_cluster.yml -i auth/hcloud.yml --extra-vars "state_bootstrap=absent"
ssh -i auth/ssh-key root@<fileserver-ip>
tip: when the workers are not activated, this could be the issue.
# export KUBECONFIG=/root/<cluster_name>/auth/kubeconfig
# oc get csr
# oc get csr -o name | xargs oc adm certificate approve
# oc patch etcd cluster -p='{"spec": {"unsupportedConfigOverrides": {"useUnsupportedUnsafeNonHANonProductionUnstableEtcd": true}}}' --type=merge
# oc patch authentications.operator.openshift.io cluster -p='{"spec": {"unsupportedConfigOverrides": {"useUnsupportedUnsafeNonHANonProductionUnstableOAuthServer": true}}}' --type=merge
Be sure that 'kube-system' is the current project
oc project kube-system
oc apply -f https://raw.githubusercontent.com/buuhsmead/csi-driver/master/deploy/kubernetes/hcloud-csi-openshift-1.5.1.yml
The driver provided with hetzner was not able to run under 4.6.3/4.6.4 https://github.com/hetznercloud/csi-driver