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

Document CATTLE_AGENT_IP #55

Closed
ibuildthecloud opened this issue Jan 26, 2015 · 8 comments
Closed

Document CATTLE_AGENT_IP #55

ibuildthecloud opened this issue Jan 26, 2015 · 8 comments

Comments

@ibuildthecloud
Copy link
Contributor

Refer to #54, this needs to be documented.

@feliksik
Copy link

I tries reverse engineering a little bit, but didn't work it out immediately.

Be aware of the following: The url that is generated by the server UI and should be executed on agent host, in order to start agent, seems te be based on the host/ip used by the browser. The agents will then try to contact the server on same socket.

This is not necessarily the way people want to use rancher. I envision accessing the server through a public IP, and having the agents behind a firewall, contacting the server on an internal network.

@feliksik
Copy link

A note on incorrect IP detection (related to #110 and #112): Also note that in my case, chrome is contacting http://172.17.42.1/?token=.... when I try to execute a shell in a container. 172.17.42.1 is actually the IP of the docker0 interface on the host machine, which is probably never what you want to use as the external IP address.
With other hosts it does correctly detect the ip.

@deniseschannon
Copy link

@feliksik I'm going to close this issue as we've documented how to override the IP in our FAQs. https://github.com/rancherio/rancher/wiki/FAQs-about-Rancher/

As for your comments, I have created a separate issue for the idea of a public IP on the server and agents behind the firewall.

@roynasser
Copy link

If I'm not mistaken there is an error in the FAQ. The -e CATTLE_AGENT_IP=x.x.x.x must be added previously on the docker command, and not at the end as is described in the FAQ... at least for me it didnt work... maybe it works for others? (using coreos alpha here so dont know if its something new in docker).

Anyways, there was a digitalocean article that had an example of putting the -e argument before the volume arguments, and that did the trick... just a headsup...

Trying exactly as in the FAQ it was giving me: "Unable to find image '–e:latest' locally" as if it was looking for the image instead of using that as a last parameter...

@deniseschannon
Copy link

@RVN-BR It says that it must be added to the docker command. In the example in the FAQ, you can see the location of where the option is added.

Here is the example in the docs:

sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock –e CATTLE_AGENT_IP=x.x.x.x rancher/agent:v0.5.2 http://MANAGEMENT_IP:8080/v1/scripts/SECURITY_TOKEN

At the time of writing, it was assumed that most users would know to add the options before the image name (i.e. rancher/agent).

But I am now updating to clarify that it must be listed with the other options.

@roynasser
Copy link

I have used env and other arguments before...the issue here is that the -e could not be the last argument BEFORE the image name. It just ignored the image name taking "-e" as an image name..... Flipping the -e arg (along with the var name and value) to before the -v argument worked.... So evwn for people who did know how to use it there was some inconsistency in the example (perhaps some versions of docker are picky abt argument orders)...who knows

@deniseschannon
Copy link

Thanks for the note. I've updated all places in the documentation so that all examples show the -e before the -v.

@ferhimedamine
Copy link

@deniseschannon is there a way apply the fix from the UI .. as i am using the machine driver to provision my hosts on aws.

JeffersonBledsoe pushed a commit to JeffersonBledsoe/rancher-cli that referenced this issue Apr 28, 2022
anders-swanson referenced this issue in verrazzano/rancher Jan 19, 2023
Update kubectl in rancher and rancher-agent image
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

5 participants