apiVersion: apps/v1
kind: Deployment
metadata:
  name: pop-stats
  labels:
    app: pop-stats
spec:
  selector:
    matchLabels:
      app: pop-stats
  replicas: 1
  minReadySeconds: 6
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: pop-stats
    spec:
      containers:
      - image: pop-stats
        name: pop-stats
        readinessProbe:
          periodSeconds: 1
          httpGet:
            path: /h
            port: 8080
        securityContext:
          runAsNonRoot: true
          allowPrivilegeEscalation: false
        ports:
        - containerPort: 8080
          protocol: TCP
        env:
          - name: DEV_EXT_IP
            value: "8.8.8.8"
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name