|
| 1 | +Role Name |
| 2 | +========= |
| 3 | + |
| 4 | +This Ansible role helps configure Operators on the Openshift Cluster to support VM migrations. Tasks include |
| 5 | +- Configure Catalog Sources to use mirroring repository for Operators |
| 6 | +- Create and configure Operators |
| 7 | + |
| 8 | + |
| 9 | +Requirements |
| 10 | +------------ |
| 11 | + |
| 12 | +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. |
| 13 | + |
| 14 | +Role Variables |
| 15 | +-------------- |
| 16 | + |
| 17 | +The task `operators/catalog_sources.yml` needs following variables: |
| 18 | + |
| 19 | +- **Variable Name**: `cluster_config_catalog_sources` |
| 20 | + - **Type**: List |
| 21 | + - **Description**: A list of custom CatalogSources configurations used as loop variables to generate Kubernetes manifest files from the template `catalog_source.j2` for CatalogSource. If the variable is not available, no manifest is created. |
| 22 | + - **Example**: |
| 23 | + ```yaml |
| 24 | + cluster_config_catalog_sources: |
| 25 | + - name: redhat-marketplace2 |
| 26 | + source_type: grpc |
| 27 | + display_name: Mirror to Red Hat Marketplace |
| 28 | + image_path: internal-registry.example.com/operator:v1 |
| 29 | + priority: '-300' |
| 30 | + icon: |
| 31 | + base64data: '' |
| 32 | + mediatype: '' |
| 33 | + publisher: redhat |
| 34 | + address: '' |
| 35 | + grpc_pod_config: | |
| 36 | + nodeSelector: |
| 37 | + kubernetes.io/os: linux |
| 38 | + node-role.kubernetes.io/master: '' |
| 39 | + priorityClassName: system-cluster-critical |
| 40 | + securityContextConfig: restricted |
| 41 | + tolerations: |
| 42 | + - effect: NoSchedule |
| 43 | + key: node-role.kubernetes.io/master |
| 44 | + operator: Exists |
| 45 | + - effect: NoExecute |
| 46 | + key: node.kubernetes.io/unreachable |
| 47 | + operator: Exists |
| 48 | + tolerationSeconds: 120 |
| 49 | + - effect: NoExecute |
| 50 | + key: node.kubernetes.io/not-ready |
| 51 | + operator: Exists |
| 52 | + tolerationSeconds: 120 |
| 53 | + registry_poll_interval: 10m |
| 54 | + ``` |
| 55 | +
|
| 56 | +The task `operators/operator_config.yaml` needs following variables: |
| 57 | + |
| 58 | +- **Variable Name**: `cluster_config_operators` |
| 59 | + - **Type**: List |
| 60 | + - **Description**: A list of operators to be installed on OCP cluster |
| 61 | +- **Variable Name**: `cluster_config_[OPERATOR_NAME]` |
| 62 | + - **Type**: Dict |
| 63 | + - **Description**: Configuration specific to each operator listed in `cluster_config_operators`. Includes settings for namespace, operator group, subscription, and any extra resources |
| 64 | + - **Example**: Assume the `cluster_config_operators` specifies these operators: |
| 65 | + ```yaml |
| 66 | + cluster_config_operators: |
| 67 | + - cnv |
| 68 | + - oadp |
| 69 | + ``` |
| 70 | + then the corresponding `cluster_config_mtv` and `cluster_config_cnv` can be configured as following: |
| 71 | + ```yaml |
| 72 | + cluster_config_cnv_namespace: openshift-cnv |
| 73 | + cluster_config_cnv: |
| 74 | + namespace: |
| 75 | + name: "{{ cluster_config_cnv_namespace }}" |
| 76 | + operator_group: |
| 77 | + name: kubevirt-hyperconverged-group |
| 78 | + target_namespaces: |
| 79 | + - "{{ cluster_config_cnv_namespace }}" |
| 80 | + subscription: |
| 81 | + name: kubevirt-hyperconverged |
| 82 | + starting_csv: kubevirt-hyperconverged-operator.v4.13.8 |
| 83 | + extra_resources: |
| 84 | + - apiVersion: hco.kubevirt.io/v1beta1 |
| 85 | + kind: HyperConverged |
| 86 | + metadata: |
| 87 | + name: kubevirt-hyperconverged |
| 88 | + namespace: "{{ cluster_config_cnv_namespace }}" |
| 89 | + spec: |
| 90 | + BareMetalPlatform: true |
| 91 | +
|
| 92 | + cluster_config_oadp_namespace: openshift-adp |
| 93 | + cluster_config_oadp: |
| 94 | + namespace: |
| 95 | + name: "{{ cluster_config_oadp_namespace }}" |
| 96 | + operator_group: |
| 97 | + name: redhat-oadp-operator-group |
| 98 | + target_namespaces: |
| 99 | + - "{{ cluster_config_oadp_namespace }}" |
| 100 | + subscription: |
| 101 | + name: redhat-oadp-operator-subscription |
| 102 | + spec_name: redhat-oadp-operator |
| 103 | + ``` |
| 104 | +Dependencies |
| 105 | +------------ |
| 106 | + |
| 107 | +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. |
| 108 | + |
| 109 | +Example Playbook |
| 110 | +---------------- |
| 111 | + |
| 112 | +An example of configuring a CatalogSource resource: |
| 113 | +``` |
| 114 | +- name: Configure Catalog Sources for Operators |
| 115 | + hosts: localhost |
| 116 | + gather_facts: false |
| 117 | + tasks: |
| 118 | + - ansible.builtin.include_role: |
| 119 | + name: cluster_config |
| 120 | + tasks_from: operators/catalog_sources |
| 121 | +``` |
| 122 | + |
| 123 | +License |
| 124 | +------- |
| 125 | + |
| 126 | +BSD |
| 127 | + |
| 128 | +Author Information |
| 129 | +------------------ |
| 130 | + |
| 131 | +An optional section for the role authors to include contact information, or a website (HTML is not allowed). |
0 commit comments