-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Containers not accessible via container name , running in single pod(multi-container) #377
Comments
Hey @neetra |
@MoShitrit thanks for the response, but I am aware about this |
Hey @neetra
Or, you can also create an additional service by running the same Another thing to bare in mind- once the service is updated, you'll need to find the actual node port that k8s allocated to your service, since (unless you configured it differently) the default range is a higher-number port, between 30000-32767, so you'll need to run
In the above example, you'll need to access your minikube instance using port 32588. |
Hey, @neetra ! |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/close |
@MoShitrit: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Problem:
I have two applications say applicationA, applicationB.
Using Docker compose.yml:
version: '3.4'
In dockerfile of applicationa (Exposed port 80), applicationb(exposed port 5000)
Exposed port of applicationB is not mapped to external port thus it is not accessible directly
ApplicationA access applicationB via http://containername:containerexposedport i.e http://applicationb:5000
Using Minikube:
Deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: appaappb-deployment
labels:
app: appaappb
spec:
replicas: 1
selector:
matchLabels:
app: appaappb
template:
metadata:
labels:
app: appaappb
spec:
containers:
- name: appa
image: appa:latest
env:
- name: ASPNETCORE_ENVIRONMENT
value: "Development"
ports:
- containerPort: 80
imagePullPolicy: Never
containers:
- name: appb
image: appb:latest
env:
- name: ASPNETCORE_ENVIRONMENT
value: "Development"
ports:
- containerPort: 5000
imagePullPolicy: Never
Service (Map external port)
kubectl expose pod appaappb-deployment-8656cfcdff-wd4hv --name=appaappbservice --type="NodePort" --target-port 80 --port 80
Now as appA and appB are not in same docker network appA cannot access appB via container name and container internal port
So how to access appB in appA ?
information:
Minikube version:v1.9.2
Docker version: 19.0.3
The text was updated successfully, but these errors were encountered: