Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

terraform: use kubectl_manifest #1262

Merged
merged 1 commit into from
Jan 5, 2022
Merged

terraform: use kubectl_manifest #1262

merged 1 commit into from
Jan 5, 2022

Conversation

tgeoghegan
Copy link
Contributor

The kubernetes_manifest resource in provider hashicorp/kubernetes
has a known issue[1] where resources created in a manifest can't depend
on other resources that don't exist yet. To work around this, we instead
use gavinbunney/kubectl's kubectl_manifest resource, which does not
have this problem because it uses a different mechanism for planning.

[1] hashicorp/terraform-provider-kubernetes#1380

Resolves #1088

The `kubernetes_manifest` resource in provider `hashicorp/kubernetes`
has a known issue[1] where resources created in a manifest can't depend
on other resources that don't exist yet. To work around this, we instead
use `gavinbunney/kubectl`'s `kubectl_manifest` resource, which does not
have this problem because it uses a different mechanism for planning.

[1] hashicorp/terraform-provider-kubernetes#1380

Resolves #1088
@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2022

Codecov Report

Merging #1262 (cfe13c7) into main (048d8be) will not change coverage.
The diff coverage is n/a.

❗ Current head cfe13c7 differs from pull request most recent head f6e572b. Consider uploading reports for the commit f6e572b to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1262   +/-   ##
=======================================
  Coverage   58.36%   58.36%           
=======================================
  Files          38       38           
  Lines        7397     7397           
=======================================
  Hits         4317     4317           
  Misses       2972     2972           
  Partials      108      108           
Flag Coverage Δ
facilitator_tests 60.56% <ø> (ø)
key_rotator_tests 57.58% <ø> (ø)
workflow_manager_tests 38.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 048d8be...f6e572b. Read the comment docs.

@tgeoghegan
Copy link
Contributor Author

Pulling in another TF provider just to work around a bug in the Hashicorp provider isn't ideal, but the alternative would have been to introduce a multi-stage Terraform process so that we could guarantee that all Kubernetes namespaces already exist before we try to deploy a manifest, so I think this is better.

@tgeoghegan tgeoghegan merged commit 402d41f into main Jan 5, 2022
@tgeoghegan tgeoghegan deleted the timg/metric-manifests branch January 5, 2022 18:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't plan or apply kubernetes_manifest resources unless Kubernetes namespace already exists
3 participants