github.com/openshift/installer@v1.4.17/docs/user/openstack/customization.md (about)

     1  # OpenStack Platform Customization
     2  
     3  Beyond the [platform-agnostic `install-config.yaml` properties](../customization.md#platform-customization), the installer supports additional, OpenStack-specific properties.
     4  
     5  ## Table of Contents
     6  
     7  - [OpenStack Platform Customization](#openstack-platform-customization)
     8    - [Table of Contents](#table-of-contents)
     9    - [Cluster-scoped properties](#cluster-scoped-properties)
    10    - [Machine pools](#machine-pools)
    11    - [Examples](#examples)
    12      - [Minimal](#minimal)
    13      - [Custom machine pools](#custom-machine-pools)
    14    - [Image Overrides](#image-overrides)
    15    - [Custom Subnets](#custom-subnets)
    16    - [Additional Networks](#additional-networks)
    17    - [Additional Security Groups](#additional-security-groups)
    18    - [Cloud Provider configuration](#cloud-provider-configuration)
    19    - [Further customization](#further-customization)
    20  
    21  ## Cluster-scoped properties
    22  
    23  * `cloud` (required string): The name of the OpenStack cloud to use from `clouds.yaml`.
    24  * `computeFlavor` (deprecated string): The OpenStack flavor to use for compute and control-plane machines.
    25  * `externalDNS` (optional list of strings): The IP addresses of DNS servers to be used for the DNS resolution of all instances in the cluster. The total number of dns servers supported by an instance is three. That total includes any dns server provided by the underlying openstack infrastructure.
    26  * `externalNetwork` (optional string): Name of external network the installer will use to provide access to the cluster. If defined, a floating IP from this network will be created and associated with the bootstrap node to facilitate debugging and connection to the bootstrap node during installation. The `apiFloatingIP` property is a floating IP address selected from this network.
    27  * `apiFloatingIP` (optional string): Address of existing Floating IP from externalNetwork the installer will associate with the OpenShift API. This property is only valid if externalNetwork is defined. If externalNetwork is not defined, the installer will throw an error.
    28  * `ingressFloatingIP` (optional string): Address of an existing Floating IP from externalNetwork the installer will associate with the ingress port. This property is only valid if externalNetwork is defined. If externalNetwork is not defined, the installer will throw an error.
    29  * `octaviaSupport` (deprecated string): Whether OpenStack supports Octavia (`1` for true or `0` for false)
    30  * `region` (deprecated string): The OpenStack region where the cluster will be created. Currently this value is not used by the installer.
    31  * `trunkSupport` (deprecated string): Whether OpenStack ports can be trunked (`1` for true or `0` for false)
    32  * `clusterOSImage` (optional string): Either a URL with `http(s)` or `file` scheme to override the default OS image for cluster nodes or an existing Glance image name.
    33  * `clusterOSImageProperties` (optional list of strings): a list of properties to be added to the installer-uploaded ClusterOSImage in Glance. The default is to not set any properties. `clusterOSImageProperties` is ignored when `clusterOSImage` points to an existing image in Glance.
    34  * `apiVIPs` (optional array of strings): IP address on the machineNetwork that will be assigned to the API VIP. If more than one are set, it must be one IPv4 and one IPv6.
    35  * `ingressVIPs` (optional array of strings): IP address on the machineNetwork that will be assigned to the ingress VIP. If more than one are set, it must be one IPv4 and one IPv6.
    36  * `controlPlanePort` (optional object): the UUID and/or Name of an OpenStack Network and its Subnets where to install the nodes of the cluster onto. For more information on how to install with a custom subnet, see the [custom subnets](#custom-subnets) section of the docs.
    37  * `defaultMachinePlatform` (optional object): Default [OpenStack-specific machine pool properties](#machine-pools) which apply to [machine pools](../customization.md#machine-pools) that do not define their own OpenStack-specific properties.
    38  
    39  ## Machine pools
    40  
    41  * `additionalNetworkIDs` (optional list of strings): IDs of additional networks for machines.
    42  * `additionalSecurityGroupIDs` (optional list of strings): IDs of additional security groups for machines.
    43  * `serverGroupPolicy` (optional string): Server group policy to apply to the group that will contain the machines in the pool. Defaults to "soft-anti-affinity". Allowed values are "affinity", "soft-affinity", "anti-affinity", "soft-anti-affinity".
    44    * It is not possible to change a server group policy or a server's affiliation to a group after creation
    45    * A strict "affinity" policy prevents migrations, and therefore affects OpenStack upgrades
    46    * An additional OpenStack host is needed when migrating instances with a strict "anti-affinity" policy
    47  * `type` (optional string): The OpenStack flavor name for machines in the pool.
    48  * `rootVolume` (optional object): Defines the root volume for instances in the machine pool. The instances use ephemeral disks if not set.
    49    * `size` (required integer): Size of the root volume in GB. Must be set to at least 25. For production clusters, this must be at least 100.
    50    * `type` (deprecated string): The volume pool to create the volume from. It was replaced by `types`.
    51    * `types` (required list of strings): The volume pool to create the volume from. If compute `zones` are defined with more than one type, the number of zones must match the number of types.
    52    * `zones` (optional list of strings): The names of the availability zones you want to install your root volumes on. If unset, the installer will use your default volume zone.
    53      If compute `zones` contains at least one value, `rootVolume.zones` must also contain at least one value.
    54      Indeed, when a machine is created with a compute availability zone and a storage root volume with no specified `rootVolume.availabilityZone`, [CAPO](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/9d183bd479fe9aed4f6e7ac3d5eee46681c518e7/pkg/cloud/services/compute/instance.go#L439-L442) will use the compute AZ for the volume AZ.
    55      This can be problematic if the AZ doesn't exist in Cinder, therefore we enforce that `rootVolume.zones` to be set if `zones` is set.
    56  * `zones` (optional list of strings): The names of the availability zones you want to install your nodes on. If unset, the installer will use your default compute zone.
    57  
    58  > **Note**
    59  > The bootstrap node follows the `type`, `rootVolume`, `additionalNetworkIDs`, and `additionalSecurityGroupIDs` parameters from the `controlPlane` machine pool.
    60  
    61  > **Note**
    62  > Note when deploying the control-plane machines with `rootVolume`, it is highly suggested to use an [additional ephemeral disk dedicated to etcd](./etcd-ephemeral-disk.md).
    63  
    64  ## Examples
    65  
    66  Some example `install-config.yaml` are shown below.
    67  For examples of platform-agnostic configuration fragments, see [here](../customization.md#examples).
    68  
    69  ### Minimal
    70  
    71  An example minimal OpenStack install config is:
    72  
    73  ```yaml
    74  apiVersion: v1
    75  baseDomain: example.com
    76  metadata:
    77    name: test-cluster
    78  platform:
    79    openstack:
    80      apiFloatingIP: 128.0.0.1
    81      cloud: mycloud
    82      defaultMachinePlatform:
    83        type: m1.s2.xlarge
    84      externalNetwork: external
    85      externalDNS:
    86        - "8.8.8.8"
    87        - "192.168.1.12"
    88  pullSecret: '{"auths": ...}'
    89  sshKey: ssh-ed25519 AAAA...
    90  ```
    91  
    92  ### Custom machine pools
    93  
    94  An example OpenStack install config with custom machine pools:
    95  
    96  ```yaml
    97  apiVersion: v1
    98  baseDomain: example.com
    99  controlPlane:
   100    name: master
   101    replicas: 3
   102  compute:
   103  - name: worker
   104    platform:
   105      openstack:
   106        type: ml.large
   107        rootVolume:
   108          size: 30
   109          types:
   110          - performance
   111    replicas: 3
   112  metadata:
   113    name: test-cluster
   114  platform:
   115    openstack:
   116      apiFloatingIP: 128.0.0.1
   117      cloud: mycloud
   118      defaultMachinePlatform:
   119        type: m1.s2.xlarge
   120      externalNetwork: external
   121  pullSecret: '{"auths": ...}'
   122  sshKey: ssh-ed25519 AAAA...
   123  ```
   124  
   125  ## Image Overrides
   126  
   127  The OpenShift installer pins the version of RHEL CoreOS and normally handles uploading the image to the target OpenStack instance.
   128  
   129  If you want to download the image manually, see [CoreOS bootimages](../overview.md#coreos-bootimages) for more information
   130  about bootimages.  This is useful, for example, to perform a disconnected installation.  To do this,
   131  download the `qcow2` and host it at a custom location.  Then set the `openstack.clusterOSImage`
   132  parameter field in the install config to point to that location.   The install process will
   133  then use that mirrored image.
   134  In all other respects the process will be consistent with the default.
   135  
   136  > **Note**
   137  > For this to work, the parameter value must be a valid http(s) URL.
   138  
   139  > **Note**
   140  > The optional `sha256` query parameter can be attached to the URL. This will force the installer to check the uncompressed image file checksum before uploading it into Glance.
   141  
   142  Example:
   143  
   144  ```yaml
   145  platform:
   146    openstack:
   147        clusterOSImage: http://mirror.example.com/images/rhcos-43.81.201912131630.0-openstack.x86_64.qcow2.gz?sha256=ffebbd68e8a1f2a245ca19522c16c86f67f9ac8e4e0c1f0a812b068b16f7265d
   148  ```
   149  
   150  If the user wants to upload the image from the local file system, he can set `clusterOSImage` as `file:///path/to/file`. In this case the installer will take this file and automatically create an image in Glance.
   151  
   152  Example:
   153  
   154  ```yaml
   155  platform:
   156    openstack:
   157        clusterOSImage: file:///home/user/rhcos.qcow2
   158  ```
   159  
   160  If the user wants to reuse an existing Glance image without any uploading of binary data, then it is possible to set `clusterOSImage` install config parameter that specifies the Glance image name. In this case no new Glance images will be created, and the image will stay when the cluster is destroyed. In other words, if `clusterOSImage` is not an "http(s)" or "file" URL, then the installer will look into Glance for an image with that name.
   161  
   162  Example:
   163  
   164  ```yaml
   165  platform:
   166    openstack:
   167        clusterOSImage: my-rhcos
   168  ```
   169  
   170  ## Custom Subnets
   171  
   172  In the `install-config.yaml` file, the value of the `controlPlanePort` property contains the Name and/or UUID of the network and subnet(s) where the Kubernetes endpoints of the nodes in your cluster are published. The Ingress and API ports are created on the subnets, too. By default, the installer creates a network and subnet for these endpoints and ports. Alternatively, you can use a OpenStack network containing one subnet or two, in case of dual-stack, of your own by specifying their and/or in the `controlPlanePort` property. To use this feature, you need to meet these requirements:
   173  
   174  * Any subnet used by `controlPlanePort` have DHCP enabled.
   175  * The CIDR of any subnet listed in `controlPlanePort.fixedIPs` matches the CIDRs listed on `networks.machineNetwork`.
   176  * When using dual-stack Network the api and ingress Ports needs to be pre-created by the user. Also, the installer user must have permission to add tags and security groups to those pre-created Ports. The value of the fixed IPs of the Ports needs to be specified at the `apiVIPs` and `ingressVIPs` options in the `install-config.yaml`.
   177  * If not using dual-stack, the installer user must have permission to create ports on this network, including ports with fixed IP addresses.
   178  
   179  You should also be aware of the following limitations:
   180  
   181  * If you plan to install a cluster that uses floating IPs, the `controlPlanePort` must be attached to a router that is connected to the `externalNetwork`.
   182  * The installer will not create a private network or subnet for your OpenShift machines if the `controlPlanePort` is set in the `install-config.yaml`.
   183  * By default when not using dual-stack, the API and Ingress VIPs use the .5 and .7 of your network CIDR. To prevent other services from taking the ports that are assigned to the API and Ingress VIPs, set the `apiVIP` and `ingressVIP` options in the `install-config.yaml` to addresses that are outside of the DHCP allocation pool.
   184  * You cannot use the `externalDNS` property at the same time as a custom `controlPlanePort`. If you want to add a DNS to your cluster while using a custom subnet, [add it to the subnet in OpenStack](https://docs.openstack.org/neutron/rocky/admin/config-dns-res.html).
   185  
   186  ## Additional Networks
   187  
   188  You can set additional networks for your machines by defining `additionalNetworkIDs` parameter in the machine configuration. The parameter is a list of strings with additional network IDs:
   189  
   190  ```yaml
   191  additionalNetworkIDs:
   192  - <network1_uuid>
   193  - <network2_uuid>
   194  ```
   195  
   196  You can attach this parameter for both `controlPlane` and `compute` machines:
   197  
   198  Example:
   199  
   200  ```yaml
   201  compute:
   202  - name: worker
   203    platform:
   204      openstack:
   205        additionalNetworkIDs:
   206        - fa806b2f-ac49-4bce-b9db-124bc64209bf
   207  controlPlane:
   208    name: master
   209    platform:
   210      openstack:
   211        additionalNetworkIDs:
   212        - fa806b2f-ac49-4bce-b9db-124bc64209bf
   213  ```
   214  
   215  > **Note**
   216  > Allowed address pairs won't be created for the additional networks.
   217  
   218  > **Note**
   219  > The additional networks attached to the Control Plane machine will also be attached to the bootstrap node.
   220  
   221  ## Additional Security Groups
   222  
   223  You can set additional security groups for your machines by defining `additionalSecurityGroupIDs` parameter in the machine configuration. The parameter is a list of strings with additional security group IDs:
   224  
   225  ```yaml
   226  additionalSecurityGroupIDs:
   227  - <security_group1_id>
   228  - <security_group2_id>
   229  ```
   230  
   231  You can attach this parameter for both `controlPlane` and `compute` machines:
   232  
   233  Example:
   234  
   235  ```yaml
   236  compute:
   237  - name: worker
   238    platform:
   239      openstack:
   240        additionalSecurityGroupIDs:
   241        - 7ee219f3-d2e9-48a1-96c2-e7429f1b0da7
   242  controlPlane:
   243    name: master
   244    platform:
   245      openstack:
   246        additionalSecurityGroupIDs:
   247        - 7ee219f3-d2e9-48a1-96c2-e7429f1b0da7
   248  ```
   249  
   250  > **Note**
   251  > The additional security groups attached to the Control Plane machine will also be attached to the bootstrap node.
   252  
   253  ## Cloud Provider configuration
   254  
   255  You may want to modify cloud provider configuration in order to make it work with your OpenStack cloud. This is possible if you'll let the installer generate the manifests before running the installation:
   256  
   257  ```sh
   258  openshift-install --dir <directory> create manifests
   259  ```
   260  
   261  Then modify the manifest containing the [cloud provider configuration](https://v1-18.docs.kubernetes.io/docs/concepts/cluster-administration/cloud-providers/#cloud-conf):
   262  
   263  ```sh
   264  vi <directory>/manifests/cloud-provider-config.yaml
   265  ```
   266  
   267  As an example in order to tweak support for LoadBalancer Services you can modify options regarding Octavia configuration in the `[LoadBalancer]` section of `config` key. In particular:
   268  
   269  * `enabled = false` disables the Octavia integration.
   270  * `lb-provider = <"amphora" or "ovn">` lets you choose the Octavia provider to use when creating load balancers. Please note that setting "ovn" requires setting `lb-method = SOURCE_IP_PORT` as this is the only method supported by OVN.
   271  * `floating-network-id = <uuid>` is required to be set if your OpenStack cluster has multiple external networks. The network set here will be used by cloud provider to create floating IPs on.
   272  
   273  After saving the file you can continue the installation normally:
   274  
   275  ```sh
   276  openshift-install --dir <directory> create cluster
   277  ```
   278  
   279  ## Further customization
   280  
   281  For customizing the installation beyond what is possible with `openshift-install`, refer to the [UPI (User Provided Infrastructure) documentation](./install_upi.md).