Simplify the 0-hardware stage to not use a separate module#45
Draft
jpolchlo wants to merge 2 commits into
Draft
Conversation
added 2 commits
February 14, 2023 11:00
…ed elsewhere, and so the benefits of being a separate module were questionable; in the end, however, I didn't really gain much from defctoring it, as it didn't make it possible to again use the kubernetes provider in the setup of this stage; though I did figure out how to get around this, that solution is independent of the defactor (cold start flag); this would be much easier to swallow if this change did not require a complete tear-down and rebuild of the cluster to put into use
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.
At an early stage of development, it was thought that this repository would provide more general tools for devs to create kubernetes clusters. Over its lifetime, though, it has become clear that we're not going to be proliferating many clusters, and that even when we do create new cluster deployments, there will always be a common core of functionality that we then hang applications off of.
As a result of this history, most of the functionality of the
0-hardwarestage is actually delegated to theinfrastructuremodule. This is not a critical failure, causing only mild irritation in the development cycle. What is more troublesome is that examples of creating these clusters often rely on using thekubernetesprovider to finish the configuration of the cluster, and this relies on using outputs from the EKS module. There is a circularity here in terms of dependencies, and it is usually considered bad form to have provider configurations be dependent on the output of resources anyhow.I solved this, originally, by separating out non-application setup into the
0-hardwareand1-servicesstages. This works but is annoying. It's also a bit of an incomplete solution, since some k8s configuration has to be done to complete the configuration of the cluster itself. This is most noticeable with respect to managing the list of users/roles to give access to the cluster, which can require the creation of (Cluster)RoleBindings, which would have to be done using a provider (eitherkubernetesorkubectl) which relies on the outputs of the EKS module.I'm offering this PR as a means to simplify the structure of this repository, but it's not without it's problems. It does not eliminate the circular dependency raised by the need to supply configurations to whichever k8s provider is in use. It also requires a complete tear-down of any existing cluster using the old module-based code. Trying to simply apply this to an existing cluster will break everything, because the old cluster will be torn down as part of the change.
These are not insignificant costs, and it's not at all clear that this is worth the trouble of pulling down running clusters just to get a simpler tree. Furthermore, we didn't solve the problem of a complex startup; it's still convoluted:
0-hardwarestage with thecold_startvariable set to true1-servicesstage (which creates the role bindings that will be needed for user/role management)0-hardwarestage with cold_start set to falseFor new deployments, this will probably seem worth it, but for old deployments, it's not worth the squeeze. As such, this PR should probably sit in draft status until it appears that it is worth the pain. New deployments can feel free to use it as it does seem like it will be merged in the long-term.
Closes #9
Closes #21
Closes #22