Repository navigation
feat(workload): port K8s resource management and membership foundations (8/14) - #362
Draft
marceloneppel wants to merge 8 commits into
Draft
marceloneppel wants to merge 8 commits into
marceloneppel wants to merge 8 commits into
Conversation
2 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue
Part of the final charm->library migration (follows the VM stack, PRs #355-#361): the K8s charm still owns its K8s-API resource management and cluster-membership foundations. Final state: no logic charm-side.
Solution
K8sManager(managers/k8s.py) gains the client seam:create_services,patch_pod_labels,check_headless_service,reparent_services_on_stop,cleanup_old_cluster_resources. Port of the K8s charm's section A.ClusterMembershipManagerK8s branches:hosts= pod names;add_members_k8s/add_cluster_member_k8sas separate_k8s-suffixed methods (the VM variants keep the base names); DNS/service-name builders (get_hostname_from_member,get_hostname_by_unit,build_service_name) live here — the K8s workload lacks app/namespace, so the plan's workload/k8s.py destination was deviated (disclosed).PostgreSQLApplication.add/remove_endpoint+endpointswriter.tests/unit/test_k8s_resources.py(12 cases; real lightkube model objects; msgspec-valid ApiError).Checklist