##############################################################################
# Copyright (C) 2021, Nordix Foundation
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
apiVersion: v1
kind: Pod
metadata:
  name: tgen-tapp-pod-a
  annotations:
    k8s.v1.cni.cncf.io/networks: '[
        {
          "name": "test-net",
          "ips": ["10.10.10.1/24"]
        }
    ]'
spec:
  serviceAccount: tgen-tapp-sa
  containers:
  - name: tgen-tapp-pod-container-a
    image: tgen-tapp:latest
    imagePullPolicy: IfNotPresent
    command:
    - tgenapp
    args:
    - -readbufsize=9000
    - -promport=2212
    env:
      - name: NODE_NAME
        valueFrom:
          fieldRef:
            fieldPath: spec.nodeName
      - name: POD_NAME
        valueFrom:
          fieldRef:
            fieldPath: metadata.name
      - name: NAMESPACE
        valueFrom:
          fieldRef:
            fieldPath: metadata.namespace
    volumeMounts:
      - name: podinfo
        mountPath: /etc/podinfo
  volumes:
    - name: podinfo
      downwardAPI:
        items:
          - path: "labels"
            fieldRef:
              fieldPath: metadata.labels
          - path: "annotations"
            fieldRef:
              fieldPath: metadata.annotations