|
| 1 | +# fdp_update_edpm |
| 2 | + |
| 3 | +Role for updating OpenStack EDPM (Edge Data Plane Management) nodes with custom container images and host packages. |
| 4 | + |
| 5 | +## Description |
| 6 | + |
| 7 | +This role provides a declarative approach to update EDPM nodes with: |
| 8 | + |
| 9 | +1. **Updates container images** by patching OpenStackDataPlaneNodeSet CRs with new image references |
| 10 | +2. **Updates host packages** by configuring `edpm_bootstrap_packages` and `edpm_bootstrap_repos` in the nodeset |
| 11 | +3. **Configures registry authentication** with OpenShift service account tokens |
| 12 | +4. **Installs CA certificates** for secure registry access |
| 13 | +5. **Optionally creates deployments** to apply the changes to EDPM nodes |
| 14 | + |
| 15 | +### Key Features |
| 16 | + |
| 17 | +- **Declarative approach**: Only modifies Kubernetes CRs, doesn't execute commands directly on EDPM nodes |
| 18 | +- **Uses native EDPM capabilities**: Leverages `edpm_bootstrap` and `edpm_podman` roles from edpm-ansible |
| 19 | +- **Secure by default**: Installs OpenShift CA certificates instead of using insecure registries |
| 20 | +- **Flexible**: Supports updating containers, packages, or both |
| 21 | +- **Idempotent**: Can be run multiple times safely |
| 22 | + |
| 23 | +## Requirements |
| 24 | + |
| 25 | +- OpenShift cluster with OpenStack operators installed |
| 26 | +- Access to `oc` command |
| 27 | +- OpenStackVersion CR with custom container images |
| 28 | +- Custom repository with updated packages (if updating host packages) |
| 29 | + |
| 30 | +## Role Variables |
| 31 | + |
| 32 | +### General Configuration |
| 33 | + |
| 34 | +| Variable | Default | Description | |
| 35 | +|----------|---------|-------------| |
| 36 | +| `cifmw_fdp_update_edpm_namespace` | `"openstack"` | OpenShift namespace | |
| 37 | +| `cifmw_fdp_update_edpm_nodeset_name` | `"all"` | NodeSet to update (`"all"` or specific name) | |
| 38 | +| `cifmw_fdp_update_edpm_dry_run` | `false` | Show changes without applying | |
| 39 | + |
| 40 | +### Container Image Updates |
| 41 | + |
| 42 | +| Variable | Default | Description | |
| 43 | +|----------|---------|-------------| |
| 44 | +| `cifmw_fdp_update_edpm_containers_enabled` | `true` | Enable container image updates | |
| 45 | +| `cifmw_fdp_update_edpm_image_registry` | `""` | External registry URL (auto-detected if empty) | |
| 46 | +| `cifmw_fdp_update_edpm_image_variable_mapping` | See defaults | Mapping of image keys to EDPM variables | |
| 47 | + |
| 48 | +### Host Package Updates |
| 49 | + |
| 50 | +| Variable | Default | Description | |
| 51 | +|----------|---------|-------------| |
| 52 | +| `cifmw_fdp_update_edpm_packages_enabled` | `true` | Enable host package updates | |
| 53 | +| `cifmw_fdp_update_edpm_repo_baseurl` | `""` | **REQUIRED** Repository base URL | |
| 54 | +| `cifmw_fdp_update_edpm_repo_name` | `"fdp-update"` | Repository name | |
| 55 | +| `cifmw_fdp_update_edpm_packages` | See defaults | List of packages to install/update | |
| 56 | + |
| 57 | +### Hypervisor Firewall Configuration |
| 58 | + |
| 59 | +| Variable | Default | Description | |
| 60 | +|----------|---------|-------------| |
| 61 | +| `cifmw_fdp_update_edpm_setup_hypervisor_firewall` | `true` | Enable/disable hypervisor firewall setup for registry access | |
| 62 | +| `cifmw_fdp_update_compute_interface` | `"osp_trunk"` | Network interface on hypervisor connected to compute nodes (EDPM) | |
| 63 | +| `cifmw_fdp_update_registry_interface` | `"ocpbm"` | Network interface on hypervisor connected to OpenShift/registry | |
| 64 | +| `cifmw_fdp_update_compute_network` | `"192.168.122.0/24"` | Compute nodes network CIDR (source for NAT) | |
| 65 | +| `cifmw_fdp_update_registry_network` | `"192.168.201.0/24"` | OpenShift/registry network CIDR (destination for NAT) | |
| 66 | + |
| 67 | +### Registry Configuration |
| 68 | + |
| 69 | +| Variable | Default | Description | |
| 70 | +|----------|---------|-------------| |
| 71 | +| `cifmw_fdp_update_edpm_configure_registry_ca` | `true` | Install OpenShift CA certificate via bootstrap command | |
| 72 | +| `cifmw_fdp_update_edpm_configure_registry_auth` | `true` | Configure registry authentication | |
| 73 | + |
| 74 | +### Deployment Configuration |
| 75 | + |
| 76 | +| Variable | Default | Description | |
| 77 | +|----------|---------|-------------| |
| 78 | +| `cifmw_fdp_update_edpm_auto_deploy` | `true` | Automatically create deployment | |
| 79 | +| `cifmw_fdp_update_edpm_deployment_per_nodeset` | `true` | Create separate deployment per nodeset | |
| 80 | +| `cifmw_fdp_update_edpm_wait_for_deployment` | `true` | Wait for deployment to complete | |
| 81 | +| `cifmw_fdp_update_edpm_deployment_timeout` | `3600` | Deployment timeout (seconds) | |
| 82 | +| `cifmw_fdp_update_edpm_deployment_services` | See defaults | Services to run in deployment | |
| 83 | + |
| 84 | +## Dependencies |
| 85 | + |
| 86 | +None (uses native OpenStack Data Plane operators and edpm-ansible roles) |
| 87 | + |
| 88 | +## Example Playbook |
| 89 | + |
| 90 | +### Update both containers and packages |
| 91 | + |
| 92 | +```yaml |
| 93 | +- hosts: localhost |
| 94 | + roles: |
| 95 | + - role: fdp_update_edpm |
| 96 | + vars: |
| 97 | + cifmw_fdp_update_edpm_namespace: openstack |
| 98 | + cifmw_fdp_update_edpm_nodeset_name: openstack-edpm |
| 99 | + cifmw_fdp_update_edpm_repo_baseurl: "http://example.com/repos/fdp-updates" |
| 100 | + cifmw_fdp_update_edpm_packages: |
| 101 | + - openvswitch3.5 |
| 102 | + - openvswitch-selinux-extra-policy |
| 103 | +``` |
| 104 | +
|
| 105 | +### Update only containers |
| 106 | +
|
| 107 | +```yaml |
| 108 | +- hosts: localhost |
| 109 | + roles: |
| 110 | + - role: fdp_update_edpm |
| 111 | + vars: |
| 112 | + cifmw_fdp_update_edpm_packages_enabled: false |
| 113 | + cifmw_fdp_update_edpm_containers_enabled: true |
| 114 | +``` |
| 115 | +
|
| 116 | +### Update only packages |
| 117 | +
|
| 118 | +```yaml |
| 119 | +- hosts: localhost |
| 120 | + roles: |
| 121 | + - role: fdp_update_edpm |
| 122 | + vars: |
| 123 | + cifmw_fdp_update_edpm_containers_enabled: false |
| 124 | + cifmw_fdp_update_edpm_packages_enabled: true |
| 125 | + cifmw_fdp_update_edpm_repo_baseurl: "http://example.com/repos/updates" |
| 126 | +``` |
| 127 | +
|
| 128 | +### Dry run (show changes without applying) |
| 129 | +
|
| 130 | +```yaml |
| 131 | +- hosts: localhost |
| 132 | + roles: |
| 133 | + - role: fdp_update_edpm |
| 134 | + vars: |
| 135 | + cifmw_fdp_update_edpm_dry_run: true |
| 136 | +``` |
| 137 | +
|
| 138 | +### Custom network configuration |
| 139 | +
|
| 140 | +```yaml |
| 141 | +- hosts: localhost |
| 142 | + roles: |
| 143 | + - role: fdp_update_edpm |
| 144 | + vars: |
| 145 | + cifmw_fdp_update_compute_interface: "br-ex" |
| 146 | + cifmw_fdp_update_registry_interface: "br-ocp" |
| 147 | + cifmw_fdp_update_compute_network: "10.0.0.0/24" |
| 148 | + cifmw_fdp_update_registry_network: "172.16.0.0/24" |
| 149 | +``` |
| 150 | +
|
| 151 | +## How It Works |
| 152 | +
|
| 153 | +1. **Validates parameters**: Ensures required variables are set |
| 154 | +2. **Configures hypervisor firewall** (if enabled): Sets up iptables rules to allow EDPM nodes to access the OpenShift registry |
| 155 | +3. **Fetches NodeSets**: Gets OpenStackDataPlaneNodeSet CRs from the cluster |
| 156 | +4. **Fetches container images** (if enabled): Gets custom images from OpenStackVersion CR |
| 157 | +5. **For each NodeSet**: |
| 158 | + - Patches container image variables (e.g., `edpm_ovn_controller_agent_image`) |
| 159 | + - Patches `edpm_bootstrap_packages` with packages to install |
| 160 | + - Patches `edpm_bootstrap_repos` with custom repository configuration |
| 161 | + - Configures registry authentication (`edpm_container_registry_logins`) |
| 162 | + - Installs CA certificate via `edpm_bootstrap_command` (if enabled) |
| 163 | +6. **Creates deployment** (if enabled): Creates OpenStackDataPlaneDeployment CR |
| 164 | +7. **Waits for completion** (if enabled): Monitors deployment until Ready |
| 165 | + |
| 166 | +## Architecture: Declarative vs Imperative |
| 167 | + |
| 168 | +This role follows the **declarative** approach of Kubernetes/OpenStack: |
| 169 | + |
| 170 | +- ❌ **Does NOT** SSH to nodes and run `dnf install` directly |
| 171 | +- ❌ **Does NOT** SSH to nodes and run `systemctl restart` directly |
| 172 | +- ✅ **Does** patch NodeSet CRs with desired state |
| 173 | +- ✅ **Does** let OpenStack Data Plane Operator apply the changes |
| 174 | +- ✅ **Does** use native `edpm_bootstrap` role for package installation |
| 175 | +- ✅ **Does** use native `edpm_podman` role for container management |
| 176 | +- ✅ **Does** use `edpm_bootstrap_command` for CA certificate installation |
| 177 | + |
| 178 | +## License |
| 179 | + |
| 180 | +Apache 2.0 |
| 181 | + |
| 182 | +## Author Information |
| 183 | + |
| 184 | +Red Hat OpenStack CI Framework Team |
0 commit comments