Updated on 2026-04-28 GMT+08:00

Configuring a Port for Obtaining the Pod Information

CCI will provide the PodList if you enable the HTTP service on a specific port. This port is read-only and can be configured using an annotation. Containers can access http://127.0.0.1:<port>/pods to obtain the PodList. This allows observability tools (such as monitoring and logging tools) in service containers to access the pod information in real time for real-time monitoring of pod statuses.

If the podSpec.extraEphemeralStorage parameter is configured for a pod and the PodList is queried using this parameter, the configuration is synchronized to resource.cci.io/extra-ephemeral-storage-in-GiB of metadata.annotations.

Configuration Example

apiVersion: cci/v2
kind: Pod
metadata:
  annotations:
    resource.cci.io/pod-size-specs: 0.25_0.5
    resource.cci.io/instance-type: general-computing # Pod type
    observability.cci.io/read-only-port: "10255" # Port for obtaining the PodList
  labels:
    app: nginx
  name: 'test1'
spec:
  containers:
  - name: nginx
    image: centos:nginx
    ports:
    - containerPort: 80
  dnsPolicy: ''
  imagePullSecrets:
    - name: imagepull-secret
  dnsConfig: {}
Table 1 Annotation

Annotation

Mandatory

Type

Description

observability.cci.io/read-only-port

Yes

String

Description: port for obtaining the PodList. You can configure the port through an annotation. Containers can access http://127.0.0.1:<read-only-port>/pods to obtain the PodList.

Constraints:

  • The port number is from 1 to 65535 and cannot conflict with the configured metrics port (default port: 19100) and the container port that uses the TCP protocol.
  • This pod annotation cannot be modified.