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

IP address detection on aws without public ip #17

Open
checkelmann opened this issue Oct 14, 2020 · 2 comments
Open

IP address detection on aws without public ip #17

checkelmann opened this issue Oct 14, 2020 · 2 comments

Comments

@checkelmann
Copy link

Hi,

if you try to install keptn on a ec2-instance without a public IP address, it will fail with the following error (provider aws selected):

curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/0.7.1/install-keptn-on-k3s.sh | bash -s - --provider aws --with-dynatrace --with-jmeter --fqdn=keptn.XYZ.com
Provider: AWS
Enabling Dynatrace Support: Requires you to set DT_TENANT, DT_API_TOKEN
Enabling JMeter Support

#######################################>
# Determining IP Address
#######################################>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html> is not a valid ip address

I know when not using the --provider switch, it will work.

Suggestion:
A) Modify the Documentation so it will point out if not using an external IP Address on the instance, to leave the flag
B) Create a fallback mechanism if 404 if returned from the AWS API

Have a good one!

@grabnerandi
Copy link
Contributor

Great suggestion. I suggest that - in case of a 404 we should stop the script and put out a message saying: "Couldnt retrieve public IP of your EC2 instance. Please use --ip and provide the IP you want Keptn on k3s to be using"

thoughts?

@checkelmann
Copy link
Author

What would be an option, if there is a 404 error while curling the AWS API, set the Variable MY_IP to none. Then the default get_ip function will be triggered, and perhaps print out something like "Could not detect public IP, fall back to private IP".

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

No branches or pull requests

2 participants