Ubicni is our CNI plugin for kubernetes that allows intra-cluster network communication within a kubernetes cluster on top of Ubicloud network stack. Co-authored-by: Eren Başak <eren@ubicloud.com> Co-authored-by: mohi-kalantari <mohi.kalantari1@gmail.com>
22 lines
665 B
Ruby
Executable File
22 lines
665 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}"
|
|
|
|
r("sudo /home/ubi/kubernetes/bin/setup-cni")
|