We are using Prometheus operator and we need to expose Grafana publicly (outside) using istio, https://github.com/helm/charts/tree/master/stable/prometheus-operator
Normally when I have application which I need to expose publicly with istio, I adding something like following to my micro service and it works and exposed outside.
service.yaml
apiVersion: v1
kind: Service
metadata:
name: po-svc
namespace: po
spec:
ports:
- name: http
port: 3000
targetPort: 3000
selector:
app: myapp //I take the name from deployment.yaml --in the chart NOT SURE WHICH VALUE I SHOULD TAKE FROM THE CHART---
And add a virtual service
virtualservice.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: po-virtualservice
namespace: po
spec:
gateways:
- gw-system.svc.cluster.local
hosts:
- po.eu.trial.appos.cloud.mvn
http:
- route:
- destination:
host: po-svc
port:
number: 3000
Then I was able to access to my application publicly.
Now I want to the same for Grafana from the prometheus operator chart
in the values.yaml
there is service entry
https://github.com/helm/charts/blob/master/stable/prometheus-operator/values.yaml#L576
However not sure if it should replace the service.yaml
and if yes how to fill the data like app: myapp
(which in regualr application I take from the deployment.yaml the `name' field) to be the grafana that the service have the reference to Grafana application
in addition, in the virutalservice.yaml
there is a reference to the service
(host: po-svc)
My question is: How should I fill those two values and be able to expose Grafana using istio ?
Btw, if I change the values from the chart to LoadBalancer
like below, im getting a public url to access outside, however I want to expose it via istio.
service:
portName: service
type: LoadBalancer
update
I've created the following virtual service
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: po-virtualservice
namespace: po
spec:
gateways:
- gw-system.svc.cluster.local
hosts:
- po.eu.trial.appos.cloud.mvn
http:
- route:
- destination:
host: po-grafana. // This is the name of the service that promethues operator created when applying the chart .
port:
number: 3000
and update the values.yaml like following
service:
portName: service
port: 3000
targetPort: 3000
Now when I hit the browser for the application url (po.eu.trial.appos.cloud.mvn) I got error
upstream connect error or disconnect/reset before headers. reset reason: connection termination
any idea what could be the problem? how should I trace this issue ?
I would think(not sure 100%) I may be missing something on the service config in the chart but not sure what...
I've found this post which have similar error: (but not sure we have the same issue)
https://github.com/istio/istio/issues/19966
However not sure how should I add the nameport to the chart yaml service definition