Prometheus Operator: Cannot access Prometheus after expose the services
I am following the documentation to create services operator. I am not sure why I cannot access the Prometheus services.
My apps.yml:
kind: Service
apiVersion: v1
metadata:
name: sms-config-service
labels:
app: sms-config-service
spec:
type: NodePort
selector:
app: sms-config-service
ports:
- port: 8080
targetPort: 8080
name: http
My ServiceMonitor yml:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app: servicemonitor-sms-services
name: servicemonitor-sms-config-services
namespace: metrics
spec:
selector:
matchLabels:
app: sms-config-service
endpoints:
- port: http
Prometheus yml:
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
spec:
serviceAccountName: prometheus
serviceMonitorSelector:
matchLabels:
app: servicemonitor-sms-services
resources:
requests:
memory: 800Mi
enableAdminAPI: true
Prometheus config yml:
apiVersion: v1
kind: Service
metadata:
name: prometheus
spec:
type: NodePort
ports:
- name: web
nodePort: 30900
port: 9090
protocol: TCP
targetPort: web
selector:
prometheus: prometheus
When I access the url below, browser shows "unable to connect". I am not sure where I did wrong? Should I set up a deployment for the exposer?
$ minikube service prometheus --url
http://192.168.64.3:30900
Source: Docker Questions