---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: grafana
  name: grafana
  namespace: prow-monitoring
spec:
  type: ClusterIP
  sessionAffinity: ClientIP
  ports:
  - name: http
    port: 3001
    targetPort: http
  - name: nginx
    port: 80
    targetPort: nginx
  selector:
    app: grafana
---
apiVersion: networking.gke.io/v1beta1
kind: ManagedCertificate
metadata:
  name: oss-prow-knative-dev
  namespace: prow-monitoring
spec:
  domains:
  - oss-prow-monitoring.knative.dev
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: grafana
  namespace: prow-monitoring
  annotations:
    kubernetes.io/ingress.global-static-ip-name: oss-prow-monitoring-ip
    kubernetes.io/ingress.class: "gce"
    kubernetes.io/tls-acme: "true"
    networking.gke.io/managed-certificates: oss-prow-knative-dev
spec:
  rules:
  - host: oss-prow-monitoring.knative.dev
    http:
      paths:
      - backend:
          serviceName: grafana
          servicePort: 80

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: grafana
  name: grafana
  namespace: prow-monitoring
spec:
  type: NodePort
  sessionAffinity: ClientIP
  ports:
  - name: http
    port: 3001
    targetPort: http
  - name: nginx
    port: 80
    targetPort: nginx
  selector:
    app: grafana
---
apiVersion: networking.gke.io/v1beta1
kind: ManagedCertificate
metadata:
  name: oss-prow-knative-dev
  namespace: prow-monitoring
spec:
  domains:
  - oss-prow-monitoring.knative.dev
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: grafana
  namespace: prow-monitoring
  annotations:
    kubernetes.io/ingress.global-static-ip-name: oss-prow-monitoring-ip
    kubernetes.io/ingress.class: "gce"
    kubernetes.io/tls-acme: "true"
    networking.gke.io/managed-certificates: oss-prow-knative-dev
spec:
  rules:
  - host: oss-prow-monitoring.knative.dev
    http:
      paths:
      - path: /monitoring
        backend:
          serviceName: grafana
          servicePort: 80

Revert "grafana use ClusterIP, remove subpath"
Revert "grafana use ClusterIP, remove subpath"

This reverts commit f2aabd0fec84251760d620601abc4e12b7a7fa1c.
