apiVersion: apps/v1
kind: Deployment
metadata:
  name: ok
  namespace: example
  labels:
    app: ok
    component: api
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: ok
  template:
    metadata:
      labels:
        app: ok
        component: api
    spec:
      containers:
        - name: ok
          image: txn2/ok
          imagePullPolicy: Always
          env:
            - name: PORT
              value: "5001"
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
            - name: SERVICE_ACCOUNT
              valueFrom:
                fieldRef:
                  fieldPath: spec.serviceAccountName
          ports:
            - name: ok-port
              containerPort: 5001