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

Pod cannot access its own Service #1964

Closed
GamerJosh opened this issue Sep 14, 2017 · 2 comments
Closed

Pod cannot access its own Service #1964

GamerJosh opened this issue Sep 14, 2017 · 2 comments

Comments

@GamerJosh
Copy link

GamerJosh commented Sep 14, 2017

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Bug

Please provide the following details:

Environment:

Minikube version: v0.21.0

  • OS: Windows 7
  • VM Driver: virtualbox
  • ISO version: minikube-v0.23.0.iso
  • Install tools:
  • Others:
    -- kubectl version:
    Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0", GitCommit:"d3ada0119e776222f11ec7945e6d860061339aad", GitTreeState:"clean", BuildDate:"2017-06-29T23:15:59Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"windows/amd64"}
    Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0", GitCommit:"d3ada0119e776222f11ec7945e6d860061339aad", GitTreeState:"clean", BuildDate:"2017-07-26T00:12:31Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
    -- docker-machine version:
    docker-machine.exe version 0.12.2, build 9371605
    -- VirtualBox Version:
    5.1.26 r117224 (Qt5.6.2)

What happened:
I created a Deployment and related Service. I can access the resulting Pod via the Service name from other Pods, but not from the Pod that the Service references. (I cannot call myself.)

What you expected to happen:
I should be able to make requests to myself using my service name.

How to reproduce it (as minimally and precisely as possible):

  • Deploy the below referenced yaml file which creates two deployments, and one Service that references only the first Deployment.
  • Exec into the python2 Pod and verify that it's possible to curl the python image (verifying the Service is working).
  • Exec into the python Pod and attempt (but fail) to curl yourself.
  • The curl command that should work: curl python:12345 --connect-timeout 10

deploy_python.yaml
`---
apiVersion: v1
kind: Service
metadata:
name: python
spec:
selector:
app: python
ports:

  • port: 12345
    targetPort: 12345
    name: http

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: python
labels:
app: python
spec:
replicas: 1
template:
metadata:
labels:
app: python
spec:
containers:
- image: python
name: python
command: ["python"]
args: ["-m", "http.server", "12345" ]
ports:
- containerPort: 12345

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: python2
labels:
app: python2
spec:
replicas: 1
template:
metadata:
labels:
app: python2
spec:
containers:
- image: python
name: python2
command: ["python"]
args: ["-m", "http.server", "12345" ]
ports:
- containerPort: 12345`

Output of minikube logs (if applicable):

Anything else do we need to know:
This works correctly using minikube v0.17.1, kubectl v1.5.2.
There is a related stackoverflow question (with full walk-through of working and not-working configurations): https://stackoverflow.com/questions/46101741/newer-versions-of-minikube-dont-allow-pods-to-use-their-own-services

@r2d4
Copy link
Contributor

r2d4 commented Sep 14, 2017

Closing as a dupe of #1568, we'll continue to track it there

@r2d4 r2d4 closed this as completed Sep 14, 2017
@nyetwurk
Copy link

nyetwurk commented Apr 4, 2019

Unfortunately, #1568 was unceremoniously closed by a bot.

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

3 participants