You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
applicationb:
environment:
- ASPNETCORE_ENVIRONMENT=Development
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
The text was updated successfully, but these errors were encountered:
neetra
changed the title
Containers not accessible via container name , running in single pod(multi-container)
How to access containers via container name and exposed port(internal port without mapping to external) , running in single pod(multi-container)
Apr 9, 2020
Problem:
I have two applications say applicationA, applicationB.
Using Docker compose.yml:
version: ‘3.4’
services:
applicationa:
environment:
- ASPNETCORE_ENVIRONMENT=Development
applicationb:
environment:
- ASPNETCORE_ENVIRONMENT=Development
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:
image: appa:latest
env:
value: “Development”
ports:
imagePullPolicy: Never
containers:
image: appb:latest
env:
value: “Development”
ports:
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: