Files
ubicloud/rhizome/kubernetes/bin/join-control-plane-node
Eren Başak e6711245c0 Introduce Kubernetes Cluster Provisioning Logic
In this commit, we introduce two progs to provision a k8s cluster.

KubernetesClusterNexus.assemble call creates a KubernetesCluster object
and manages the creation of control plane nodes using the
ProvisionKubernetesNode prog.

Nodes are created from plain images and k8s components are installed during
the provisioning, increasing the time to provision. Later, we will switch to
dedicated VM images.

Co-authored-by: Eren Başak <eren@ubicloud.com>
Co-authored-by: mohi-kalantari <mohi.kalantari1@gmail.com>
2025-01-28 09:59:38 +02:00

20 lines
619 B
Ruby
Executable File

#!/bin/env ruby
# frozen_string_literal: true
require "json"
require_relative "../../common/lib/util"
params = JSON.parse($stdin.read)
begin
cluster_endpoint = params.fetch("cluster_endpoint")
join_token = params.fetch("join_token")
discovery_token_ca_cert_hash = params.fetch("discovery_token_ca_cert_hash")
certificate_key = params.fetch("certificate_key")
rescue KeyError => e
puts "Needed #{e.key} in parameters"
exit 1
end
r "kubeadm join #{cluster_endpoint} --control-plane --token #{join_token} --discovery-token-ca-cert-hash #{discovery_token_ca_cert_hash} --certificate-key #{certificate_key}"