---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c)
# 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: endpoint
  annotations:
    ns.networkservicemesh.io/endpoints: |
      {
        "name": "lte-network",
        "networkServices": [
          {
            "link": "s5u",
            "labels": "app=pgw-s5u",
            "ipaddress": "172.25.0.0/24"
          },
          {
            "link": "sgi",
            "labels": "app=http-server-sgi",
            "ipaddress": "10.0.1.0/24",
            "route": "10.0.3.0/24"
          }
        ]
      }
spec:
  containers:
    - name: sidecar
      image: gwtester/nse:0.0.1
      resources:
        limits:
          networkservicemesh.io/socket: 1
      volumeMounts:
        - name: nsm-endpoints
          mountPath: /etc/nsminfo
    - image: busybox:stable
      name: instance
      command:
        - sleep
      args:
        - infinity
  volumes:
    - name: nsm-endpoints
      downwardAPI:
        items:
          - path: endpoints
            fieldRef:
              fieldPath: metadata.annotations['ns.networkservicemesh.io/endpoints']  # yamllint disable-line rule:line-length
