Skip to content

Commit

Permalink
ospdo adoption backend services (openstack-k8s-operators#689)
Browse files Browse the repository at this point in the history
* Add Director Operator backend_service sscripts for adoption

Related CI patch and background:
https://gitlab.cee.redhat.com/ci-framework/ci-framework-jobs/-/merge_requests/966

Jiras:
https://issues.redhat.com/browse/OSPRH-1891
https://issues.redhat.com/browse/OSPRH-2984

* backend_services default vars

* fix lint

* fix lint

* fix lint

* fix lint comment

* update dpa vars
  • Loading branch information
pinikomarov authored Oct 31, 2024
1 parent 71d6de4 commit 0f35244
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 6 deletions.
13 changes: 13 additions & 0 deletions tests/roles/backend_services/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ heat_stack_domain_admin_password: ''
swift_password: ''
dns_lb_ip: 192.168.122.80
dns_server_ip: 192.168.122.1

dpa_dir: "../.."
dpa_tests_dir: "{{ dpa_dir }}/tests"

# ospdo env:
# Whether source env is OSPD Director Operator
# i.e. https://github.com/openstack-k8s-operators/osp-director-operator
ospdo_src: false
# rhoso namespace
rhoso_namespace: "openstack"
# director operator namespace
org_namespace: "ospdo_openstack"
# adoption repo default location
24 changes: 18 additions & 6 deletions tests/roles/backend_services/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc project openstack
oc project {{ rhoso_namespace }}
- name: create osp-secret
ansible.builtin.shell: |
Expand All @@ -11,6 +11,12 @@
cd {{ install_yamls_path }}
make input
- name: execute alternative tasks when source env is ODPdO
ansible.builtin.include_tasks: ospdo_backend_services.yaml
when: ospdo_src| bool
vars:
get_svc_pass: true

- name: set service passwords
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
Expand Down Expand Up @@ -61,14 +67,15 @@
- name: create tmp directory
ansible.builtin.command:
cmd: mkdir -p ../config/tmp
cmd: mkdir -p "{{ dpa_tests_dir }}/config/tmp"

- name: template out the controlplane deployment
ansible.builtin.template:
src: openstack_control_plane.j2
dest: "../config/tmp/test_deployment.yaml"
mode: '644'
force: true
when: not ospdo_src| bool

- name: when periodic, create OpenStackVersion CR with container overrides
when:
Expand All @@ -80,7 +87,7 @@
- name: template out the OpenStackVersion deployment with container overrides
ansible.builtin.template:
src: openstack_version.j2
dest: "../config/openstack_version_overrides.yaml"
dest: "{{ dpa_tests_dir }}/config/openstack_version_overrides.yaml"
mode: '644'
force: true

Expand All @@ -90,15 +97,20 @@
{{ oc_header }}
oc apply -f openstack_version_overrides.yaml
args:
chdir: "../config"
chdir: "{{ dpa_tests_dir }}/config"

- name: execute alternative tasks when source env is ODPdO
ansible.builtin.include_tasks: ospdo_backend_services.yaml
when: ospdo_src| bool
vars:
deploy_ctlplane_ospdo: true

- name: Deploy the podified control plane
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc apply -f ../config/tmp/test_deployment.yaml
# args:
# chdir: "../config"
when: not ospdo_src| bool

- name: wait for services to start up
ansible.builtin.shell: |
Expand Down
28 changes: 28 additions & 0 deletions tests/roles/backend_services/tasks/ospdo_backend_services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- name: get service passwords
ansible.builtin.shell: |
oc get secret tripleo-passwords -o jsonpath='{.data.*}' | base64 -d>~/tripleo-standalone-passwords.yaml
when: get_svc_pass| default(false) | bool

- name: get OSPdO storage storageClass
ansible.builtin.shell: |
oc get -n {{ org_namespace }} pvc openstackclient-hosts -o jsonpath='{.spec.storageClassName}'
register: ospdo_storage_class
when: deploy_ctlplane_ospdo| default(false) | bool

- name: template out the openstack_control_plane_ospdo override for deployment
ansible.builtin.template:
src: openstack_control_plane_ospdo.j2
dest: "{{ dpa_tests_dir }}/config/tmp/openstack_control_plane_ospdo.yaml"
mode: '644'
force: true
when: deploy_ctlplane_ospdo| default(false) | bool

- name: Deploy podified control along side OSPdO
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc apply -f {{ dpa_tests_dir }}/config/tmp/openstack_control_plane_ospdo.yaml
args:
chdir: "{{ dpa_tests_dir }}/config"
when: deploy_ctlplane_ospdo| default(false) | bool
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: openstack
spec:
nodeSelector:
type: openstack
storageClass: {{ ospdo_storage_class.stdout }}
barbican:
enabled: false
template:
barbicanAPI: {}
barbicanWorker: {}
barbicanKeystoneListener: {}

cinder:
enabled: false
template:
cinderAPI: {}
cinderScheduler: {}
cinderBackup: {}
cinderVolumes: {}

dns:
template:
override:
service:
metadata:
annotations:
metallb.universe.tf/address-pool: ctlplane{{ osp18_ns_suffix }}
metallb.universe.tf/allow-shared-ip: ctlplane{{ osp18_ns_suffix }}
metallb.universe.tf/loadBalancerIPs: 172.22.0.80
spec:
type: LoadBalancer
options:
- key: server
values:
- 172.22.0.1
replicas: 1

glance:
enabled: false
template:
glanceAPIs: {}

horizon:
enabled: false
template: {}

ironic:
enabled: false
template:
ironicConductors: []

keystone:
enabled: false
template: {}

manila:
enabled: false
template:
manilaAPI: {}
manilaScheduler: {}
manilaShares: {}

mariadb:
enabled: false
templates: {}

galera:
enabled: true
templates:
openstack:
adoptionRedirect: {}
replicas: 1
secret: osp-secret
storageClass: {{ ospdo_storage_class.stdout }}
storageRequest: 500M
openstack-cell1:
adoptionRedirect: {}
replicas: 1
secret: osp-secret
storageClass: {{ ospdo_storage_class.stdout }}
storageRequest: 500M

memcached:
enabled: true
templates:
memcached:
replicas: 1

neutron:
enabled: false
template: {}

nova:
enabled: false
template: {}

ovn:
enabled: false
template:
ovnDBCluster:
ovndbcluster-nb:
dbType: NB
storageClass: {{ ospdo_storage_class.stdout }}
storageRequest: 10G
networkAttachment: internalapi{{ osp18_ns_suffix }}
ovndbcluster-sb:
storageClass: {{ ospdo_storage_class.stdout }}
dbType: SB
storageRequest: 10G
networkAttachment: internalapi{{ osp18_ns_suffix }}
ovnNorthd:
replicas: 0
ovnController:
networkAttachment: tenant{{ osp18_ns_suffix }}
nodeSelector:
node: non-existing-node-name

placement:
enabled: false
template: {}

rabbitmq:
templates:
rabbitmq:
replicas: 1
override:
service:
metadata:
annotations:
metallb.universe.tf/address-pool: internalapi{{ osp18_ns_suffix }}
metallb.universe.tf/loadBalancerIPs: 172.17.0.190
spec:
type: LoadBalancer
rabbitmq-cell1:
persistence:
storageClassName: {{ ospdo_storage_class.stdout }}
replicas: 1
override:
service:
metadata:
annotations:
metallb.universe.tf/address-pool: internalapi{{ osp18_ns_suffix }}
metallb.universe.tf/loadBalancerIPs: 172.17.0.196
spec:
type: LoadBalancer

ceilometer:
enabled: false
template: {}

autoscaling:
enabled: false
template: {}

tls:
{% if enable_tlse %}
podLevel:
enabled: true
internal:
ca:
customIssuer: rootca-internal
libvirt:
ca:
customIssuer: rootca-internal
ovn:
ca:
customIssuer: rootca-internal
ingress:
ca:
customIssuer: rootca-internal
enabled: true
{% else %}
podLevel:
enabled: false
ingress:
enabled: false
{% endif %}
9 changes: 9 additions & 0 deletions tests/vars.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,12 @@ telemetry_adoption: true
# Whether to adopt Octavia
octavia_adoption: true
enable_octavia: true

# Whether source env is OSPD Director Operator
# i.e. https://github.com/openstack-k8s-operators/osp-director-operator
ospdo_src: false

# rhoso namespace
rhoso_namespace: "openstack"
# director operator namespace
org_namespace: "ospdo_openstack"

0 comments on commit 0f35244

Please sign in to comment.