[OCTRL-1091] Integrate k8s client into ECS core#833
Open
justonedev1 wants to merge 7 commits into
Open
Conversation
29df8e4 to
d161264
Compare
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.
This is actual implementation of the ECS Kubernetes bridge.
Before merging it needs the OCTRL-1090
The goal of this PR was to take existing code that deploys Mesos tasks and adjusts it for the kubernetes client usage, basically linking CRDs defined and managed by managers in control-operator to the existing ECS task infrastructure and classes. The code from managerk8s.go was inspired roughly accroding to this table (generated by llm, but I went through it):
managerk8s.gocreateK8sTaskEntries— InboundChannels loop, IPC endpoint,::globalaliasmakeTaskForMesosResources— same loop, IPC/TCP handling, global aliasscheduler.go:1346buildK8sNodeTaskRefs—O2_ROLE/O2_SYSTEMenv var injection loopmakeTaskForMesosResources—fillEnvDefaultloop for the same two varsscheduler.go:1458buildK8sNodeTaskRefs— ArgsCLI trimming/filteringmakeTaskForMesosResources—cmd.Argumentshandlingscheduler.go:1437newTaskForKubernetesnewTaskForMesosOffermanager.go:169deployKubernetesTasks— overall flowacquireTasks— Mesos deployment blockmanager.go:550configureK8sTasks—BuildPropertyMapper task, global bind mapconfigureTasks— bind map building +BuildPropertyMapsmanager.go:804transitionAndWaitK8sEnvState— send transition, block until state reachedtransitionTasks— send Mesos command, block on responsemanager.go:901killK8sTaskdoKillTaskmanager.go:1238killK8sEnvironmentreleaseTasksmanager.go:733process— route watch event to roster task (called fromwatchK8sTasks)updateTaskState/updateTaskStatusmanager.go:1071watchK8sTasks— retry loop on watcher failurescheduler.gonodeNameFromDescriptor— scan constraints formachine_idSatisfy(targetConstraints)scheduler.go:743k8sEnvRegistry,createK8sEnvironmentCRD,waitForK8sEnvState,cmdEnvToK8sEnvVarsIt contains multiple changes:
controlmodes to distinguish between Kubernetes and Mesos tasksreadout,stfbuilder-senderoutputandstfsender