-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd_node_example.go
42 lines (37 loc) · 874 Bytes
/
add_node_example.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Package examples for adding nodes
package examples
import (
"log"
"github.com/debarshibasak/go-kubeadmclient/kubeadmclient"
)
// This is an example for adding node.
// In HA or no HA setup, you have to mention atleast one Master machine and the list of new nodes that have to be added
func AddNodeExample() {
//Create clusters with only master machine
k := kubeadmclient.Kubeadm{
MasterNodes: []*kubeadmclient.MasterNode{
kubeadmclient.NewMasterNode(
"ubuntu",
"192.168.64.51",
"/Users//.ssh/id_rsa",
),
},
WorkerNodes: []*kubeadmclient.WorkerNode{
kubeadmclient.NewWorkerNode(
"ubuntu",
"192.168.64.55",
"/Users//.ssh/id_rsa",
),
kubeadmclient.NewWorkerNode(
"ubuntu",
"192.168.64.56",
"/Users//.ssh/id_rsa",
),
},
VerboseMode: false,
}
err := k.AddNode()
if err != nil {
log.Fatal(err)
}
}