apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: go-app-canary
spec:
  selector:
    matchLabels:
      app: go-app
  replicas: 1 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: go-app
        track: canary
    spec:
      containers:
      - name: web
        image: nginx:1.8 # update version of image
        ports:
        - containerPort: 90
        volumeMounts:
        - name: nginx-config
          mountPath: /etc/nginx/conf.d/app.conf
          subPath: app.conf
      - name: go-app
        image: graha/go-web:2.0
        ports:
        - containerPort: 8080
      volumes:
        - name: nginx-config
          configMap:
            name: nginx-config
