Skip to content
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

feat(metadata): use manifest to drive config #1701

Merged
merged 8 commits into from
Aug 11, 2021
Merged

Conversation

williamhaley
Copy link
Contributor

@williamhaley williamhaley commented Aug 5, 2021

Jira Ticket: HP-291, HP-320

New Features

  • Create configuration scripts for metadata-service

Improvements

  • Move aggregate MDS configuration to our standard manifest config process

Deployment changes

  • Remove USE_AGG_MDS and AGG_MDS_NAMESPACE from Gen3Secrets/g3auto/metadata/metadata.env and set those variables in a manifest: {} block in manifest.json
  • Migrate the appropriate agg MDS config to the relevant manifest repo under a metadata/aggregate_config.json path
  • Run gen3 kube-setup-metdata and roll the metadata service in Kubernetes

jawadqur
jawadqur previously approved these changes Aug 5, 2021
Copy link
Contributor

@jawadqur jawadqur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

subPath: metadata.env
- name: config-volume
readOnly: true
mountPath: /aggregate_config.json
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to do one thing at a time, but in conjunction with this PR we should update the cdis-manifest entries as needed add an aggregate_config.json file per-commons. I'll work on the automated process/init process for importing data automatically on a roll or whatever, but the immediate change would be...

kubectl exec $(gen3 pod metadata) -- python /src/src/mds/populate.py --config /aggregate_config.json --hostname esproxy-service --port 9200

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have this in an init-container instead? The init-container can run this before starting the service.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's no config then init container will exit 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I think you're right. I was going to wait to do https://ctds-planx.atlassian.net/browse/HP-287, but I think I may as well do this while I'm updating the rest of it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamhaley
Copy link
Contributor Author

Took a little longer (a bit of bash trial and error) but see latest @jawadqur. Updates were made to add an init container like you suggested. Seems to be working properly to exit 0 if not configured properly or run the import as needed so that a gen3 roll metadata is all that's needed to do an import

@williamhaley williamhaley force-pushed the feat/metadata branch 2 times, most recently from 3c175f6 to cc98989 Compare August 6, 2021 15:15
Will added 2 commits August 6, 2021 10:16
This feature is more complicated than can be easily done for the current
PR and needs more consideration
@williamhaley
Copy link
Contributor Author

Taking functionality for https://ctds-planx.atlassian.net/browse/HP-287 out of this PR. This work is more complex than should be taken on here and impacting the scope. We can't easily run the agg MDS import on post init or in an init container because an agg MDS may refer to its own non-agg MDS as a datasource. Chicken and the egg. This probably best belongs in application code and not in k8s config

jawadqur
jawadqur previously approved these changes Aug 6, 2021
@jawadqur
Copy link
Contributor

jawadqur commented Aug 6, 2021

Taking functionality for https://ctds-planx.atlassian.net/browse/HP-287 out of this PR. This work is more complex than should be taken on here and impacting the scope. We can't easily run the agg MDS import on post init or in an init container because an agg MDS may refer to its own non-agg MDS as a datasource. Chicken and the egg. This probably best belongs in application code and not in k8s config

Makes sense, let's revisit later.

@williamhaley
Copy link
Contributor Author

williamhaley commented Aug 11, 2021

@themarcelor @mfshao regarding our offline conversation around backwards compatibility, I've found that using optional volumes for k8s does seem to work as expected in an array of situations and I believe this PR now covers the current state and future state

Testing

The various configuration mechanisms were toggled/deleted while I did a gen3 roll all to validate the health of metadata.

All scenarios worked without issue.

The metadata.env changes that are now deprecated were like so...

USE_AGG_MDS=true
AGG_MDS_NAMESPACE=my_namespace

g3auto secrets and configs would be synced like so (using the appropriate branch) ...

MANIFEST_BRANCH=master gen3 kube-setup-metadata

Configs and secrets were cherry-picked for deletion and verified like so ...

g3kubectl delete secret metadata-config ; g3kubectl delete configmap manifest-metadata
gen3 secrets decode metadata-g3auto ; gen3 secrets decode metadata-config ; g3kubectl get configmap manifest-metadata -o json
gen3 secrets sync

Service status was verified like so ...

kubectl describe pod $(gen3 pod metadata)
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| config in metadata.env | metadata-config | manifest-metadata | manifest MDS config  | manifest agg mds conf | cloud automation | mds image        |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds disabled       | non-existent    | non-existent      | non-existent         | not defined           | master           | master           |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds enabled        | non-existent    | non-existent      | non-existent         | not defined           | master           | feat_mds-adapter |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds disabled       | non-existent    | non-existent      | non-existent         | not defined           | feat/metadata    | master           |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds disabled       | non-existent    | auto-populated    | agg mds disabled     | not defined           | feat/metadata    | master           |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds disabled       | non-existent    | auto-populated    | agg mds enabled      | not defined           | feat/metadata    | master           |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds disabled       | non-existant    | auto-populated    | agg mds enabled      | not defined           | feat/metadata    | feat_mds-adapter |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds disabled       | auto-populated  | auto-populated    | agg mds enabled      | defined               | feat/metadata    | feat_mds-adapter |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+
| agg mds disabled       | deleted         | deleted           | agg mds enabled      | defined               | feat/metadata    | feat_mds-adapter |
+------------------------+-----------------+-------------------+----------------------+-----------------------+------------------+------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants