---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: testgrid-api
  namespace: testgrid-canary
  labels:
    app: testgrid
    channel: stable
    component: api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: testgrid
      channel: stable
      component: api
  template:
    metadata:
      labels:
        app: testgrid
        channel: stable
        component: api
    spec:
      serviceAccountName: api
      containers:
      - name: api
        image: gcr.io/k8s-testgrid/api:latest # TODO(chases2): tag to version
        args:
        - --scope=gs://testgrid-canary
        - --port=8080
---
apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    iam.gke.io/gcp-service-account: testgrid-canary-api@k8s-testgrid.iam.gserviceaccount.com
  name: api
  namespace: testgrid-canary
---
kind: Service
apiVersion: v1
metadata:
  name: api
  namespace: testgrid-canary
spec:
  selector:
    app: api
  ports:
  - protocol: TCP
    targetPort: 8080
    port: 80
    name: http
  type: LoadBalancer

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: testgrid-api
  namespace: testgrid-canary
  labels:
    app: testgrid
    channel: stable
    component: api
spec:
  replicas: 1
  selector:
    matchLabels:
      app: testgrid
      channel: stable
      component: api
  template:
    metadata:
      labels:
        app: testgrid
        channel: stable
        component: api
    spec:
      serviceAccountName: api
      containers:
      - name: api
        image: gcr.io/k8s-testgrid/api:v20210803-v0.0.87-10-g07789ec
        args:
        - --scope=gs://k8s-testgrid-canary
        - --port=8080
---
apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    iam.gke.io/gcp-service-account: testgrid-canary-api@k8s-testgrid.iam.gserviceaccount.com
  name: api
  namespace: testgrid-canary
---
apiVersion: v1
kind: Service
metadata:
  name: api
  namespace: testgrid-canary
spec:
  type: NodePort
  selector:
    app: testgrid
    component: api
  ports:
  - protocol: TCP
    port: 80
    targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: testgrid-api-ingress
  annotations:
    kubernetes.io/ingress.class: "gce"
spec:
  rules:
  - http:
      paths:
      - path: /*
        pathType: ImplementationSpecific
        backend:
          service:
            name: api
            port:
              number: 80
Move API canary to GKE Ingress
Move API canary to GKE Ingress

Also pins API to version to be updated with other canary services
