From 0a57de7c58bf217212ff24a83abb19b63fb1084c Mon Sep 17 00:00:00 2001 From: Abhinav Dahiya Date: Tue, 28 Aug 2018 11:47:07 -0700 Subject: [PATCH] Documentation: update installconfig also drops previous work as it confuses people and serves little purpose. --- Documentation/design/installconfig.md | 275 ++++---------------------- 1 file changed, 42 insertions(+), 233 deletions(-) diff --git a/Documentation/design/installconfig.md b/Documentation/design/installconfig.md index aaeef5f41d0..f069a8b3d63 100644 --- a/Documentation/design/installconfig.md +++ b/Documentation/design/installconfig.md @@ -20,213 +20,6 @@ The installer requires configurations of mostly 2 types: 2. Kubernetes cluster-level configuration options. **For example, API server URL address, cluster networking etc.** -## Previous work - -### Tectonic Installer - -Tectonic-installer in `track-2` used a `Cluster` object to make install time configurations. - -#### `Cluster` object - -```go -// Cluster defines the config for a cluster. -type Cluster struct { - Admin `json:",inline" yaml:"admin,omitempty"` - aws.AWS `json:",inline" yaml:"aws,omitempty"` - BaseDomain string `json:"tectonic_base_domain,omitempty" yaml:"baseDomain,omitempty"` - CA `json:",inline" yaml:"CA,omitempty"` - ContainerLinux `json:",inline" yaml:"containerLinux,omitempty"` - Etcd `json:",inline" yaml:"etcd,omitempty"` - IgnitionEtcd string `json:"tectonic_ignition_etcd,omitempty" yaml:"-"` - IgnitionMaster string `json:"tectonic_ignition_master,omitempty" yaml:"-"` - IgnitionWorker string `json:"tectonic_ignition_worker,omitempty" yaml:"-"` - Internal `json:",inline" yaml:"-"` - libvirt.Libvirt `json:",inline" yaml:"libvirt,omitempty"` - LicensePath string `json:"tectonic_license_path,omitempty" yaml:"licensePath,omitempty"` - Master `json:",inline" yaml:"master,omitempty"` - Name string `json:"tectonic_cluster_name,omitempty" yaml:"name,omitempty"` - Networking `json:",inline" yaml:"networking,omitempty"` - NodePools `json:"-" yaml:"nodePools"` - Platform Platform `json:"tectonic_platform" yaml:"platform,omitempty"` - PullSecretPath string `json:"tectonic_pull_secret_path,omitempty" yaml:"pullSecretPath,omitempty"` - Worker `json:",inline" yaml:"worker,omitempty"` -} -``` - -#### AWS specfic configuration - -```go -// AWS converts AWS related config. -type AWS struct { - AutoScalingGroupExtraTags []map[string]string `json:"tectonic_autoscaling_group_extra_tags,omitempty" yaml:"autoScalingGroupExtraTags,omitempty"` - EC2AMIOverride string `json:"tectonic_aws_ec2_ami_override,omitempty" yaml:"ec2AMIOverride,omitempty"` - Endpoints Endpoints `json:"tectonic_aws_endpoints,omitempty" yaml:"endpoints,omitempty"` - Etcd `json:",inline" yaml:"etcd,omitempty"` - External `json:",inline" yaml:"external,omitempty"` - ExtraTags map[string]string `json:"tectonic_aws_extra_tags,omitempty" yaml:"extraTags,omitempty"` - InstallerRole string `json:"tectonic_aws_installer_role,omitempty" yaml:"installerRole,omitempty"` - Master `json:",inline" yaml:"master,omitempty"` - Profile string `json:"tectonic_aws_profile,omitempty" yaml:"profile,omitempty"` - Region string `json:"tectonic_aws_region,omitempty" yaml:"region,omitempty"` - VPCCIDRBlock string `json:"tectonic_aws_vpc_cidr_block,omitempty" yaml:"vpcCIDRBlock,omitempty"` - Worker `json:",inline" yaml:"worker,omitempty"` -} - -// External converts external related config. -type External struct { - MasterSubnetIDs []string `json:"tectonic_aws_external_master_subnet_ids,omitempty" yaml:"masterSubnetIDs,omitempty"` - PrivateZone string `json:"tectonic_aws_external_private_zone,omitempty" yaml:"privateZone,omitempty"` - VPCID string `json:"tectonic_aws_external_vpc_id,omitempty" yaml:"vpcID,omitempty"` - WorkerSubnetIDs []string `json:"tectonic_aws_external_worker_subnet_ids,omitempty" yaml:"workerSubnetIDs,omitempty"` -} - -// Master converts master related config. -type Master struct { - CustomSubnets map[string]string `json:"tectonic_aws_master_custom_subnets,omitempty" yaml:"customSubnets,omitempty"` - EC2Type string `json:"tectonic_aws_master_ec2_type,omitempty" yaml:"ec2Type,omitempty"` - ExtraSGIDs []string `json:"tectonic_aws_master_extra_sg_ids,omitempty" yaml:"extraSGIDs,omitempty"` - IAMRoleName string `json:"tectonic_aws_master_iam_role_name,omitempty" yaml:"iamRoleName,omitempty"` - MasterRootVolume `json:",inline" yaml:"rootVolume,omitempty"` -} - -// Worker converts worker related config. -type Worker struct { - CustomSubnets map[string]string `json:"tectonic_aws_worker_custom_subnets,omitempty" yaml:"customSubnets,omitempty"` - EC2Type string `json:"tectonic_aws_worker_ec2_type,omitempty" yaml:"ec2Type,omitempty"` - ExtraSGIDs []string `json:"tectonic_aws_worker_extra_sg_ids,omitempty" yaml:"extraSGIDs,omitempty"` - IAMRoleName string `json:"tectonic_aws_worker_iam_role_name,omitempty" yaml:"iamRoleName,omitempty"` - LoadBalancers []string `json:"tectonic_aws_worker_load_balancers,omitempty" yaml:"loadBalancers,omitempty"` - WorkerRootVolume `json:",inline" yaml:"rootVolume,omitempty"` -} -``` - -#### libvirt specfic configuration - -```go -type Libvirt struct { - URI string `json:"tectonic_libvirt_uri,omitempty" yaml:"uri"` - QCOWImagePath string `json:"tectonic_coreos_qcow_path,omitempty" yaml:"imagePath"` - Network `json:",inline" yaml:"network"` - MasterIPs []string `json:"tectonic_libvirt_master_ips,omitempty" yaml:"masterIPs"` -} - -// Network describes a libvirt network configuration. -type Network struct { - Name string `json:"tectonic_libvirt_network_name,omitempty" yaml:"name"` - IfName string `json:"tectonic_libvirt_network_if,omitempty" yaml:"ifName"` - DNSServer string `json:"tectonic_libvirt_resolver,omitempty" yaml:"dnsServer"` - IPRange string `json:"tectonic_libvirt_ip_range,omitempty" yaml:"ipRange"` -} -``` - -### Cluster Operator - -Cluster Operator also defines a `ClusterDeployment` object to represent a cluster managed by clusteroperator. - -#### `ClusterDeployment` object - -```go -type ClusterDeployment struct { - metav1.TypeMeta - metav1.ObjectMeta - - Spec ClusterDeploymentSpec - Status ClusterDeploymentStatus -} - -type ClusterDeploymentSpec struct { - ClusterID string - - // Hardware specifies the hardware that the cluster will run on - Hardware ClusterHardwareSpec - - // Config specifies cluster-wide OpenShift configuration - Config ClusterConfigSpec - DefaultHardwareSpec *MachineSetHardwareSpec - - // MachineSets specifies the configuration of all machine sets for the cluster - MachineSets []ClusterMachineSet - - ClusterVersionRef ClusterVersionReference -} -``` - -`ClusterHardwareSpec` contains the global configurations options for platforms. - -```go -type ClusterHardwareSpec struct { - // AWS specifies cluster hardware configuration on AWS - // +optional - AWS *AWSClusterSpec - - // TODO: Add other cloud-specific Specs as needed -} -``` - -#### AWS specific configurations - -```go -type AWSClusterSpec struct { - Defaults *MachineSetAWSHardwareSpec - AccountSecret corev1.LocalObjectReference - SSHSecret corev1.LocalObjectReference - SSHUser string - SSLSecret corev1.LocalObjectReference - - Region string - VPCName string - VPCSubnet string -} -``` - -#### Machine configuration using `ClusterMachineSet` - -Machines in clusteroperator are defined using `ClusterMachineSet`. - -```go -type ClusterMachineSet struct { - ShortName string - // MachineSetConfig is the configuration for the MachineSet - MachineSetConfig -} - -type MachineSetConfig struct { - // NodeType is the type of nodes that comprise the MachineSet - // TODO: remove in favor of upstream MachineTemplateSpec roles. - NodeType NodeType - - // Infra indicates whether this machine set should contain infrastructure - // pods - // TODO: remove in favor of upstream MachineTemplateSpec roles. - Infra bool - - // Size is the number of nodes that the node group should contain - // TODO: remove in favor of upstream MachineSet and MachineDeployment replicas. - Size int - - // Hardware defines what the hardware should look like for this - // MachineSet. The specification will vary based on the cloud provider. - // +optional - Hardware *MachineSetHardwareSpec - - // NodeLabels specifies the labels that will be applied to nodes in this - // MachineSet - NodeLabels map[string]string -} -``` - -`MachineSetHardwareSpec` is used to define the machines on various platforms. - -```go -type MachineSetHardwareSpec struct { - AWS *MachineSetAWSHardwareSpec -} - -type MachineSetAWSHardwareSpec struct { - InstanceType string -} -``` - ## 4.0 Installer ### InstallConfig object @@ -234,14 +27,15 @@ type MachineSetAWSHardwareSpec struct { The installconfig object provides only necessary configurations options that are valuable for most users. Any extra user customization needs to happen in `render` and `prepare` phases of installer. ```go +// InstallConfig is the configuration for an OpenShift install. type InstallConfig struct { // +optional - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // ClusterID is the ID of the cluster. - ClusterID string `json:"clusterID"` + ClusterID string `json:"clusterID"` // Admin is the configuration for the admin user. Admin Admin `json:"admin"` @@ -250,13 +44,14 @@ type InstallConfig struct { BaseDomain string `json:"baseDomain"` // Networking defines the pod network provider in the cluster. - Networking `json:"networking"` + Networking `json:"networking"` // Machines is the list of MachinePools that need to be installed. - Machines []MachinePools `json:"machines"` + Machines []MachinePool `json:"machines"` - // only one of the platform configuration should be set - Platform `json:"platform"` + // Platform is the configuration for the specific platform upon which to + // perform the installation. + Platform `json:"platform"` // License is an OpenShift license needed to install a cluster. License string `json:"license"` @@ -265,67 +60,81 @@ type InstallConfig struct { 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 string `json:"sshKey"` + // 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 *AWSPlatform `json:"aws,omitempty"` - Libvirt *LibvirtPlatform `json:"libvirt,omitempty"` + // 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 net.IPNet `json:"serviceCIDR"` - PodCIDR net.IPNet `json:"podCIDR"` + ServiceCIDR net.IPNet `json:"serviceCIDR"` + PodCIDR net.IPNet `json:"podCIDR"` } // NetworkType defines the pod network provider in the cluster. type NetworkType string const ( - // NetworkTypeOpenshiftSDN + // NetworkTypeOpenshiftSDN is used to install with SDN. NetworkTypeOpenshiftSDN NetworkType = "openshift-sdn" - // NetworkTypeOpenshiftOVN + // NetworkTypeOpenshiftOVN is used to install with OVN. NetworkTypeOpenshiftOVN NetworkType = "openshift-ovn" ) -// AWS stores all the global configuration that +// AWSPlatform stores all the global configuration that // all machinesets use. -type AWS struct { +type AWSPlatform struct { // Region specifies the AWS region where the cluster will be created. - Region string `json:"region"` + 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"` + VPCID string `json:"vpcID"` // VPCCIDRBlock // +optional - VPCCIDRBlock string `json:"vpcCIDRBlock"` + VPCCIDRBlock string `json:"vpcCIDRBlock"` } -// Libvirt stores all the global configuration that +// LibvirtPlatform stores all the global configuration that // all machinesets use. -type Libvirt struct { +type LibvirtPlatform struct { // URI - URI string `json:"URI"` + URI string `json:"URI"` // Network - Network `json:"network"` + Network LibvirtNetwork `json:"network"` // MasterIPs - MasterIPs []net.IP `json:"masterIPs"` + MasterIPs []net.IP `json:"masterIPs"` } +// LibvirtNetwork is the configuration of the libvirt network. type LibvirtNetwork struct { - Name string `json:"name"` - IfName string `json:"if"` + // Name is the name of the nework. + Name string `json:"name"` + // IfName is the name of the network interface. + IfName string `json:"if"` + // DNSServer is the name of the DNS server. DNSServer string `json:"resolver"` - IPRange string `json:"ipRange"` + // IPRange is the range of IPs to use. + IPRange string `json:"ipRange"` } ```