Different behavior when accessing app through NodePort and from inside Pod
up vote
0
down vote
favorite
This is my firstpod service.yml
file .
apiVersion: v1
kind: Service
metadata:
name: firstpod
spec:
ports:
- port: 2025
targetPort: 2025
nodePort: 30384
name: http
selector:
app: firstpod
type: NodePort
and firstpod deployment.yml
file is ,
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: firstpod
spec:
selector:
matchLabels:
app: firstpod
replicas: 1 # tells deployment to run 3 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: firstpod
spec:
containers:
- name: firstpod
image: firstpod
ports:
- containerPort: 2025
imagePullPolicy: Always
imagePullSecrets:
- name: regcred
After deployment while acessing using nodeport port ,
localhost:30384/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am able to see the the details . But while accessing from pod ,
kubectl exec -it firstpod /bin/sh
Then,
curl firstpod:2025/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am getting error ,the logs it shows that ,appuserid always passed as null .
If I am changing the parameter to
curl firstpod:2025/dls/api/services/v1/notification/info/?appuserid=104 & statusid=1
Then able to see the details .
Any idea why I am getting null values of appuserid always in first curl command ?
curl kubernetes azure-devops-rest-api kubernetes-service
add a comment |
up vote
0
down vote
favorite
This is my firstpod service.yml
file .
apiVersion: v1
kind: Service
metadata:
name: firstpod
spec:
ports:
- port: 2025
targetPort: 2025
nodePort: 30384
name: http
selector:
app: firstpod
type: NodePort
and firstpod deployment.yml
file is ,
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: firstpod
spec:
selector:
matchLabels:
app: firstpod
replicas: 1 # tells deployment to run 3 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: firstpod
spec:
containers:
- name: firstpod
image: firstpod
ports:
- containerPort: 2025
imagePullPolicy: Always
imagePullSecrets:
- name: regcred
After deployment while acessing using nodeport port ,
localhost:30384/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am able to see the the details . But while accessing from pod ,
kubectl exec -it firstpod /bin/sh
Then,
curl firstpod:2025/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am getting error ,the logs it shows that ,appuserid always passed as null .
If I am changing the parameter to
curl firstpod:2025/dls/api/services/v1/notification/info/?appuserid=104 & statusid=1
Then able to see the details .
Any idea why I am getting null values of appuserid always in first curl command ?
curl kubernetes azure-devops-rest-api kubernetes-service
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This is my firstpod service.yml
file .
apiVersion: v1
kind: Service
metadata:
name: firstpod
spec:
ports:
- port: 2025
targetPort: 2025
nodePort: 30384
name: http
selector:
app: firstpod
type: NodePort
and firstpod deployment.yml
file is ,
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: firstpod
spec:
selector:
matchLabels:
app: firstpod
replicas: 1 # tells deployment to run 3 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: firstpod
spec:
containers:
- name: firstpod
image: firstpod
ports:
- containerPort: 2025
imagePullPolicy: Always
imagePullSecrets:
- name: regcred
After deployment while acessing using nodeport port ,
localhost:30384/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am able to see the the details . But while accessing from pod ,
kubectl exec -it firstpod /bin/sh
Then,
curl firstpod:2025/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am getting error ,the logs it shows that ,appuserid always passed as null .
If I am changing the parameter to
curl firstpod:2025/dls/api/services/v1/notification/info/?appuserid=104 & statusid=1
Then able to see the details .
Any idea why I am getting null values of appuserid always in first curl command ?
curl kubernetes azure-devops-rest-api kubernetes-service
This is my firstpod service.yml
file .
apiVersion: v1
kind: Service
metadata:
name: firstpod
spec:
ports:
- port: 2025
targetPort: 2025
nodePort: 30384
name: http
selector:
app: firstpod
type: NodePort
and firstpod deployment.yml
file is ,
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: firstpod
spec:
selector:
matchLabels:
app: firstpod
replicas: 1 # tells deployment to run 3 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: firstpod
spec:
containers:
- name: firstpod
image: firstpod
ports:
- containerPort: 2025
imagePullPolicy: Always
imagePullSecrets:
- name: regcred
After deployment while acessing using nodeport port ,
localhost:30384/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am able to see the the details . But while accessing from pod ,
kubectl exec -it firstpod /bin/sh
Then,
curl firstpod:2025/firstpod/api/services/v1/notification/info/?statusid=1&appuserid=104
I am getting error ,the logs it shows that ,appuserid always passed as null .
If I am changing the parameter to
curl firstpod:2025/dls/api/services/v1/notification/info/?appuserid=104 & statusid=1
Then able to see the details .
Any idea why I am getting null values of appuserid always in first curl command ?
curl kubernetes azure-devops-rest-api kubernetes-service
curl kubernetes azure-devops-rest-api kubernetes-service
edited yesterday
Emruz Hossain
84217
84217
asked yesterday
Chintamani
2421724
2421724
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370657%2fdifferent-behavior-when-accessing-app-through-nodeport-and-from-inside-pod%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown