-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ospdo adoption mariadb copy #690
Open
pinikomarov
wants to merge
13
commits into
openstack-k8s-operators:main
Choose a base branch
from
pinikomarov:ospdo_adoption_mariadb_copy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c7a0cb4
Add Director Operator mariadb_copy scripts for adoption
pinikomarov 06589ef
add default vars
pinikomarov 7935e9a
fix lint
pinikomarov 6776193
update vars
pinikomarov 14ad911
set org default ns to openstack
pinikomarov c7efd05
Add Director Operator mariadb_copy scripts for adoption
pinikomarov 711b449
add default vars
pinikomarov 482b862
fix lint
pinikomarov a468de0
update vars
pinikomarov 5e4655a
set org default ns to openstack
pinikomarov 65f6013
remove ovrride MARIADB_CLIENT_ANNOTATIONS for NS setting
pinikomarov 033b765
remove ovrride MARIADB_CLIENT_ANNOTATIONS for NS setting
pinikomarov 6f3f31f
remove typo var
pinikomarov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
- name: set OSPdO env vars | ||
block: | ||
- name: register source_mariadb_ip | ||
ansible.builtin.shell: | | ||
oc -n {{ org_namespace }} get cm tripleo-exports-default -o json | jq -r '.data["ctlplane-export.yaml"]'| sed -e '0,/ MysqlInternal/d' | sed -n '0,/host_nobrackets/s/^.*host_nobrackets\:\s*\(.*\)$/\1/p' | ||
register: source_mariadb_ip | ||
|
||
- name: register controller node | ||
no_log: "{{ use_no_log }}" | ||
ansible.builtin.shell: | | ||
oc get vmi -n{{ org_namespace }} -o jsonpath='{.items[0].metadata.labels.kubevirt\.io/nodeName}' | ||
register: controller_node | ||
|
||
- name: register source_db_root_pass | ||
no_log: "{{ use_no_log }}" | ||
ansible.builtin.shell: | | ||
oc get secret -n {{ org_namespace }} tripleo-passwords -o jsonpath='{.data.*}'| base64 -d |grep MysqlRootPassword|sed 's/.*: //g' | ||
register: source_db_root_pass | ||
|
||
- name: set src MariaDB copy shell vars | ||
no_log: "{{ use_no_log }}" | ||
ansible.builtin.set_fact: | ||
mariadb_copy_shell_vars_src: | | ||
MARIADB_IMAGE=quay.io/podified-antelope-centos9/openstack-mariadb:current-podified | ||
STORAGE_CLASS=host-nfs-storageclass | ||
SOURCE_MARIADB_IP={{ source_mariadb_ip.stdout }} | ||
declare -A SOURCE_GALERA_MEMBERS | ||
SOURCE_GALERA_MEMBERS=( | ||
["standalone.localdomain"]={{ source_mariadb_ip.stdout }} | ||
) | ||
SOURCE_DB_ROOT_PASSWORD={{ source_db_root_pass.stdout }} | ||
MARIADB_CLIENT_ANNOTATIONS="-n {{ org_namespace }}" | ||
CONTROLLER_NODE={{ controller_node.stdout }} | ||
|
||
- name: set default NS to {{ rhoso_namespace }} | ||
ansible.builtin.shell: | | ||
oc project {{ rhoso_namespace }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't set this variable here, it will override the setting from
env_vars_src.yaml
. Bothenv_vars_src.yaml
andenv_vars_dst.yaml
are sourced one after another. AFAIU we need to be able to usemariadb_copy_shell_vars_dst
andmariadb_copy_shell_vars_src
together. Also think about how this translates to the docs. There are no distinctions between src/dst vars.MARIADB_CLIENT_ANNOTATIONS
is set once and stays that way.Does the OSPDO use case require running the data copy pods in both namespaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK , I'll leave the MARIADB_CLIENT_ANNOTATIONS as it was before and not override it.
I'll add the correct namespace throughout the needed oc commands...