apiVersion: v1
kind: Pod
metadata:
  name: seastar-httpd-pod
  annotations:
    k8s.v1.cni.cncf.io/networks: vdpa-net-httpd
spec:
  containers:
  - name: seastar-httpd
    image: seastar-httpd:latest
    imagePullPolicy: Never
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /var/lib/cni/usrspcni/
      name: shared-dir
    - mountPath: /dev/hugepages
      name: hugepage
    - mountPath: /var/run/seastar/
      name: shared-seastar-dir
    resources:
      requests:
        #memory: 1Gi
        memory: 2Mi
        intel.com/vdpa_dpdk_httpd: '1'
      limits:
        #hugepages-1Gi: 2Gi
        hugepages-2Mi: 2048Mi
        intel.com/vdpa_dpdk_httpd: '1'
    env:
    # Control which Seastar App is running in container.
    #   Options: httpd seawreck
    - name: SEASTAR_APP
      value: "httpd"
    # Uncomment to control set the IP Address of Seastar App.
    # This method has been deprecated in favor of setting the IP
    # MAC Adddress in the 'hostNic.json' file.
    #- name: SEASTAR_POD_IPADDR
    #  value: "192.168.133.2"
    #
    # Uncomment to debug Seastar App or to run manually to change
    # DPDK command line options.
    #command: ["sleep", "infinity"]
  initContainers:
  - name: httpd-init-container
    image: httpd-init-container:latest
    imagePullPolicy: Never
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /etc/podnetinfo
      name: podnetinfo
      readOnly: false
    - mountPath: /var/lib/cni/usrspcni/
      name: shared-dir
    - mountPath: /var/run/seastar/
      name: shared-seastar-dir
    #command: ["sleep", "infinity"]
  volumes:
  - name: podnetinfo
    downwardAPI:
      items:
        - path: "labels"
          fieldRef:
            fieldPath: metadata.labels
        - path: "annotations"
          fieldRef:
            fieldPath: metadata.annotations
  - name: shared-dir
    hostPath:
      path: /var/run/vdpa/vhost/
  - name: shared-seastar-dir
    hostPath:
      path: /var/run/seastar/
  - name: hugepage
    emptyDir:
      medium: HugePages
