apiVersion: v1
kind: Service
metadata:
  labels:
    ksonnet.io/component: ambassador
    service: ambassador
    {{- if eq .Values.ambassador.service.type "Rancher-Proxy" }}
    kubernetes.io/cluster-service: "true"
    {{- end }}
  name: ambassador
  namespace: kubeflow
spec:
  ports:
  - name: ambassador
    port: 80
    targetPort: 80
    {{- if .Values.ambassador.service.nodePort }}
    nodePort: {{ .Values.ambassador.service.nodePort }}
    {{- end }}
  selector:
    service: ambassador
  {{- if eq .Values.ambassador.service.type "Rancher-Proxy" }}
  type: ClusterIP
  {{- else }}
  type: {{ .Values.ambassador.service.type }}
  {{- end }}
---
apiVersion: v1
kind: Service
metadata:
  labels:
    ksonnet.io/component: ambassador
    service: ambassador-admin
  name: ambassador-admin
  namespace: kubeflow
spec:
  ports:
  - name: ambassador-admin
    port: 8877
    targetPort: 8877
  selector:
    service: ambassador
  type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    getambassador.io/config: |-
      ---
      apiVersion: ambassador/v0
      kind:  Mapping
      name: k8s-dashboard-ui-mapping
      prefix: /k8s/ui/
      rewrite: /
      tls: true
      service: kubernetes-dashboard.kube-system
  labels:
    ksonnet.io/component: ambassador
  name: k8s-dashboard
  namespace: kubeflow
spec:
  ports:
  - port: 443
    targetPort: 8443
  selector:
    k8s-app: kubernetes-dashboard
  type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    prometheus.io/port: "9102"
    prometheus.io/scrape: "true"
  labels:
    ksonnet.io/component: ambassador
    service: ambassador
  name: statsd-sink
  namespace: kubeflow
spec:
  ports:
  - name: statsd-sink
    port: 9102
    protocol: TCP
    targetPort: 9102
  selector:
    service: ambassador
  type: ClusterIP
