Pod Update

In the resource field under route, the actual value of {pod_name} is the same as the value of name under metadata. In the container update message, the image name field carries the URL prefix of the image repository.

Message instance

{
    "header":{
        "msg_id":"85c67925-5768-4edd-b40e-32cf106e07e8",
        "parent_msg_id": "",
        "timestamp":1652168697,
        "resourceversion": "",
        "sync":true
    },
    "route":{
        "source":"controller",
        "group":"resource",
        "operation":"update",
        "resource":"websocket/pod/{pod_name}"
    },
    "content":{}
}

Parameter description

The content message is described as follows:
{
    "metadata":{
        "creationTimestamp":"2022-05-10T07:44:54Z",
        "name":"root-test-6bf30364-3c62-493d-b3c1-848012fb8731",
        "namespace":"websocket",
        "resourceVersion":"0868647",
        "uid":"6bf30364-3c62-493d-b3c1-848012fb8731",
        "deletionGracePeriodSeconds": 30,
        "deletionTimestamp": "2023-03-10T09:14:49Z"
    },
    "spec":{
        "Volumes":[
        {
            "hostPath":{
                "path":"/home/mmc/data/",
                "type":""
            },
            "name":"11"
        },
       {
            "emptyDir":{
                "medium":"Memory"
            },
            "name":"22"
        },
        {
            "configMap":{
                "defaultMode":420,
                "name":"configmap"
            },
            "name":"44"
        }
       ],
        "containers":[{
            "env":[{
                "name":"ABCD",
                "value":"5000"
            }],
            "image":"xxxxxx/library/root-test:2.0",
            "imagePullPolicy":"IfNotPresent",
            "livenessProbe":{
                "exec":{
                    "command":[
                        "/bin/echo"
                    ]
                },
                "failureThreshold":3,
                "initialDelaySeconds":20,
                "periodSeconds":30,
                "successThreshold":1,
                "timeoutSeconds":10
            },
           "readinessProbe":{
                "failureThreshold":3,
                "httpGet":{
                    "Host":"127.0.xx.xx",
                    "Path":"/tmp/test",
                    "Port":10000,
                    "Scheme":"http"
                },
                "initialDelaySeconds":20,
                "periodSeconds":30,
                "successThreshold":1,
                "timeoutSeconds":10
            },
            "name":"container-0",
            "ports":[{
                "containerPort":33,
                "hostPort":3000,
                "protocol":"TCP",
                "hostIP": "127.0.xx.xx"
            },
            {
                "containerPort":44,
                "hostPort":4000,
                "protocol":"TCP",
                "hostIP": "127.0.xx.xx"
            }],
            "resources":{
                "limits":{
                    "cpu":"1",
                    "memory":"512Mi"
                },
                "requests":{
                    "cpu":"0.25",
                    "memory":"512Mi"
                }
            },
            "securityContext":{
                "capabilities":{
                    "add":[
                        "SETPCAP",
                        "MKNOD"
                    ]
                },
                "privileged":false,
                "runAsGroup":1024,
                "runAsUser":1024
            },
            "terminationMessagePath":"/dev/termination-log",
            "terminationMessagePolicy":"File",
            "volumeMounts":[{
                "mountPath":"/etc/localtime",
                "name":"localtime",
                "readOnly":true
            },
            {
                "mountPath":"/home/mmc/data/",
                "name":"11",
                "readOnly":false
            },
            {
                "mountPath":"/tmp1",
                "name":"22",
                "readOnly":true
            },
            {
                "mountPath":"/tmp3",
                "name":"44",
                "readOnly":true
            }
          ]
        }],
        "dnsPolicy":"ClusterFirst",
        "hostNetwork":false,
        "imagePullSecrets":[{
            "name":"fusion-director-docker-registry-secret"
        }],
        "restartPolicy":"Always",
        "schedulerName":"default-scheduler",
        "securityContext":{},
        "serviceAccount":"default",
        "serviceAccountName":"default",
        "terminationGracePeriodSeconds":30,
        "tolerations":[{
            "effect":"NoExecute",
            "key":"node.kubernetes.io/unreachable",
            "operator":"Exists"
        },
        {
            "effect":"NoExecute",
            "key":"node.kubernetes.io/not-ready",
            "operator":"Exists"
        },
        {
            "effect":"NoExecute",
            "key":"node.kubernetes.io/network-unavailable",
            "operator":"Exists"
        }]
    }
}

The following table describes some pod parameters. For details about other pod parameters, see the official Kubernetes documentation.

Level-1 Resource

Level-2 Resource

Level-3 Resource

Level-4 Resource

Level-5 Resource

Description

metadata

-

-

-

-

Type: struct

-

creationTimestamp

-

-

-

Type: string

Value: a string in the time.RFC3339 format, for example, 2006-01-02T15:04:05Z07:00

-

name

-

-

-

Meaning: pod name

Type: string

Value: matching the regular expression ^[a-z0-9]([a-z0-9-]{0,126}[a-z0-9]){0,1}$

-

namespace

-

-

-

Optional field

Type: string

Value: websocket or mef-user

-

resourceVersion

-

-

-

Type: string

Value: matching the regular expression ^[a-zA-Z0-9]{0,64}$

-

uid

-

-

-

Type: string

Value: matching the regular expression ^([0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}){0,1}$

-

deletionTimestamp

-

-

-

Type: string

Value: a string in time.RFC3339 format. This parameter is carried when a pod is deleted.

-

deletionGracePeriodSeconds

-

-

-

Type: *int64

This parameter is carried when a pod is deleted.

spec

-

-

-

-

Type: struct

-

Volumes

-

-

-

Type: []Volume

Value: The maximum slice length is 256.

-

-

hostPath

-

-

Type: *HostPathVolumeSource

-

-

-

path

-

Type: string

Value: matching the regular expression ^/[a-z0-9A-Z_./-]+$. (The value contains a maximum of 1024 characters and cannot contain two consecutive dots (..).)

-

-

-

type

-

Type: *HostPathType

Value: ""

-

-

configMap

-

-

Type: *ConfigMapVolumeSource

-

-

-

defaultMode

-

Type: int32

Value: 0644

-

-

-

name

-

Type: string

Value: matching the regular expression ^[a-z][a-z0-9-]{2,62}[a-z0-9]$

-

-

emptyDir

-

-

Type: *EmptyDirVolumeSource

-

-

-

medium

-

Type: string

Value: "" (empty character string)

-

-

name

-

-

Type: string

Value: matching the regular expression ^^[a-zA-Z0-9-]{1,63}$

-

containers

-

-

-

Type: []Container

Value: The slice length ranges from 1 to 10.

-

-

env

-

-

Type: []EnvVar

Value: a maximum of 256

-

-

-

name

-

Type: string

Value: matching the regular expression ^[a-zA-Z][a-zA-z0-9._-]{0,30}[a-zA-Z0-9]$

-

-

-

value

-

Type: string

Value: ^[a-zA-Z0-9 _./:-]{1,512}$

-

-

image

-

-

Type: string

Value: matching the regular expression ^[a-zA-Z0-9:_/.-]{1,288}$

-

-

imagePullPolicy

-

-

Optional field

Type: string

Value: IfNotPresent or Always

-

-

livenessProbe or ReadinessProbe

-

-

Type: *Probe

-

-

-

exec

-

Type: *ExecAction

-

-

-

-

Command

Type: []string

Value: The slice length can only be 1. The element value matches the regular expression ^/[a-z0-9A-Z_./-]+$ and cannot exceed 1024 characters. Two consecutive periods (..) are not allowed.

-

-

-

failureThreshold

-

Type: int32

Value: 3

-

-

-

httpGet

-

Type: *HTTPGetAction

-

-

-

-

Host

Type: string

Value: a valid IP address string

-

-

-

-

Path

Type: string

Value: matching the regular expression ^/[a-z0-9A-Z_./-]+$ and supporting a maximum of 1024 characters. If the value is empty, probe parameters are not verified. Two consecutive periods (..) are not allowed.

-

-

-

-

Port

Type: int32

Value: [1,65535]

-

-

-

-

Scheme

Type: string

Value: HTTP or HTTPS

-

-

-

initialDelaySeconds

-

Optional field

Type: int32

Value: [1,3600]

-

-

-

periodSeconds

-

Optional field

Type: int32

Value: [1,3600]

-

-

-

successThreshold

-

Type: int32

Value: 1

-

-

-

timeoutSeconds

-

Optional field

Type: int32

Value: [1,3600]

-

-

name

-

-

Type: string

Value: matching the regular expression ^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9]){0,1}$

-

-

ports

-

-

Type: []ContainerPort

Value: a maximum of 16

-

-

-

containerPort

-

Type: int32

Value: [1,65535]

-

-

-

hostPort

-

Type: int32

Value: [1024,65535]

-

-

-

protocol

-

Type: string

Value: TCP or UDP

-

-

-

hostIP

-

Type: string

Value: a valid IPv4 address that cannot be empty, all 0s, or all 255s

-

-

resources

-

-

Type: struct

-

-

-

limits

-

Type: map[ResourceName]resource.Quantity

The value of ResourceName can be npu, cpu, memory, or huawei.com/Ascend310.

-

-

-

requests

-

Type: map[ResourceName]resource.Quantity

The value of ResourceName can be npu, cpu, memory, or huawei.com/Ascend310.

-

-

securityContext

-

-

Type: *SecurityContext

-

-

-

capabilities

-

Type: *Capabilities

Value: container capability

-

-

-

-

add

Type: []Capability

Value: a container capability to be added. A maximum of 5 capabilities can be added. For details, see the official container document.

-

-

-

privileged

-

Type: *bool

Value: false

-

-

-

runAsGroup

-

Type: *int64

Value: [1,65535]

-

-

-

runAsUser

-

Type: *int64

Value: [1,65535]

-

-

terminationMessagePath

-

-

Optional field

Type: string

Value: /dev/termination-log

-

-

terminationMessagePolicy

-

-

Optional field

Type: string

Value: File

-

-

volumeMounts

-

-

Type: []VolumeMount

Value: a maximum of 256

-

-

-

mountPath

-

Type: string

Value: matching the regular expression ^/[a-z0-9A-Z_./-]+$. (The value contains a maximum of 1024 characters and cannot contain two consecutive dots (..).)

-

-

-

name

-

Type: string

Value: matching the regular expression ^[a-zA-Z0-9-]{1,63}$

-

-

-

readOnly

-

Type: bool

Value: The value must be true.

-

dnsPolicy

-

-

-

Optional field

Type: string

Value: ClusterFirst

-

hostNetwork

-

-

-

Type: bool

-

imagePullSecrets

-

-

-

Optional field

Type: []LocalObjectReference

Value: image-pull-secret or fusion-director-docker-registry-secret

-

-

name

-

-

Type: string

Value: image-pull-secret or fusion-director-docker-registry-secret

-

restartPolicy

-

-

-

Optional field

Type: string

Value: Always, OnFailure, or Never

-

schedulerName

-

-

-

Optional field

Type: string

Value: default-scheduler

-

securityContext

-

-

-

Type: *SecurityContext

-

serviceAccount

-

-

-

Optional field

Type: string

Value: default

-

ServiceAccountName

-

-

-

Optional field

Type: string

Value: default

-

terminationGracePeriodSeconds

-

-

-

Optional field

Type: *int64

Value: 30

-

tolerations

-

-

-

Type: []Toleration

Value: The maximum value is 16.

-

-

effect

-

-

Type: string

Value: NoSchedule, PreferNoSchedule, or NoExecute

-

-

key

-

-

Type: string

Value: The value starts with node.kubernetes.io and contains a maximum of 128 characters.

-

-

operator

-

-

Type: string

Value: Exists or Equal

Result returned

{
    "header": {
        "id": "",
        "msg_id": "43b2b936-c1da-4a4b-b4d7-d3ec9dab7bbf",
        "parentId": "",
        "parent_msg_id": "85c67925-5768-4edd-b40e-32cf106e07e8",
        "timestamp": 1652168718438,
        "version": "",
        "resourceversion": "",
        "isSync": false,
        "sync": false,
        "nodeId": "",
        "peerInfo": {}
    },
    "router": {
        "source": "",
        "destination": "",
        "option": "",
        "resource": ""
    },
    "route": {
        "source": "controller",
        "group": "resource",
        "operation": "response",
        "resource": "websocket/pod/{pod_name}"
    },
    "content": "OK"
}