-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathinstallconfig.go
113 lines (90 loc) · 3.2 KB
/
installconfig.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package types
import (
"net"
"github.com/openshift/installer/pkg/ipnet"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// InstallConfig is the configuration for an OpenShift install.
type InstallConfig struct {
// +optional
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
// ClusterID is the ID of the cluster.
ClusterID string `json:"clusterID"`
// Admin is the configuration for the admin user.
Admin Admin `json:"admin"`
// BaseDomain is the base domain to which the cluster should belong.
BaseDomain string `json:"baseDomain"`
// Networking defines the pod network provider in the cluster.
Networking `json:"networking"`
// Machines is the list of MachinePools that need to be installed.
Machines []MachinePool `json:"machines"`
// Platform is the configuration for the specific platform upon which to
// perform the installation.
Platform `json:"platform"`
// PullSecret is the secret to use when pulling images.
PullSecret string `json:"pullSecret"`
}
// Admin is the configuration for the admin user.
type Admin struct {
// Email is the email address of the admin user.
Email string `json:"email"`
// Password is the password of the admin user.
Password string `json:"password"`
// SSHKey to use for the access to compute instances.
SSHKey string `json:"sshKey,omitempty"`
}
// Platform is the configuration for the specific platform upon which to perform
// the installation. Only one of the platform configuration should be set.
type Platform struct {
// AWS is the configuration used when installing on AWS.
AWS *AWSPlatform `json:"aws,omitempty"`
// Libvirt is the configuration used when installing on libvirt.
Libvirt *LibvirtPlatform `json:"libvirt,omitempty"`
}
// Networking defines the pod network provider in the cluster.
type Networking struct {
Type NetworkType `json:"type"`
ServiceCIDR ipnet.IPNet `json:"serviceCIDR"`
PodCIDR ipnet.IPNet `json:"podCIDR"`
}
// NetworkType defines the pod network provider in the cluster.
type NetworkType string
const (
// NetworkTypeOpenshiftSDN is used to install with SDN.
NetworkTypeOpenshiftSDN NetworkType = "openshift-sdn"
// NetworkTypeOpenshiftOVN is used to install with OVN.
NetworkTypeOpenshiftOVN NetworkType = "openshift-ovn"
)
// AWSPlatform stores all the global configuration that
// all machinesets use.
type AWSPlatform struct {
// Region specifies the AWS region where the cluster will be created.
Region string `json:"region"`
// VPCID specifies the vpc to associate with the cluster.
// If empty, new vpc will be created.
// +optional
VPCID string `json:"vpcID"`
// VPCCIDRBlock
// +optional
VPCCIDRBlock string `json:"vpcCIDRBlock"`
}
// LibvirtPlatform stores all the global configuration that
// all machinesets use.
type LibvirtPlatform struct {
// URI
URI string `json:"URI"`
// Network
Network LibvirtNetwork `json:"network"`
// MasterIPs
MasterIPs []net.IP `json:"masterIPs"`
}
// LibvirtNetwork is the configuration of the libvirt network.
type LibvirtNetwork struct {
// Name is the name of the nework.
Name string `json:"name"`
// IfName is the name of the network interface.
IfName string `json:"if"`
// IPRange is the range of IPs to use.
IPRange string `json:"ipRange"`
}