Class: EksCli::EKS::Cluster
- Inherits:
-
Object
- Object
- EksCli::EKS::Cluster
- Defined in:
- lib/eks_cli/eks/cluster.rb
Instance Method Summary collapse
- #config ⇒ Object
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(cluster_name) ⇒ Cluster
constructor
A new instance of Cluster.
- #services ⇒ Object
- #update_kubeconfig ⇒ Object
Constructor Details
#initialize(cluster_name) ⇒ Cluster
Returns a new instance of Cluster.
12 13 14 |
# File 'lib/eks_cli/eks/cluster.rb', line 12 def initialize(cluster_name) @cluster_name = cluster_name end |
Instance Method Details
#config ⇒ Object
31 |
# File 'lib/eks_cli/eks/cluster.rb', line 31 def config; Config[@cluster_name]; end |
#create ⇒ Object
16 17 18 19 20 21 |
# File 'lib/eks_cli/eks/cluster.rb', line 16 def create Log.info "creating cluster #{@cluster_name}" cf_stack_outputs = CloudFormation::EKS.new(@cluster_name).create config.write(cf_stack_outputs) self end |
#delete ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/eks_cli/eks/cluster.rb', line 23 def delete delete_vpc_peering delete_services delete_nodegroups delete_cf_stack delete_config end |
#services ⇒ Object
38 39 40 |
# File 'lib/eks_cli/eks/cluster.rb', line 38 def services k8s_client.get_services(namespace: "default").select {|s| s[:spec][:type] == "LoadBalancer"} end |