How to access hello world Java microservice through Gateway or Ingress in Istio on Minikube/Windows? I've...





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















Minikube version: v0.25.2



Operating Syatem : Windows 10 Enterprise



Kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:46:06Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-04-10T12:46:31Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}

Kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443

istioctl version
Version: 1.0.4
GitRevision: d5cb99f479ad9da88eebb8bb3637b17c323bc50b
User: root@8c2feba0b568
Hub: docker.io/istio
GolangVersion: go1.10.4
BuildStatus: Clean


Tried to run simple hello-world application through Istio on above environment.



kubectl get services
springbootapplication NodePort 10.103.103.141 <none> 80:30456/TCP 3d

kubectl get pods
springbootapplication-v1-6b5bdff8cd-2qhnn 2/2 Running 5 3d


After that I create one below helloworld.yaml file and run the command kubectl apply -f helloworld.yaml. It runs successfully.



apiVersion: v1
kind: Service
metadata:
name: springbootapplication
labels:
app: springbootapplication
spec:
type: NodePort
ports:
- port: 80
name: http
selector:
app: springbootapplication
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: springbootapplication-v1
spec:
replicas: 1
template:
metadata:
labels:
app: springbootapplication
version: v1
spec:
containers:
- name: springbootapplication
image: springbootapplication:v1
imagePullPolicy: Never
ports:
- containerPort: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: springbootapplication-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: springbootapplication
spec:
hosts:
- "*"
gateways:
- springbootapplication-gateway
http:
- match:
- uri:
exact: /home
route:
- destination:
host: springbootapplication
port:
number: 80
weight: 100
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: springbootapplication
spec:
host: springbootapplication
subsets:
- name: v1
labels:
version: v1


Problem: I don't know how to access this Spring Boot application now? How to get Gateway IP and Ingress?










share|improve this question

























  • Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.

    – halfer
    Jan 3 at 8:50


















0















Minikube version: v0.25.2



Operating Syatem : Windows 10 Enterprise



Kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:46:06Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-04-10T12:46:31Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}

Kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443

istioctl version
Version: 1.0.4
GitRevision: d5cb99f479ad9da88eebb8bb3637b17c323bc50b
User: root@8c2feba0b568
Hub: docker.io/istio
GolangVersion: go1.10.4
BuildStatus: Clean


Tried to run simple hello-world application through Istio on above environment.



kubectl get services
springbootapplication NodePort 10.103.103.141 <none> 80:30456/TCP 3d

kubectl get pods
springbootapplication-v1-6b5bdff8cd-2qhnn 2/2 Running 5 3d


After that I create one below helloworld.yaml file and run the command kubectl apply -f helloworld.yaml. It runs successfully.



apiVersion: v1
kind: Service
metadata:
name: springbootapplication
labels:
app: springbootapplication
spec:
type: NodePort
ports:
- port: 80
name: http
selector:
app: springbootapplication
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: springbootapplication-v1
spec:
replicas: 1
template:
metadata:
labels:
app: springbootapplication
version: v1
spec:
containers:
- name: springbootapplication
image: springbootapplication:v1
imagePullPolicy: Never
ports:
- containerPort: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: springbootapplication-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: springbootapplication
spec:
hosts:
- "*"
gateways:
- springbootapplication-gateway
http:
- match:
- uri:
exact: /home
route:
- destination:
host: springbootapplication
port:
number: 80
weight: 100
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: springbootapplication
spec:
host: springbootapplication
subsets:
- name: v1
labels:
version: v1


Problem: I don't know how to access this Spring Boot application now? How to get Gateway IP and Ingress?










share|improve this question

























  • Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.

    – halfer
    Jan 3 at 8:50














0












0








0








Minikube version: v0.25.2



Operating Syatem : Windows 10 Enterprise



Kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:46:06Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-04-10T12:46:31Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}

Kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443

istioctl version
Version: 1.0.4
GitRevision: d5cb99f479ad9da88eebb8bb3637b17c323bc50b
User: root@8c2feba0b568
Hub: docker.io/istio
GolangVersion: go1.10.4
BuildStatus: Clean


Tried to run simple hello-world application through Istio on above environment.



kubectl get services
springbootapplication NodePort 10.103.103.141 <none> 80:30456/TCP 3d

kubectl get pods
springbootapplication-v1-6b5bdff8cd-2qhnn 2/2 Running 5 3d


After that I create one below helloworld.yaml file and run the command kubectl apply -f helloworld.yaml. It runs successfully.



apiVersion: v1
kind: Service
metadata:
name: springbootapplication
labels:
app: springbootapplication
spec:
type: NodePort
ports:
- port: 80
name: http
selector:
app: springbootapplication
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: springbootapplication-v1
spec:
replicas: 1
template:
metadata:
labels:
app: springbootapplication
version: v1
spec:
containers:
- name: springbootapplication
image: springbootapplication:v1
imagePullPolicy: Never
ports:
- containerPort: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: springbootapplication-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: springbootapplication
spec:
hosts:
- "*"
gateways:
- springbootapplication-gateway
http:
- match:
- uri:
exact: /home
route:
- destination:
host: springbootapplication
port:
number: 80
weight: 100
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: springbootapplication
spec:
host: springbootapplication
subsets:
- name: v1
labels:
version: v1


Problem: I don't know how to access this Spring Boot application now? How to get Gateway IP and Ingress?










share|improve this question
















Minikube version: v0.25.2



Operating Syatem : Windows 10 Enterprise



Kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:46:06Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-04-10T12:46:31Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}

Kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443

istioctl version
Version: 1.0.4
GitRevision: d5cb99f479ad9da88eebb8bb3637b17c323bc50b
User: root@8c2feba0b568
Hub: docker.io/istio
GolangVersion: go1.10.4
BuildStatus: Clean


Tried to run simple hello-world application through Istio on above environment.



kubectl get services
springbootapplication NodePort 10.103.103.141 <none> 80:30456/TCP 3d

kubectl get pods
springbootapplication-v1-6b5bdff8cd-2qhnn 2/2 Running 5 3d


After that I create one below helloworld.yaml file and run the command kubectl apply -f helloworld.yaml. It runs successfully.



apiVersion: v1
kind: Service
metadata:
name: springbootapplication
labels:
app: springbootapplication
spec:
type: NodePort
ports:
- port: 80
name: http
selector:
app: springbootapplication
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: springbootapplication-v1
spec:
replicas: 1
template:
metadata:
labels:
app: springbootapplication
version: v1
spec:
containers:
- name: springbootapplication
image: springbootapplication:v1
imagePullPolicy: Never
ports:
- containerPort: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: springbootapplication-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: springbootapplication
spec:
hosts:
- "*"
gateways:
- springbootapplication-gateway
http:
- match:
- uri:
exact: /home
route:
- destination:
host: springbootapplication
port:
number: 80
weight: 100
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: springbootapplication
spec:
host: springbootapplication
subsets:
- name: v1
labels:
version: v1


Problem: I don't know how to access this Spring Boot application now? How to get Gateway IP and Ingress?







istio






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 14 at 7:37







IndiaNCR

















asked Jan 3 at 5:57









IndiaNCRIndiaNCR

11




11













  • Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.

    – halfer
    Jan 3 at 8:50



















  • Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.

    – halfer
    Jan 3 at 8:50

















Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.

– halfer
Jan 3 at 8:50





Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions.

– halfer
Jan 3 at 8:50












1 Answer
1






active

oldest

votes


















0














You have exposed this as an http service, so in your kubernetes cluster, check for 'istio-ingressgateway' service (it should be a load balancer) and check the endpoint which is exposed at port 80.



Or, through command line, try these.



kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}' --> should give you the ingress port



minikube ip --> should give you IP.






share|improve this answer
























  • It shows me below error :

    – IndiaNCR
    Jan 9 at 6:46











  • error: error executing jsonpath "'{.spec.ports[?(@.name==http2)].nodePort}": unrecognized identifier http2

    – IndiaNCR
    Jan 9 at 6:46











  • it should be in double quotes. Did you try "http" as well?

    – mjkool
    Jan 9 at 11:41











  • I tried but its not working ...

    – IndiaNCR
    Jan 14 at 7:34











  • What happens if you access the istio-ingressgateway? Did you verify the results of kubectl get gateway and kubectl get virtualservice commands ?

    – mjkool
    Jan 18 at 18:16














Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54017035%2fhow-to-access-hello-world-java-microservice-through-gateway-or-ingress-in-istio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You have exposed this as an http service, so in your kubernetes cluster, check for 'istio-ingressgateway' service (it should be a load balancer) and check the endpoint which is exposed at port 80.



Or, through command line, try these.



kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}' --> should give you the ingress port



minikube ip --> should give you IP.






share|improve this answer
























  • It shows me below error :

    – IndiaNCR
    Jan 9 at 6:46











  • error: error executing jsonpath "'{.spec.ports[?(@.name==http2)].nodePort}": unrecognized identifier http2

    – IndiaNCR
    Jan 9 at 6:46











  • it should be in double quotes. Did you try "http" as well?

    – mjkool
    Jan 9 at 11:41











  • I tried but its not working ...

    – IndiaNCR
    Jan 14 at 7:34











  • What happens if you access the istio-ingressgateway? Did you verify the results of kubectl get gateway and kubectl get virtualservice commands ?

    – mjkool
    Jan 18 at 18:16


















0














You have exposed this as an http service, so in your kubernetes cluster, check for 'istio-ingressgateway' service (it should be a load balancer) and check the endpoint which is exposed at port 80.



Or, through command line, try these.



kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}' --> should give you the ingress port



minikube ip --> should give you IP.






share|improve this answer
























  • It shows me below error :

    – IndiaNCR
    Jan 9 at 6:46











  • error: error executing jsonpath "'{.spec.ports[?(@.name==http2)].nodePort}": unrecognized identifier http2

    – IndiaNCR
    Jan 9 at 6:46











  • it should be in double quotes. Did you try "http" as well?

    – mjkool
    Jan 9 at 11:41











  • I tried but its not working ...

    – IndiaNCR
    Jan 14 at 7:34











  • What happens if you access the istio-ingressgateway? Did you verify the results of kubectl get gateway and kubectl get virtualservice commands ?

    – mjkool
    Jan 18 at 18:16
















0












0








0







You have exposed this as an http service, so in your kubernetes cluster, check for 'istio-ingressgateway' service (it should be a load balancer) and check the endpoint which is exposed at port 80.



Or, through command line, try these.



kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}' --> should give you the ingress port



minikube ip --> should give you IP.






share|improve this answer













You have exposed this as an http service, so in your kubernetes cluster, check for 'istio-ingressgateway' service (it should be a load balancer) and check the endpoint which is exposed at port 80.



Or, through command line, try these.



kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}' --> should give you the ingress port



minikube ip --> should give you IP.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 14:26









mjkoolmjkool

705




705













  • It shows me below error :

    – IndiaNCR
    Jan 9 at 6:46











  • error: error executing jsonpath "'{.spec.ports[?(@.name==http2)].nodePort}": unrecognized identifier http2

    – IndiaNCR
    Jan 9 at 6:46











  • it should be in double quotes. Did you try "http" as well?

    – mjkool
    Jan 9 at 11:41











  • I tried but its not working ...

    – IndiaNCR
    Jan 14 at 7:34











  • What happens if you access the istio-ingressgateway? Did you verify the results of kubectl get gateway and kubectl get virtualservice commands ?

    – mjkool
    Jan 18 at 18:16





















  • It shows me below error :

    – IndiaNCR
    Jan 9 at 6:46











  • error: error executing jsonpath "'{.spec.ports[?(@.name==http2)].nodePort}": unrecognized identifier http2

    – IndiaNCR
    Jan 9 at 6:46











  • it should be in double quotes. Did you try "http" as well?

    – mjkool
    Jan 9 at 11:41











  • I tried but its not working ...

    – IndiaNCR
    Jan 14 at 7:34











  • What happens if you access the istio-ingressgateway? Did you verify the results of kubectl get gateway and kubectl get virtualservice commands ?

    – mjkool
    Jan 18 at 18:16



















It shows me below error :

– IndiaNCR
Jan 9 at 6:46





It shows me below error :

– IndiaNCR
Jan 9 at 6:46













error: error executing jsonpath "'{.spec.ports[?(@.name==http2)].nodePort}": unrecognized identifier http2

– IndiaNCR
Jan 9 at 6:46





error: error executing jsonpath "'{.spec.ports[?(@.name==http2)].nodePort}": unrecognized identifier http2

– IndiaNCR
Jan 9 at 6:46













it should be in double quotes. Did you try "http" as well?

– mjkool
Jan 9 at 11:41





it should be in double quotes. Did you try "http" as well?

– mjkool
Jan 9 at 11:41













I tried but its not working ...

– IndiaNCR
Jan 14 at 7:34





I tried but its not working ...

– IndiaNCR
Jan 14 at 7:34













What happens if you access the istio-ingressgateway? Did you verify the results of kubectl get gateway and kubectl get virtualservice commands ?

– mjkool
Jan 18 at 18:16







What happens if you access the istio-ingressgateway? Did you verify the results of kubectl get gateway and kubectl get virtualservice commands ?

– mjkool
Jan 18 at 18:16






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54017035%2fhow-to-access-hello-world-java-microservice-through-gateway-or-ingress-in-istio%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

'app-layout' is not a known element: how to share Component with different Modules