diff --git a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template index f78c925ba30..c8622a1d4b6 100755 --- a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template +++ b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template @@ -33,6 +33,12 @@ OPENSHIFT_HYPERSHIFT_IMAGE=$(podman run --quiet --rm ${release} image hypershift OPENSHIFT_HYPERKUBE_IMAGE=$(podman run --quiet --rm ${release} image hyperkube) CLUSTER_BOOTSTRAP_IMAGE=$(podman run --quiet --rm ${release} image cluster-bootstrap) +KEEPALIVED_IMAGE=$(podman run --quiet --rm ${release} image keepalived-ipfailover) +COREDNS_IMAGE=$(podman run --quiet --rm ${release} image coredns) +MDNS_PUBLISHER_IMAGE=$(podman run --quiet --rm ${release} image mdns-publisher) +HAPROXY_IMAGE=$(podman run --quiet --rm ${release} image haproxy-router) +RUNTIMECFG_IMAGE=$(podman run --quiet --rm ${release} image baremetal-runtimecfg) + # Now, as early as possible we replace the pause image and reload crio to use it, to ensure # that we're using the pause image from our payload just like the primary cluster. @@ -194,17 +200,30 @@ then --machine-config-operator-image=${MACHINE_CONFIG_OPERATOR_IMAGE} \ --machine-config-oscontent-image=${MACHINE_CONFIG_OSCONTENT} \ --infra-image=${MACHINE_CONFIG_INFRA_IMAGE} \ + --keepalived-image=${KEEPALIVED_IMAGE} \ + --coredns-image=${COREDNS_IMAGE} \ + --mdns-publisher-image=${MDNS_PUBLISHER_IMAGE} \ + --haproxy-image=${HAPROXY_IMAGE} \ + --baremetal-runtimecfg-image=${RUNTIMECFG_IMAGE} \ --cloud-config-file=/assets/manifests/cloud-provider-config.yaml # Bootstrap MachineConfigController uses /etc/mcc/bootstrap/manifests/ dir to # 1. read the controller config rendered by MachineConfigOperator # 2. read the default MachineConfigPools rendered by MachineConfigOperator # 3. read any additional MachineConfigs that are needed for the default MachineConfigPools. - mkdir --parents /etc/mcc/bootstrap /etc/mcs/bootstrap /etc/kubernetes/manifests + mkdir --parents /etc/mcc/bootstrap /etc/mcs/bootstrap /etc/kubernetes/manifests /etc/kubernetes/static-pod-resources cp mco-bootstrap/bootstrap/manifests/* /etc/mcc/bootstrap/ cp openshift/* /etc/mcc/bootstrap/ cp auth/kubeconfig-kubelet /etc/mcs/kubeconfig cp mco-bootstrap/bootstrap/machineconfigoperator-bootstrap-pod.yaml /etc/kubernetes/manifests/ + if [ -d mco-bootstrap/baremetal/manifests ]; then + cp mco-bootstrap/baremetal/manifests/* /etc/kubernetes/manifests/ + cp -r mco-bootstrap/baremetal/static-pod-resources/* /etc/kubernetes/static-pod-resources/ + fi + if [ -d mco-bootstrap/openstack/manifests ]; then + cp mco-bootstrap/openstack/manifests/* /etc/kubernetes/manifests/ + cp -r mco-bootstrap/openstack/static-pod-resources/* /etc/kubernetes/static-pod-resources/ + fi cp mco-bootstrap/manifests/* manifests/ # /etc/ssl/mcs/tls.{crt, key} are locations for MachineConfigServer's tls assets. diff --git a/data/data/openstack/bootstrap/main.tf b/data/data/openstack/bootstrap/main.tf index 7c456c2a1fe..cac46a4ed44 100644 --- a/data/data/openstack/bootstrap/main.tf +++ b/data/data/openstack/bootstrap/main.tf @@ -18,40 +18,46 @@ data "ignition_config" "redirect" { files = [ data.ignition_file.hostname.id, - data.ignition_file.bootstrap_ifcfg.id, + data.ignition_file.dns_conf.id, + data.ignition_file.dhcp_conf.id, ] } -data "ignition_file" "bootstrap_ifcfg" { +data "ignition_file" "dhcp_conf" { filesystem = "root" - mode = "420" // 0644 - path = "/etc/sysconfig/network-scripts/ifcfg-eth0" + mode = "420" + path = "/etc/NetworkManager/conf.d/dhcp-client.conf" content { content = < /etc/haproxy/haproxy.cfg.new << EOF -listen ${var.cluster_id}-api-masters - bind 0.0.0.0:6443 - bind 0.0.0.0:22623 - mode tcp - balance roundrobin - server bootstrap-22623 ${var.bootstrap_ip} check port 22623 - server bootstrap-6443 ${var.bootstrap_ip} check port 6443 - ${replace(join("\n ", formatlist("server master-%s %s check port 6443", var.master_port_names, var.master_ips)), "master-port-", "")} -EOF - update_cfg_and_restart - exit 0 -fi - -for master in $MASTERS; -do - MASTER_LINES="$MASTER_LINES - server $master $master check port 6443" -done - -for worker in $WORKERS; -do - WORKER_LINES="$WORKER_LINES - server $worker $worker check port 443" -done - -cat > /etc/haproxy/haproxy.cfg.new << EOF -listen ${var.cluster_id}-api-masters - bind 0.0.0.0:6443 - bind 0.0.0.0:22623 - mode tcp - balance roundrobin$MASTER_LINES - -listen ${var.cluster_id}-api-workers - bind 0.0.0.0:80 - bind 0.0.0.0:443 - mode tcp - balance roundrobin$WORKER_LINES -EOF - -update_cfg_and_restart -TFEOF - -} -} - -data "ignition_file" "corefile" { - filesystem = "root" - mode = "420" // 0644 - path = "/etc/coredns/Corefile" - - content { - content = <