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

ACM: Wait for gatekeeper & Hub: expose module_depends_on #689

Merged
merged 13 commits into from
Oct 1, 2020
Merged

ACM: Wait for gatekeeper & Hub: expose module_depends_on #689

merged 13 commits into from
Oct 1, 2020

Conversation

cloud-pharaoh
Copy link
Contributor

@cloud-pharaoh cloud-pharaoh commented Sep 23, 2020

While using the hub submodule we ran into issues where if ACM was installed on a cluster with policy controller enabled (currently default behavior), gatekeeper would cause issues if it were not ready prior to hub registration or ASM install.

This PR does the following:

  1. Added a kubectl_wrapper to ACM module with a wait_for_gatekeeper.sh script that ensures that the deployment and service that cause issues with ASM and Hub are ready.
  2. Exposed a wait variable for ACM that is either the operator being deployed or wait_for_gatekeeper.sh reporting both are ready.
  3. Exposed module_depends_on variable for Hub module to be able to add the acm.wait variable there.

@comment-bot-dev
Copy link

comment-bot-dev commented Sep 23, 2020

Thanks for the PR! 🚀
✅ Lint checks have passed.

kubectl --context "$1" -n "$2" get deploy "$3" &> /dev/null
export exit_code=$?
done
echo -e "Deployment $3 in cluster $1 created."
Copy link
Member

Choose a reason for hiding this comment

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

Can we not just do kubectl wait --for=condition=available --timeout=600s deployment/foo

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 tested a few times with kubectl wait and it did not work. There were other issues as well so it might not have been the most scientific testing strategy :) I can go back and test it if you think it is cleaner.

I ended up leaving it in as the service one required a "custom" check.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should try for the native wait if possible, although not a blocker. Yeah unfortunately we cant do that for svc.

@morgante
Copy link
Contributor

gatekeeper would cause issues if it were not ready prior to hub registration or ASM install

Can you explain more about issues? I'm a little hesitant about why we need to solve this in the Terraform module.

@morgante
Copy link
Contributor

Resolved offline - this change LGTM assuming @bharathkkb signs off.

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

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

LGTM

@morgante
Copy link
Contributor

morgante commented Oct 1, 2020

@bharathkkb Any reason not to merge?

@bharathkkb bharathkkb merged commit 26ea28d into terraform-google-modules:master Oct 1, 2020
AditModi added a commit to AditModi/terraform-google-kubernetes-engine that referenced this pull request Oct 5, 2020
feat: ACM - Wait for gatekeeper & Hub: expose module_depends_on (terraform-google-modules#689)
CPL-markus pushed a commit to WALTER-GROUP/terraform-google-kubernetes-engine that referenced this pull request Jul 15, 2024
…aform-google-modules#689)

* wait for gatekeeper if policy controller is enabled

* destroy command

* forgot the var

* use deployment ready

* add context

* more wait

* webhook

* depends_on

* concat modules

* depends on

* terraform format

* update docs

* shell check
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.

None yet

4 participants