apiVersion: apps/v1
kind: Deployment
metadata:
  name: just-enough-deployment
  labels:
    app: just-enough
spec:
  replicas: 3
  selector:
    matchLabels:
      app: just-enough-web
  template:
    metadata:
      labels:
        app: just-enough-web
    spec:
      containers:
      # Hey this matches our level 1 pod!
      - name: just-enough-container
        image: burningpony/just-enough-kubernetes:release-0.1.1
        command:
          - rackup
        args:
          - -o
          - "0.0.0.0"
        ports:
          - name: http
            containerPort: 9292

        env:
        - name: RACK_ENV
          value: production

        # Use the downward API to know expose pod name to the ENV
        # https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
        - name: MY_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: MY_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName

        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "128Mi"
            cpu: "500m"
