apiVersion: v1
data:
  clusterDomain: {{ .Values.clusterDomain | quote }}
  namespace: kubeflow
kind: ConfigMap
metadata:
  labels:
    kustomize.component: tensorboard
  name: parameters-dgd4h256h5
  namespace: kubeflow
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    getambassador.io/config: |-
      ---
      apiVersion: ambassador/v0
      kind:  Mapping
      name: tb-mapping-tensorboard-get
      prefix: /tensorboard/ tensorboard/
      rewrite: /
      method: GET
      service: tensorboard.kubeflow:9000
  labels:
    app: tensorboard
    kustomize.component: tensorboard
  name: tensorboard
  namespace: kubeflow
spec:
  ports:
  - name: tb
    port: 9000
    targetPort: 6006
  selector:
    app: tensorboard
    kustomize.component: tensorboard
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: tensorboard
    kustomize.component: tensorboard
  name: tensorboard
  namespace: kubeflow
spec:
  replicas: 1
  selector:
    matchLabels:
      kustomize.component: tensorboard
  template:
    metadata:
      labels:
        app: tensorboard
        kustomize.component: tensorboard
    spec:
      containers:
      - args:
        - --logdir=logs
        - --port=6006
        command:
        - /usr/local/bin/tensorboard
        image: tensorflow/tensorflow:1.8.0
        imagePullPolicy: IfNotPresent
        name: tensorboard
        ports:
        - containerPort: 6006
        resources:
          limits:
            cpu: "4"
            memory: 4Gi
          requests:
            cpu: "1"
            memory: 1Gi
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: tensorboard
  namespace: kubeflow
spec:
  gateways:
  - kubeflow-gateway
  hosts:
  - '*'
  http:
  - match:
    - uri:
        prefix: /tensorboard/tensorboard/
    rewrite:
      uri: /
    route:
    - destination:
        host: tensorboard.kubeflow.svc.{{ .Values.clusterDomain }}
        port:
          number: 9000
