kind: Deployment
apiVersion: apps/v1
metadata:
  name: go-api-k8s-v1
  labels:
    k8s-app: go-api-k8s
    version: v1
spec:
  replicas: 2
  selector:
    matchLabels:
      k8s-app: go-api-k8s
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      name: go-api-k8s-v1
      labels:
        k8s-app: go-api-k8s
        version: v1
    spec:
      containers:
        - name: go-api-k8s-v1
          image: douglaszuqueto/go-api-k8s:v1.0.0
          imagePullPolicy: Always
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          resources:
            requests:
              cpu: 200m
      restartPolicy: Always
