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

[DPE-3777] Add node port support #264

Merged
merged 8 commits into from
Apr 18, 2024
Merged

[DPE-3777] Add node port support #264

merged 8 commits into from
Apr 18, 2024

Conversation

phvalguima
Copy link
Contributor

@phvalguima phvalguima commented Apr 4, 2024

The node port is created if at least one single unit requests it using external-node-connectivity=True via database relation. Only applications that submit that flag as True receive the nodeport information. Others will receive the internal ClusterIP.

The charm internally checks at update_connection_info() if a given relation needs the NodePort, and updates the service accordingly with patch_port(True).

Periodically, the charm reviews if node port is still necessary. runs: patch_port with external_connectivity output. If all relations are either going away or do not have external-node-connectivity=True, then node port is revoked. This logic is called on all main events changing the state of the charm.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.90%. Comparing base (0c2a151) to head (bd2db0a).
Report is 8 commits behind head on main.

❗ Current head bd2db0a differs from pull request most recent head 7f0e0ec. Consider uploading reports for the commit 7f0e0ec to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #264      +/-   ##
==========================================
- Coverage   72.24%   71.90%   -0.35%     
==========================================
  Files           8        8              
  Lines        1081     1075       -6     
  Branches      185      182       -3     
==========================================
- Hits          781      773       -8     
- Misses        230      235       +5     
+ Partials       70       67       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phvalguima phvalguima marked this pull request as ready for review April 16, 2024 18:16
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

LGTM, but up to @dragomirp here!

]
},
application_name=PGB,
num_units=1,
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed in private, IMHO: we must test 2-3 units here. As in production we have 2+ PGB units for HA.

I believe each client app have to deploy independent mysql-router (for VMs for sure... but I would keep this requirements for K8s as well). Example: pgb normally should be deployen in app mode, so wordpress in model A will have pgb in the same model, but data-integrator will in the DB model OR separate (but outside of model A => different PGB in the real deployment).

Sure, it theory the same PGB should work for 2+ apps... but create a separate bugreport if it is broken here... and we should re-check legacy interface behavior here (app1:psql + app2:postgresql_client => BOOM?).

@phvalguima phvalguima merged commit ce121f4 into main Apr 18, 2024
29 of 34 checks passed
@phvalguima phvalguima deleted the DPE-3777-create-nodeport branch April 18, 2024 05:16
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.

None yet

3 participants