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

AWS: make it possible to disable minion public ip assignment #7928

Merged
merged 4 commits into from May 8, 2015

Conversation

manolitto
Copy link
Contributor

This patch makes it possible to disable the automatic assignment of a public IP when launching minions. The feature can be controlled by setting the env variable KUBE_ENABLE_MINION_PUBLIC_IP to "false" (instead of "true" - which is the default value).

Use case scenario:

  • preconfigured VPC
  • your local client is able to communicate with the VPC by means of a VPN connection
  • internet access from the VPC is routed to the internet gateway by means of a NAT instance
  • you do not want a public IP on your minions for security reasons

@roberthbailey
Copy link
Contributor

/cc @justinsb

@roberthbailey roberthbailey self-assigned this May 7, 2015
@roberthbailey
Copy link
Contributor

LGTM. Will merge in the morning unless @justinsb has any comments to add.

@@ -98,7 +106,12 @@ function detect-master () {
function detect-minions () {
KUBE_MINION_IP_ADDRESSES=()
for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
local minion_ip=$(get_instance_public_ip ${MINION_NAMES[$i]})
local minion_ip
if [[ "ENABLE_MINION_PUBLIC_IP" == "true" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Probably a $ missing there :-)

@justinsb
Copy link
Member

justinsb commented May 8, 2015

This LGTM, other than the comment about the comparison missing a $.

It would be great to add this option to cluster/aws/options.md, but I don't think that should block a merge.

I suspect this will actually surface some more problems, because I'm not certain that our networking address choosing logic will tolerate this, but really we won't find those until we merge this, and then we should fix those (hypothetical) problems anyway. (And users must opt-in to the new behaviour).

@manolitto
Copy link
Contributor Author

bad mistake, that missing $ - sorry...
fixed and added docs to options.md

@@ -542,6 +555,14 @@ function kube-up {
grep -v "^#" "${KUBE_ROOT}/cluster/aws/templates/format-disks.sh"
grep -v "^#" "${KUBE_ROOT}/cluster/aws/templates/salt-minion.sh"
) > "${KUBE_TEMP}/minion-start-${i}.sh"

local public_ip_option
if [[ "ENABLE_MINION_PUBLIC_IP" == "true" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Oops... here too.

While you're at it, you probably should do "${ENABLE_MINION_PUBLIC_IP}" (i.e. add curly brackets) - I think it's more in keeping with our bash style.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't mention the non-quoted/curly braced variables because it kept the same style as the rest of the file, but it would be nice to make them more consistent with our bash style so that these typos are easier to see.

@justinsb
Copy link
Member

justinsb commented May 8, 2015

Thanks for adding docs. I found another instance of the problem, but once that is fixed LGTM.

@manolitto
Copy link
Contributor Author

oh no... thanks for your attention and patience @justinsb. fixed.

@justinsb
Copy link
Member

justinsb commented May 8, 2015

LGTM :-)

@roberthbailey
Copy link
Contributor

Travis is happy; merging.

roberthbailey added a commit that referenced this pull request May 8, 2015
AWS: make it possible to disable minion public ip assignment
@roberthbailey roberthbailey merged commit a7bb598 into kubernetes:master May 8, 2015
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