apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend-nodejs
  labels:
    app: backend-nodejs
    tier: backend
  namespace: suseapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: backend-nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: backend-nodejs
    spec:
      containers:
      - image: susesamples/backend-nodejs:0.9
        imagePullPolicy: Always
        name: backend-nodejs
        ports:
        - containerPort: 3000
          protocol: TCP
        env:
          - 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: POD_SERVICE_ACCOUNT
            valueFrom:
              fieldRef:
                fieldPath: spec.serviceAccountName
