redhat-developer-tooling / openshift-vagrant

All-in-One OpenShift Enterprise Vagrant setup
37 stars 32 forks source link

Trying to access my new website/service from host machine (Mac/VirtualBox) CDK v2 beta 4 #63

Closed alberttwong closed 8 years ago

alberttwong commented 8 years ago

I can access https://10.1.2.2:8443/console just fine. I create a new tomcat application named albert and gives me the url tomcat-albert.cdk.vm. Everything seems to build and deploy correctly but when I click on "tomcat-albert.cdk.vm" URL in console, it gives me a page not found. I thought that the host would bridge into the OSE network. Am I missing something? Using cdkv2 beta 4 on Mac and Virtualbox.

alberttwong commented 8 years ago

It doesn't look like any DNS was inserted into the Mac host networking.

hferentschik commented 8 years ago

Did you change any defaults? Per default we are using xip.io for routing atm. So in the default setup you should have something like _tomcat-albert.10.1.2.2.xip.io) which will solve your routing problem. xip.io is atm the only cross platform solution for getting routing to work. On OS X you can you Landrush for routing as well, but that is not configured per default. If you install the Landrush plugin and add something like below, you should be able to get things to work as well:

config.landrush.enabled = true

config.landrush.host 'cdk.vm', "#{PUBLIC_ADDRESS}" config.landrush.guest_redirect_dns = false

alberttwong commented 8 years ago

I can ping _tomcat-albert.10.1.2.2.xip.io but when I use http://_tomcat-albert.10.1.2.2.xip.io I get a connection reset.

alberttwong commented 8 years ago

I also configured landrush and I can't "ping tomcat-albert.cdk.vm". Gives me "unknown host".

Alberts-MacBook-Pro:rhel-ose alwong$ ping tomcat-albert.cdk.vm
ping: cannot resolve tomcat-albert.cdk.vm: Unknown host
Alberts-MacBook-Pro:rhel-ose alwong$ ping cdk.vm
ping: cannot resolve cdk.vm: Unknown host
alberttwong commented 8 years ago
Alberts-MacBook-Pro:rhel-ose alwong$ vagrant landrush list
rhel-ose.vagrant.dev            172.17.42.1
1.42.17.172.in-addr.arpa        rhel-ose.vagrant.dev
cdk.vm                  10.1.2.2
2.2.1.10.in-addr.arpa           cdk.vm
alberttwong commented 8 years ago

snip

  config.vm.provider "libvirt" do |v, override|
    v.driver = "kvm"
    v.memory = 1024
    v.cpus   = 2
  end

  config.vm.network "private_network", ip: "#{PUBLIC_ADDRESS}"

config.landrush.enabled = true
config.landrush.host 'cdk.vm', "#{PUBLIC_ADDRESS}"
config.landrush.guest_redirect_dns = false

  config.vm.provision "shell", inline: <<-SHELL
    sudo systemctl enable openshift
    sudo systemctl start openshift
  SHELL

end
burrsutter commented 8 years ago

Albert, "user" questions should really be on containers-tools@redhat.com as that draws in a larger crowd of users who have fought through some issues. Note: if you are in a Red Hat office, in many cases the xip.io solution does not work. I have a series of steps documented I can share with you that work well for me but I mostly use Node.js for testing.

On Wed, Feb 24, 2016 at 6:31 PM, Albert Wong notifications@github.com wrote:

snip

config.vm.provider "libvirt" do |v, override| v.driver = "kvm" v.memory = 1024 v.cpus = 2 end

config.vm.network "private_network", ip: "#{PUBLIC_ADDRESS}"

config.landrush.enabled = true config.landrush.host 'cdk.vm', "#{PUBLIC_ADDRESS}" config.landrush.guest_redirect_dns = false

config.vm.provision "shell", inline: <<-SHELL sudo systemctl enable openshift sudo systemctl start openshift SHELL

end

— Reply to this email directly or view it on GitHub https://github.com/redhat-developer-tooling/openshift-vagrant/issues/63#issuecomment-188514194 .

alberttwong commented 8 years ago

@burrsutter Is this the right place for CDK v2 beta 4 issues?

alberttwong commented 8 years ago

So after trying out a bunch of settings, it seems this works.

config.landrush.enabled = true
config.landrush.tld = 'cdk.vm'
config.landrush.host 'cdk.vm', "#{PUBLIC_ADDRESS}"
bexelbie commented 8 years ago

@alberttwong I am glad you got this working, however the plan is not ship landrush with the CDKv2 GA at this time. If you are using https://github.com/redhat-developer-tooling/openshift-vagrant/blob/master/cdk-v2/Vagrantfile you should get the xip.io solution. (with assist to @praveenkumar)

hferentschik commented 8 years ago

I can ping _tomcat-albert.10.1.2.2.xip.io but when I use http://_tomcat-albert.10.1.2.2.xip.io I get a connection reset.

So you can. All xip.io is doing is to return the IP encoded in the URL. So you are pinging 10.1.2.2. To make the app work, you need to make sure that the route for the app is also set to tomcat-albert.10.1.2.2.xip.io . In our case the route is probably tomcat-albert.cdk.vm.

config.landrush.host 'cdk.vm', "#{PUBLIC_ADDRESS}"

Right, you need the config.landrush.host. My wrong. I gave you the wrong config.

If you are using https://github.com/redhat-developer-tooling/openshift-vagrant/blob/master/cdk-v2/Vagrantfile you should get the xip.io solution.

Right, you never answered my original question. Provided you used the setup as given in this repo, you should have had xip.io as default. You must use a modified or different Vagrantfile.

Anyways, it seems you got it working.

Closing this issue.

alberttwong commented 8 years ago

@hferentschik @bexelbie I'm using CDK v2 beta 4 and it seems that the xip.io isn't configured for it OOTB. Landrush seems to be my only easy answer. Since CDK v2 GA isn't out for everyone yet, what do I need to do to config my beta 4 to use xip.io? and how do I change my route from tomcat-albert.cdk.vm to _tomcat-albert.10.1.2.2.xip.io? I was only picking defaults in the web console (which I assume that is what others will do).

hferentschik commented 8 years ago

I'm using CDK v2 beta 4 and it seems that the xip.io isn't configured for it OOTB

No, but the Vagrantfile together with the provisioning scripts in this repo are doing exactly this. At least up to this commit https://github.com/redhat-developer-tooling/openshift-vagrant/commit/43e1681782702c1dabcd2d6eee0446b793c43878. On master we are now making use of the systemd OpenShift service provided by the CDK. Also, the setup in this repository actually downloads the box for you. It is meant to be used with the box referenced in the Vagrantfile. If you are using a different box file and/or different Vagrantfile you are discussing things at the wrong place.

Landrush seems to be my only easy answer

Nope, CDK 2 Beta4 can be provisioned with xip.io just fine.

what do I need to do to config my beta 4 to use xip.io

reset the repo to https://github.com/redhat-developer-tooling/openshift-vagrant/commit/5e864fad934cdd1366701c20152460bee67829c5 and use the _configuredocker.sh and _configureose.sh scripts. It's all in there. Your will needs to configure the default route of the OpenShift in the master-config.yaml. On that note. When creating an app, you can with most templates provide a custom route (in which case the default won't be used). Or you use oc edit to change your route - oc edit route/<name>.

alberttwong commented 8 years ago

reset the repo to 5e864fa and use the configure_docker.sh and configure_ose.sh scripts.

Okay... I can do that. I don't see any instruction on the configure_docker.sh and configure_ose.sh scripts and those files don't exist in the beta 4 zip file.

If you give me the missing instructions (https://access.redhat.com/documentation/en/red-hat-enterprise-linux-atomic-host/7/container-development-kit-installation-guide/chapter-2-installing-the-cdk-on-mac-os-x and https://access.redhat.com/documentation/en/red-hat-enterprise-linux-atomic-host/7/container-development-kit-installation-guide/chapter-5-using-the-rhel-cdk) I can open a BZ and have the documentation reflect this.

alberttwong commented 8 years ago

@hferentschik Maybe I am talking in the wrong place. Do you know where we talk about CDK v2 beta 4 issues and submit pull requests for it to help others?

hferentschik commented 8 years ago

Okay... I can do that. I don't see any instruction on the configure_docker.sh and configure_ose.sh scripts and those files don't exist in the beta 4 zip file.

You are at the wrong place.

Do you know where we talk about CDK v2 beta 4 issues

That depends. There are many repositories involved to pull the CDK together. You might want to look at https://github.com/projectatomic/adb-atomic-developer-bundle since it is the upstream project of the CDK.

and submit pull requests for it to help others?

Where a pull request needs to be opened will depend on the issue. As said, there are multiple repositories involved. As @burrsutter was saying you might want to try the mailing list - containers-tools@redhat.com

BTW, Beta4 is quite old. We have progressed quite a bit from there. If you are purely testing the Beta4 zip bundle, there is a good chance that you run into issues which are already resolved. If you want to help out and have access to the VPN, I'd recommend you test a weekly build.

alberttwong commented 8 years ago

Got it. I'll move this discussion to adb.

For others who have questions on beta 4, here's something I wrote - https://access.redhat.com/articles/2178581