/
usecases.go
66 lines (56 loc) · 2.47 KB
/
usecases.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package usecases
import "net"
const (
outputDir = "services/kuber/server/clusters"
)
type Usecases struct{}
type (
// IPPair contains pair of public and private IP for a single node.
IPPair struct {
// PublicIP describes public IP.
PublicIP net.IP `json:"public_ip"`
// PrivateIP describes private IP.
PrivateIP net.IP `json:"private_ip"`
}
// StaticNodeInfo contains metadata info about static node.
StaticNodeInfo struct {
// Endpoint is an endpoint for static nodes in the static node pool.
Endpoint string `json:"endpoint"`
// PrivateKey is the private SSH key for the node.
PrivateKey string `json:"node_private_key"`
}
// ClusterMetadata contains metadata for the whole cluster. This metadata will be exported as a secret in management cluster.
ClusterMetadata struct {
// DynamicNodepools contains metadata for dynamic nodepools.
DynamicNodepools DynamicNodepool `json:"dynamic_nodepools"`
// PrivateKey is the private SSH key for the dynamic nodes.
PrivateKey string `json:"cluster_private_key"`
// StaticNodepools contains metadata for static nodepools.
StaticNodepools StaticNodepool `json:"static_nodepools"`
// DynamicLoadBalancerNodePools contain metadata for dynamic lb nodepools.
DynamicLoadBalancerNodePools map[string]DynamicLoadBalancerNodePools `json:"dynamic_load_balancer_nodepools"`
// StaticLoadBalancerNodePools contain metadata for static lb nodepools.
StaticLoadBalancerNodePools map[string]StaticLoadBalancerNodePools `json:"static_load_balancer_nodepools"`
}
// DynamicNodepool contains map of node names and their IP pair.
DynamicNodepool struct {
// NodeIps maps node-name to public-private ip pairs for dynamic node pools.
NodeIps map[string]IPPair `json:"node_ips"`
}
// StaticNodepool contains map of node names and their static metadata.
StaticNodepool struct {
// NodeIps maps node-name to endpoint-key pairs for static node pools.
NodeInfo map[string]StaticNodeInfo `json:"node_info"`
}
DynamicLoadBalancerNodePools struct {
// NodeIps maps node-name to public-private ip pairs for dynamic node pools.
NodeIps map[string]IPPair `json:"node_ips"`
// PrivateKey is the private SSH key for the dynamic nodes.
PrivateKey string `json:"cluster_private_key"`
}
// StaticLoadBalancerNodePools contains map of LB node names and their static metadata
StaticLoadBalancerNodePools struct {
// NodeIps maps node-name to endpoint-key pairs for static node pools.
NodeInfo map[string]StaticNodeInfo `json:"node_info"`
}
)