21 lines
536 B
Ruby
Executable File
21 lines
536 B
Ruby
Executable File
#!/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require "json"
|
|
require_relative "../../common/lib/util"
|
|
|
|
params = JSON.parse($stdin.read)
|
|
|
|
begin
|
|
endpoint = params.fetch("endpoint")
|
|
join_token = params.fetch("join_token")
|
|
discovery_token_ca_cert_hash = params.fetch("discovery_token_ca_cert_hash")
|
|
rescue KeyError => e
|
|
puts "Needed #{e.key} in parameters"
|
|
exit 1
|
|
end
|
|
|
|
r "kubeadm join #{endpoint} --token #{join_token} --discovery-token-ca-cert-hash #{discovery_token_ca_cert_hash}"
|
|
|
|
r("sudo /home/ubi/kubernetes/bin/setup-cni")
|