Comments (6)
I assume this is related to the issue I was having - I spun up the single-node Vagrant instance, and went through the whole multi-tier app configuration, without much issue. However I was unable to access the guestbook app in my browser, and I assume it's related to Vagrant port forwarding. I tried a few different changes to the Vagrantfile
networking, but am unable so far to be able to access it.
Some documentation (or perhaps there's some way to handle this automatically) would be helpful. Here's my kubernetes services, if someone could provide a pointer on how I need to update vagrant:
mwarkentin@Michaels-iMac kubernetes (master) $ kubectl get services
NAME LABELS SELECTOR IP(S) PORT(S)
guestbook app=guestbook app=guestbook 10.3.0.96 3000/TCP
kubernetes component=apiserver,provider=kubernetes <none> 10.3.0.1 443/TCP
redis-master app=redis,role=master app=redis,role=master 10.3.0.57 6379/TCP
redis-slave app=redis,role=slave app=redis,role=slave 10.3.0.66 6379/TCP
I tried the following changes, but was still unable to view it on http://localhost:3000
:
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.network "forwarded_port", guest_ip: "10.3.0.96", guest: 3000, host: 3000
from coreos-kubernetes.
You should be able to reach the guestbook via the service NodePort on your vagrant node (no additional port forwarding needed).
The example should have set up a service with a NodePort, which you should be able to see with:
$ kubectl describe service guestbook
Name: guestbook
Namespace: default
Labels: app=guestbook
Selector: app=guestbook
Type: LoadBalancer
IP: 10.3.0.159
Port: <unnamed> 3000/TCP
NodePort: <unnamed> 30635/TCP
Endpoints: 10.2.10.3:3000,10.2.10.4:3000,10.2.10.5:3000
Session Affinity: None
No events.
The NodePort will be randomly assigned from the range 30000-32676, so in your case the nodeport will likely be different.
Then from your local machine's browser, you should be able to see the guestbook via http://172.17.4.99:<nodeport>
from coreos-kubernetes.
Also, for more detail on NodePorts & external services: http://kubernetes.io/v1.0/docs/user-guide/services.html#external-services
from coreos-kubernetes.
@aaronlevy Thank you, I'll give that a shot!
from coreos-kubernetes.
That worked! Might be helpful to have something about that in the docs. 😄
from coreos-kubernetes.
Glad it worked. I just went through the upstream guestbook docs, and it does seem a little confusing because there is no mention of the nodeport (which is necessary for platforms that do not support cloud-provider loadbalancers). I'll open a ticket to add some documentation around this.
from coreos-kubernetes.
Related Issues (20)
- multi-node/generic/: Unexpected error configuring flannel pod network on VPS
- Multi-node: GuaranteedUpdate of /registry/minions/<NODE> failed because of a conflict
- configuration option for kubelet
- vagrant up fails with "sed: can't read /usr/lib/systemd/system/docker.service: No such file or directory" HOT 1
- Output: mount: unknown filesystem type 'glusterfs'
- Why I use calico in kubernetes, but still kubelet try to look for flannel?
- CoreOS hyperkube v1.9.0_coreos.0: No ipset utility, IPVS proxy mode fails HOT 17
- No hyperkube for v1.7.12? HOT 3
- Container Linux, kubernetes and CRI-O HOT 1
- Conformance tests use github.com/jteeuwen/go-bindata
- /usr/bin/kubelet: No such file or directory on 1662
- Calico Pod CrashLoopBackOff on Worker Nodes
- hyperkube 1.8.8 image? HOT 2
- kubeadm cluster-ip unreachable HOT 1
- Kubelet-Wrapper does not see mounts below hostmount HOT 1
- r
- hyperkube new 1.10.11 version ?
- 2079.3.0 did have changes -- all network device names were renamed
- vagrant example cluster are failing to deploy
- kubelet-wrapper fails to start kubelet on k8s 1.17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coreos-kubernetes.