opendatacube / datacube-k8s-eks

Deploy a production scale datacube cluster on AWS using EKS
Apache License 2.0
21 stars 14 forks source link

Tf 013 update #249

Closed woodcockr closed 3 years ago

woodcockr commented 3 years ago

Why this change is needed

Updates to support TF 0.13 and new Providers

Negative effects of this change

Will making this change break or change an existing functionality? flag it here

Fixes #247 Fixes #244

woodcockr commented 3 years ago

This is WIP and currently I'm using with TF 0.12.x with updated Providers. Change over to TF 0.13 will occur soon enough but small steps are required to detect the impact of changes.

woodcockr commented 3 years ago

Branch now works with TF 0.13 and current Providers against the CSIRO live TF repo. Still need to work on the datacube-k8s-eks example and also setup the module dependencies which may eliminate the need for the separation into workspaces based on what I've seen from the update so far. (just a little local-exec hacking required to ensure the EKS cluster is actually available after its been created).

woodcockr commented 3 years ago

@NikitaGandhi @whatnick This PR is now successfully working with my live dev TFE environment. I'm not updated the examples as we have a decision to make. A combination of the upgrades to Providers, TF 0.13.5 and the EKS endpoint ready check (commit 0fdeb51) means it is now possible to deploy (and destroy) the entire set of components from a single TF workspace rather than the current break up into several. Those involved in the TF 0.11/0.12 ports will remember this wasn't possible previously. It's actually a lot quicker and more robust to do this. Interestingly the changes will still work with old way as the single vs multiple workspaces is determined by the live repo configuration not the modules.

I believe it would be better to go the single live repo version and supply that as the example configuration. I intend on going this way since it has no impact on the modules themselves.

What's your thoughts?

NikitaGandhi commented 3 years ago

@NikitaGandhi @whatnick This PR is now successfully working with my live dev TFE environment. I'm not updated the examples as we have a decision to make. A combination of the upgrades to Providers, TF 0.13.5 and the EKS endpoint ready check (commit 0fdeb51) means it is now possible to deploy (and destroy) the entire set of components from a single TF workspace rather than the current break up into several. Those involved in the TF 0.11/0.12 ports will remember this wasn't possible previously. It's actually a lot quicker and more robust to do this. Interestingly the changes will still work with old way as the single vs multiple workspaces is determined by the live repo configuration not the modules.

I believe it would be better to go the single live repo version and supply that as the example configuration. I intend on going this way since it has no impact on the modules themselves.

What's your thoughts?

LGTM. As you have suggested, we have manage to improve resource dependencies in more control manner, we can update explample to reflect the same. Also example can be restructure like - 00_: backend init 01_: core AWS infrastructure setup for odc 02_: kubernetes app configs for odc

NikitaGandhi commented 3 years ago

@woodcockr we are good to merge this PR.

Troubleshoot/Issues during upgrade:

  1. odc_eks module fails on certificate_validation update Rerun the pipeline will fix issue - time race between delete and create

  2. odc_k8s module fails on Error: Provider configuration not present

    • keep the current terraform version 0.12.x
    • create a seperate branch
    • add back the provider.tf
    • run the pipeline to delete unwanted resources
    • point totf-10-update (this) branch
    • upgraded live repo terraform version to 1.13.5
woodcockr commented 3 years ago

@NikitaGandhi Okay. I'm still testing out the alternate number of live workspace options. Little impact here but I want to complete that before merging because it may reveal a few more things to tweak.