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

Allow Kubeconfig to be more configurable #49

Merged
merged 6 commits into from
Jun 30, 2018
Merged

Allow Kubeconfig to be more configurable #49

merged 6 commits into from
Jun 30, 2018

Conversation

sdavids13
Copy link
Contributor

PR o'clock

Description

Making Kubeconfig significantly more configurable in the following ways:

  • Setting the cluster name to the same value as the EKS cluster (so cluster name doesn't conflict with the old kubernetes naming)
  • Allowing the user name to be modified
  • Allowing the context name to be modified
  • Allowing additional heptio parameters to be specified (useful to be able to specify a role that should be assumed)
  • Allowed environment variables to be specified for the heptio execution, this provided a generic implementation compated to adding capability to use non-default aws profile #44.

Checklist

  • terraform fmt and terraform validate both work from the root and examples/eks_test_fixture directories (look in CI for an example)
  • Tests for the changes have been added and passing (for bug fixes/features)
  • Test results are pasted in this PR (in lieu of CI)
  • Docs have been added/updated (for bug fixes/features)
  • Any breaking changes are noted in the description above

Copy link
Contributor

@brandonjbjelland brandonjbjelland left a comment

Choose a reason for hiding this comment

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

This seems like the most flexible way I've seen thus far to add configuration while still providing a minimal interface to get started. LGTM

@brandonjbjelland brandonjbjelland merged commit 0bbfb04 into terraform-aws-modules:master Jun 30, 2018

variable "kubeconfig_context_name" {
description = "Name of the kubeconfig context."
default = "aws"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should default to the cluster name as aws is very uninformative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I do agree (I configured my context name to be the cluster name as well). I was trying to limit the amount of changes made by default but if others think that is a more reasonable default I would be happy to provide another PR to fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I just found that if you are trying to merge various EKS kubeconfigs together via the KUBECONFIG environment variable the username needs to be unique across all of the config files. So, I will go ahead and make the change for both the context name and the user name.

Copy link
Contributor

Choose a reason for hiding this comment

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

That'd all be appreciated @sdavids13 . Thanks for driving that

@max-rocket-internet
Copy link
Contributor

username needs to be unique across all of the config files

Correct.

I've made a PR: #52

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2022
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.

None yet

3 participants