Appendix: Pod Sandbox Configuration

This section describes the properties of pod sandbox configuration.

Properties

The following properties of pod sandbox configuration file are supported in the expected JSON format:

config <object, REQUIRED>
Configuration for creating the pod.
metadata <object, REQUIRED>
Metadata of the pod, used to uniquely identify it.
name <string, REQUIRED>
Name to associate with this pod. This must be a unique within the system.
hostname <string, OPTIONAL>
Hostname of this pod. Only valid in when the pod's network namespace is set to POD. If not provided, the generated pod ID is used as the hostname. Only pods with a network namespace type of POD can reach each other via this hostname.
log_directory <string, OPTIONAL>
Path to the directory on the host in which log files are stored for containers under this Pod. This directory must exist on the filesystem before the first container under this Pod is created.
If not specified, the logs are stored under qcmgr's root directory.
port_mappings <array of objects, OPTIONAL>
Port mapping configurations to apply for this pod. To configure port mappings, the pod's network namespace must be set to POD and an external interface (-i option) must have been specified when qcmgr was started.
Note:
In order for port mappings to be activated, the Packet Filter functionality must be enabled by separately via the pfctl -e command. The pfctl -s all command may be used to output the current status of the Packet Filter.
Each port mapping object can specify:
protocol <integer, OPTIONAL>
The protocol to match, can be one of:
Value Meaning
0 TCP
1 UDP
2 SCTP
Not specifying a protocol value will match any protocol.
host_port <integer, OPTIONAL>
The port on the host to match. One of host_port or host_ip must be specified. Not specifying a host port value will match any port. A protocol value of TCP/UDP/SCTP must also be set if a host_port value is specified.
host_ip <string, OPTIONAL>
The exact IP address on the host to match. One of host_port or host_ip must be specified. Not specifying a host IP string will match any IP.
Note:
Only IPv4 addresses are supported.
container_port <integer, OPTIONAL>
The port inside the container to map to. A protocol value of TCP/UDP/SCTP must also be set if a container_port value is specified.
qnx <object, OPTIONAL>
QNX specific configuration
network_namespace <integer, OPTIONAL>
The network namespace for this pod. If not specified, defaults to 0 (POD). Can be one of:
Value Meaning
0 POD

The pod gets its own virtual network stack; containers within the pod share the same network but cannot view the network stack of other pods or the host. The pod also gets a virtual Ethernet interface to connect it to the host network and other pods. To use this mode, start qcmgr with a specified network bridge.

2 HOST

The pod shares the same network stack as the host; containers within the pod have access to all of the host's interfaces, DNS settings, etc.

4 NONE

The pod gets its own virtual network stack but without an interface connecting it to the host network, effectively isolating it without external connection.

Sample Configurations

View the following examples of various pod sandbox configurations.

Example 1: Minimal configuration
{
   "config": {
      "metadata": {
      "name": "podsandbox1"
      }
   }
}
Example 2: Simple configuration for starting a user app
{
   "config": {
      "metadata": {
         "name": "podsandbox2"
      },
      "qnx": {
         "network_namespace":2
      }
   }
}
Example 3: Full configuration with port mappings and a custom log directory
{
   "config": {
      "metadata": {
         "name": "podsandbox3"
      },
      "qnx": {
         "network_namespace": 0
      },
      "port_mappings": [
         {
            "protocol": 0,
            "container_port": 22,
            "host_port": 2222
         },
         {
            "protocol": 2,
            "container_port": 80,
            "host_port": 30,
            "host_ip": "10.123.2.1"
         }
      ],
      "hostname": "hostname3",
      "dns_config": {
         "servers": ["8.8.8.8"],
         "searches": ["localdomain"],
         "options": ["ndots:1"]
      },
      "log_directory": "/data/var/podsandbox3"
   }
}
Page updated: