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

Hub registration using kubeconfig and labels support #785

Merged
merged 19 commits into from
Jan 28, 2021

Conversation

abhinavrau
Copy link
Contributor

Fix for one of the items in #637.

Please review and let me know if this looks good. I will wait for feedback on the tests as there are no integration tests for hub specifically. See comment on 637

@comment-bot-dev
Copy link

comment-bot-dev commented Jan 12, 2021

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

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.

@abhinavrau I had a chance to test this out and unfortunately looks like GKE with kubeconfig does not work.

Registering a non-GKE Cluster. Using current-context to register Hub membership.
ERROR: (gcloud.container.hub.memberships.register) Invalid value for [--context]: --context cannot be used for GKE clusters. Either --gke-uri | --gke-cluster must be specified

Works with a kind cluster so maybe we drop the gke kubeconfig example and just mention in the docs how to to use it with kind? Testing with kind would also probably need some dind setup since all our tests run within a docker image.

modules/hub/scripts/gke_hub_unregister.sh Outdated Show resolved Hide resolved
modules/hub/scripts/gke_hub_registration.sh Outdated Show resolved Hide resolved
abhinavrau and others added 2 commits January 19, 2021 11:46
specify PROJECT_ID to be more specific

Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com>
fix number of arguments check

Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com>
@abhinavrau
Copy link
Contributor Author

abhinavrau commented Jan 20, 2021

@abhinavrau I had a chance to test this out and unfortunately looks like GKE with kubeconfig does not work.

Registering a non-GKE Cluster. Using current-context to register Hub membership.
ERROR: (gcloud.container.hub.memberships.register) Invalid value for [--context]: --context cannot be used for GKE clusters. Either --gke-uri | --gke-cluster must be specified

Works with a kind cluster so maybe we drop the gke kubeconfig example and just mention in the docs how to to use it with kind? Testing with kind would also probably need some dind setup since all our tests run within a docker image.

@bharathkkb Thanks for response and reviewing the code. I have committed your suggested changes. As far as the example with kubeconfig, I have modified the example to use a kind cluster so users can see how to use the hub module with kubeconfig. I understand it will be difficult to do an integration test with dind but is it necessary for all examples to have an integration test? I see there are some examples that don't have an integration test (e.g. examples/simple_zonal_with_acm) so will it be an issue to the have an example using it even though the build process does not run the example?

@bharathkkb
Copy link
Member

@abhinavrau LGTM, we dont need to have an integration test for every example

@bharathkkb bharathkkb merged commit 6a29e62 into terraform-google-modules:master Jan 28, 2021
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