Class: Porkadot::Cmd::Cli
- Inherits:
-
Thor
- Object
- Thor
- Porkadot::Cmd::Cli
- Includes:
- Utils
- Defined in:
- lib/porkadot/cmd/cli.rb
Instance Method Summary collapse
Methods included from Utils
Instance Method Details
#all ⇒ Object
83 84 85 86 |
# File 'lib/porkadot/cmd/cli.rb', line 83 def all invoke :render, [], invoke :install, [], end |
#set_config ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/porkadot/cmd/cli.rb', line 60 def set_config name = config.k8s.cluster_name certs = Porkadot::Assets::Certs.new(config) `kubectl config set-cluster #{name} \ --server=https://#{config.k8s.control_plane_endpoint}` `kubectl config set \ clusters.#{name}.certificate-authority-data \ "#{certs.kubernetes.to_base64(:ca_cert)}"` `kubectl config set-credentials #{name}-admin` `kubectl config set \ users.#{name}-admin.client-certificate-data \ "#{certs.kubernetes.to_base64(:client_cert)}"` `kubectl config set \ users.#{name}-admin.client-key-data \ "#{certs.kubernetes.to_base64(:client_key)}"` `kubectl config set-context #{name} \ --cluster=#{name} \ --user=#{name}-admin` `kubectl config use-context #{name}` end |
#setup_containerd ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/porkadot/cmd/cli.rb', line 23 def setup_containerd logger.info "Setup containerd" kubelets = Porkadot::Install::KubeletList.new(self.config) nodes = [] if node = [:node] nodes = kubelets[node] elsif [:bootstrap] bootstrap = Porkadot::Install::Bootstrap.new(self.config) nodes = bootstrap.host else nodes = kubelets.kubelets.values end kubelets.setup_containerd hosts: nodes, force: [:force] "" end |
#setup_node ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/porkadot/cmd/cli.rb', line 43 def setup_node logger.info "Setup node default" kubelets = Porkadot::Install::KubeletList.new(self.config) nodes = [] if node = [:node] nodes = kubelets[node] elsif [:bootstrap] bootstrap = Porkadot::Install::Bootstrap.new(self.config) nodes = bootstrap.host else nodes = kubelets.kubelets.values end kubelets.setup_default hosts: nodes, force: [:force] "" end |