apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: belafonte
  name: belafonte
  namespace: belafonte
spec:
  replicas: 1
  selector:
    matchLabels:
      app: belafonte
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: belafonte
    spec:
      containers:
      - name: belafonte
        image: docker.io/downey/sinatra-k8s-sample:latest
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: UUID_SERVICE_NAME
          value: httpbin
        ports:
        - containerPort: 8080
          name: http
        command: ["/cnb/lifecycle/launcher", "rackup -p 8080"]
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
