added kured and fixed initial ignition disk partitioning

This commit is contained in:
Karim Naufal
2022-02-07 08:46:10 +01:00
parent 7532e7a4d5
commit fba212de47
13 changed files with 108 additions and 12 deletions

View File

@@ -43,7 +43,7 @@ resource "hcloud_server" "first_control_plane" {
# Wait for MicroOS to reboot and be ready
provisioner "local-exec" {
command = "sleep 60 && ping ${self.ipv4_address} | grep --line-buffered 'bytes from' | head -1 && sleep 30"
command = "sleep 60 && ping ${self.ipv4_address} | grep --line-buffered 'bytes from' | head -1 && sleep 60"
}
# Generating k3s master config file
@@ -87,7 +87,7 @@ resource "hcloud_server" "first_control_plane" {
sleep 30
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${local.ssh_identity_file} root@${self.ipv4_address}:/etc/rancher/k3s/k3s.yaml ${path.module}/kubeconfig.yaml
sed -i -e 's/127.0.0.1/${self.ipv4_address}/g' ${path.module}/kubeconfig.yaml
sleep 30
sleep 10 && until kubectl get node ${self.name}; do sleep 5; done
EOT
}
@@ -102,6 +102,14 @@ resource "hcloud_server" "first_control_plane" {
EOT
}
# Install Kured
provisioner "local-exec" {
command = <<-EOT
set -ex
kubectl -n kube-system apply -k ${dirname(local_file.kured_config.filename)} --kubeconfig ${path.module}/kubeconfig.yaml
EOT
}
# Configure the Traefik ingress controller
provisioner "local-exec" {
command = "kubectl apply -f ${local_file.traefik_config.filename} --kubeconfig ${path.module}/kubeconfig.yaml"