apiVersion: apps/v1
kind: Deployment
metadata:
  name: cloud-native-go
  labels:
    app: cloud-native-go
spec:
  replicas: 2
  selector:
    matchLabels:
      app: cloud-native-go
  revisionHistoryLimit: 10
  minReadySeconds: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 2
  template:
    metadata:
      labels:
        app: cloud-native-go
        tier: service
    spec:
      containers:
        - name: cloud-native-go
          image: "cloud-native-go:1.0.1"
          resources:
            requests:
              memory: "16Mi"
              cpu: "125m"
            limits:
              memory: "64Mi"
              cpu: "250m"
          ports:
            - containerPort: 8080
          readinessProbe:
            httpGet:
              path: /
              port: 8080
            initialDelaySeconds: 5
            timeoutSeconds: 5
          livenessProbe:
            httpGet:
              path: /
              port: 8080
            initialDelaySeconds: 5
            timeoutSeconds: 5
          env:
            - name: PORT
              value: "8080"
