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

[IBCDPE] Split out and start creating items as individual modules #8

Merged
merged 16 commits into from
May 29, 2024

Conversation

BryanFauble
Copy link
Contributor

Problem:

  1. Spotocean controller V2 is not ready, use are using it wrong, or the documentation is incorrect.
  2. We need to start thinking about how we'll organize both modules going into stacks, and the spacelift stacks themselves.

Solution:

  1. Revert to Spotocean controller v1
  2. Start splitting out the spotocean autoscaler to it's own module
  3. Split out airflow into it's own module
  4. Start to create some of the scaffolding for programmatically creating spacelift resources like policy, stack, and policy attachment

Testing:

  1. Will be verifying that I am able to register these modules in the spacelift terraform registry
  2. Will verify that the spot ocean autoscaler correct deploys

@BryanFauble BryanFauble requested a review from a team as a code owner May 28, 2024 17:32
Copy link
Contributor

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

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

🔥 Thanks for working on this - just going to pre-approve, I just have minor comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is nice - thanks for adding this!

@@ -0,0 +1,21 @@
resource "spacelift_policy_attachment" "bfauble-enforce-tags-on-resources" {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should these be named sage instead of bfauble?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we tear down the existing spacelift stacks and move to a totally programmatic approach yes. I named the first stack 'bfauble', and even if you update the display name the ID of the stack is sticky and does not change.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is this for?

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 left this in as scaffolding for how I am thinking we'll organize our spacelift resources. Basically we need:

  1. Modules that define what we can create
  2. Another set of resources that combine those modules in a meaningful way (ie: This is what I am intending this dpe-prod/main.tf to do. This is where we create the individual "stacks" we'll be deploying out.
  3. Another set of spacelift specific resources (Like policies, stacks, contexts) and their relationships. When a spacelift stack is created it requires that you are pointing at a specific VCS location where it's pulling terraform resources from. That VCS location is defining the resources that "this" spacelift stack i going to deploy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have a list of questions you'd like spot to answer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. What terraform modules are required to install the V2 spot ocean components into our EKS cluster?
  2. What dependencies need to be completed, and operational before attempting to install any spot ocean terraform resources?
  3. What does the removal of ocean's terraform resources entail, is everything being properly reset back to the "before" state if removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we currently using these modules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. This is planned future work to start programmatically creating the entire stack within spacelift

main.tf Outdated Show resolved Hide resolved
Comment on lines +102 to +104
desired_size = 1
min_size = 0
max_size = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still something I'd like to figure out, spot claimed on the call that we didn't need a managed node group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the problem is that in order for the add ons to be installed in the first place EKS has to have at least 1 node running as that is where the tools are installed to. This means that in order for the EKS cluster to be "green" it has to have at least a single node.

After this point we can install spot ocean.

Even their docs here: https://github.com/spotinst/terraform-spotinst-ocean-eks?tab=readme-ov-file#following-modules-should-be-used-instead--

Specify that we should:

  1. Use the AWS EKS provider to create an EKS cluster and it's resources
  2. Then install the ocean controllers/k8s

@BryanFauble BryanFauble merged commit 215af13 into main May 29, 2024
5 checks passed
@BryanFauble BryanFauble deleted the IBCDPE-939-organize-modules branch May 29, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants