|
| 1 | +package imagebased |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/openshift/installer/pkg/types" |
| 5 | +) |
| 6 | + |
| 7 | +const ( |
| 8 | + // SeedReconfigurationVersion is the current version of the |
| 9 | + // SeedReconfiguration struct. |
| 10 | + SeedReconfigurationVersion = 1 |
| 11 | + |
| 12 | + // BlockDeviceLabel is the volume label to be used for the image-based |
| 13 | + // installer configuration ISO. |
| 14 | + BlockDeviceLabel = "cluster-config" |
| 15 | +) |
| 16 | + |
| 17 | +// SeedReconfiguration contains all the information that is required to |
| 18 | +// transform a machine started from a single-node OpenShift (SNO) seed OCI image |
| 19 | +// (which contains dummy seed configuration) into a SNO cluster with the desired |
| 20 | +// configuration. |
| 21 | +type SeedReconfiguration struct { |
| 22 | + // AdditionalTrustBundle keeps the PEM-encoded x.509 certificate bundle(s) |
| 23 | + // that will be added to the nodes' trusted certificate store. |
| 24 | + AdditionalTrustBundle AdditionalTrustBundle `json:"additionalTrustBundle,omitempty"` |
| 25 | + |
| 26 | + // APIVersion is the version of this struct and it is used to detect breaking |
| 27 | + // changes. |
| 28 | + APIVersion int `json:"api_version"` |
| 29 | + |
| 30 | + // BaseDomain is the desired base domain. |
| 31 | + BaseDomain string `json:"base_domain,omitempty"` |
| 32 | + |
| 33 | + // ClusterID is the desired cluster ID. |
| 34 | + ClusterID string `json:"cluster_id,omitempty"` |
| 35 | + |
| 36 | + // ClusterName is the desired cluster name. |
| 37 | + ClusterName string `json:"cluster_name,omitempty"` |
| 38 | + |
| 39 | + // ChronyConfig is the desired chrony configuration and it is used to populate |
| 40 | + // the /etc/chrony.conf on the node. |
| 41 | + ChronyConfig string `json:"chrony_config,omitempty"` |
| 42 | + |
| 43 | + // Hostname is the desired hostname of the node. |
| 44 | + Hostname string `json:"hostname,omitempty"` |
| 45 | + |
| 46 | + // InfraID is the desired infra ID. |
| 47 | + InfraID string `json:"infra_id,omitempty"` |
| 48 | + |
| 49 | + // KubeadminPasswordHash is the hash of the password for the kubeadmin |
| 50 | + // user, as can be found in the kubeadmin key of the kube-system/kubeadmin |
| 51 | + // secret. This will replace the kubeadmin password of the seed cluster. |
| 52 | + KubeadminPasswordHash string `json:"kubeadmin_password_hash,omitempty"` |
| 53 | + |
| 54 | + // KubeconfigCryptoRetention contains all the crypto material that is required |
| 55 | + // for the image-based installer to ensure that the generated kubeconfigs can |
| 56 | + // be used to access the cluster after its configuration. |
| 57 | + KubeconfigCryptoRetention KubeConfigCryptoRetention |
| 58 | + |
| 59 | + // MachineNetwork is the list of IP address pools for machines. |
| 60 | + // This field replaces MachineCIDR, and if set MachineCIDR must |
| 61 | + // be empty or match the first entry in the list. |
| 62 | + // Default is 10.0.0.0/16 for all platforms other than Power VS. |
| 63 | + // For Power VS, the default is 192.168.0.0/24. |
| 64 | + MachineNetwork string `json:"machine_network,omitempty"` |
| 65 | + |
| 66 | + // NodeIP is the desired IP address of the node. |
| 67 | + NodeIP string `json:"node_ip,omitempty"` |
| 68 | + |
| 69 | + // RawNMStateConfig contains the nmstate configuration YAML manifest as string. |
| 70 | + // Example nmstate configurations can be found here: https://nmstate.io/examples.html. |
| 71 | + RawNMStateConfig string `json:"raw_nm_state_config,omitempty"` |
| 72 | + |
| 73 | + // RelaseRegistry is the container registry that hosts the release image of |
| 74 | + // the seed cluster. |
| 75 | + ReleaseRegistry string `json:"release_registry,omitempty"` |
| 76 | + |
| 77 | + // SSHKey is the public Secure Shell (SSH) key that provides access to the |
| 78 | + // node. |
| 79 | + SSHKey string `json:"ssh_key,omitempty"` |
| 80 | + |
| 81 | + // Proxy defines the proxy settings for the cluster. |
| 82 | + // If unset, the cluster will not be configured to use a proxy. |
| 83 | + Proxy *types.Proxy `json:"proxy,omitempty"` |
| 84 | + |
| 85 | + // PullSecret is the secret to use when pulling images. |
| 86 | + PullSecret string `json:"pull_secret,omitempty"` |
| 87 | +} |
| 88 | + |
| 89 | +// KubeConfigCryptoRetention contains all the crypto material that is required |
| 90 | +// for the image-based installer to ensure that the kubeconfigs can be used to |
| 91 | +// access the cluster after its configuration. |
| 92 | +type KubeConfigCryptoRetention struct { |
| 93 | + KubeAPICrypto KubeAPICrypto |
| 94 | + |
| 95 | + IngresssCrypto IngresssCrypto |
| 96 | +} |
| 97 | + |
| 98 | +// KubeAPICrypto contains the kubernetes API private keys and certificates that |
| 99 | +// are used to generate and sign the cluster's cryptographic objects. |
| 100 | +type KubeAPICrypto struct { |
| 101 | + ServingCrypto ServingCrypto |
| 102 | + |
| 103 | + ClientAuthCrypto ClientAuthCrypto |
| 104 | +} |
| 105 | + |
| 106 | +// ServingCrypto contains the kubernetes API private keys that are used to |
| 107 | +// generate the cluster's certificates. |
| 108 | +type ServingCrypto struct { |
| 109 | + // LocalhostSignerPrivateKey is a PEM-encoded X.509 key. |
| 110 | + LocalhostSignerPrivateKey string `json:"localhost_signer_private_key,omitempty"` |
| 111 | + |
| 112 | + // ServiceNetworkSignerPrivateKey is a PEM-encoded X.509 key. |
| 113 | + ServiceNetworkSignerPrivateKey string `json:"service_network_signer_private_key,omitempty"` |
| 114 | + |
| 115 | + // LoadbalancerSignerPrivateKey is a PEM-encoded X.509 key. |
| 116 | + LoadbalancerSignerPrivateKey string `json:"loadbalancer_external_signer_private_key,omitempty"` |
| 117 | +} |
| 118 | + |
| 119 | +// ClientAuthCrypto contains the CA certificate used to sign the cluster's |
| 120 | +// cryptographic objects. |
| 121 | +type ClientAuthCrypto struct { |
| 122 | + // AdminCACertificate is a PEM-encoded X.509 certificate. |
| 123 | + AdminCACertificate string `json:"admin_ca_certificate,omitempty"` |
| 124 | +} |
| 125 | + |
| 126 | +// IngresssCrypto contains the ingrees CA certificate. |
| 127 | +type IngresssCrypto struct { |
| 128 | + // IngressCA is a PEM-encoded X.509 certificate. |
| 129 | + IngressCA string `json:"ingress_ca,omitempty"` |
| 130 | +} |
| 131 | + |
| 132 | +// AdditionalTrustBundle represents the PEM-encoded X.509 certificate bundle |
| 133 | +// that will be added to the nodes' trusted certificate store. |
| 134 | +type AdditionalTrustBundle struct { |
| 135 | + // UserCaBundle keeps the contents of the user-ca-bundle ConfigMap in the |
| 136 | + // openshift-config namepace. |
| 137 | + UserCaBundle string `json:"userCaBundle"` |
| 138 | + |
| 139 | + // ProxyConfigmapName is the Proxy CR trustedCA ConfigMap name. |
| 140 | + ProxyConfigmapName string `json:"proxyConfigmapName"` |
| 141 | + |
| 142 | + // ProxyConfigampBundle keeps the contents of the ProxyConfigmapName ConfigMap. |
| 143 | + // It must be equal to the UserCaBundle when ProxyConfigmapName is |
| 144 | + // user-ca-bundle. |
| 145 | + ProxyConfigmapBundle string `json:"proxyConfigmapBundle"` |
| 146 | +} |
0 commit comments