---
apiVersion: apps/v1
kind: Deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      networkservicemesh.io/app: "p-gw-c"
  template:
    metadata:
      annotations:
        ns.networkservicemesh.io/endpoints: |
          {
            "name": "4g-network",
            "tracerEnabled": true,
            "networkServices": [
              {"link": "s5s8-c", "labels": "app=p-gw-c", "ipAddress": "10.60.4.0/24"},
              {"link": "gx", "labels": "app=p-gw-c", "ipAddress": "10.60.5.0/24"},
              {"link": "sxb", "labels": "app=p-gw-c", "ipAddress": "10.60.6.0/24"}
            ]
          }
      labels:
        networkservicemesh.io/app: "p-gw-c"
        networkservicemesh.io/impl: "4g-network"
    spec:
      containers:
        - name: sidecar-nse
          image: networkservicemesh/4g-network-sidecar-nse:latest
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              networkservicemesh.io/socket: 1
          volumeMounts:
            - name: nsm-endpoints
              mountPath: /etc/nsminfo
        - name: p-gw-c
          image: alpine:latest
          command: ["tail", "-f", "/dev/null"]
          imagePullPolicy: IfNotPresent
      volumes:
        - name: nsm-endpoints
          downwardAPI:
            items:
              - path: endpoints
                fieldRef:
                  fieldPath: metadata.annotations['ns.networkservicemesh.io/endpoints']
metadata:
  name: p-gw-c
  namespace: default
