Updated on 2023-08-11 GMT+08:00

CCE.Pod

Element Description

The CCE.Pod element is used to create a pod in the Kubernetes cluster on the CCE.

Element Properties

Table 1 Property Description

Property

Required

Descripiton

k8sManifest

Yes

Native YAML file content of the Kubernetes object

Type: dict

Value Description: Supports customization. You are advised to use a public image (which is uploaded to the image repository and whose type is set to public), and not to change the name under the metadata during an update.

Value Constraint: This field cannot be empty.

Suggestion: For details, visit https://support.huaweicloud.com/eu/api-cce/cce_02_0133.html.

name

No

Pod name

Type: string

Value Description: Supports customization, for example, :my-pod.

Value Constraint: The value supports a maximum of 63 characters and must start with a letter. Only lowercase letters, digits, and hyphens (-) are allowed.

clusterId

No

ID of the cluster to which the resource belongs

Type: HuaweiCloud.CCE.Cluster.Id

Value Description: Indicates the ID of an existing or new container cluster.

Value Constraint: The value must satisfy the UUID rule and support a maximum of 64 characters.

Suggestion: Enter the cluster ID. Specifically, log in to the CCE console, and choose Resource Management > Clusters. Click the target cluster, and you can then obtain its cluster ID. Connect to the cluster object and use the get_reference function to obtain the cluster ID.

namespace

No

Namespace in a cluster where a resource is located

Type: string

Value Description: Must be a valid namespace in the cluster, for example, default.

Value Constraint: The value must start with a letter. Only lowercase letters, digits, and hyphens (-) are allowed.

Suggestion: Log in to the CCE console, and choose Resource Management > Namespaces. View and select the target namespace.

Relationships Between Elements

Table 2 Relationship description

Description

Target

DependsOn

AOS.Batch

DependsOn

DCS.Redis

DependsOn

RDS.MySQL

DependsOn

CCE.Storage.EVS

DependsOn

OBS.Bucket

DependsOn

CCE.Storage.SFS

DependsOn

CCE.ConfigMap

DependsOn

CCE.Job

DependsOn

CCE.Storage.OBS

DependsOn

CCE.DaemonSet

DependsOn

CCE.Secret

DependsOn

CCE.Service

DependsOn

CCE.Ingress

DependsOn

CCE.StatefulSet

DependsOn

CCE.NodePool

DependsOn

CCE.Deployment

DependsOn

CCE.Pod

DependsOn

RDS.PostgreSQL

ContainedIn

CCE.Cluster

Return Value

Property

Type

Description

refName

string

Pod name

Blueprint Example

tosca_definitions_version: huaweicloud_tosca_version_1_0
node_templates:
  ccepxbto:
    type: HuaweiCloud.CCE.Pod
    properties:
      k8sManifest:
        kind: Pod
        spec:
          containers:
            - image:
                get_input: ccepxbto_k8sManifest_spec_containers_0_image
              imagePullSecrets:
                - name: default-secret
              name: test
              restartPolicy: Always
              imagePullPolicy: Always
        apiVersion: v1
        metadata:
          labels:
            name: pod-test
          name: pod-test
      name:
        get_input: ccepxbto_name
      clusterId:
        get_input: ccepxbto_clusterId
      namespace:
        get_input: ccepxbto_namespace
inputs:
  ccepxbto_k8sManifest_spec_containers_0_image:
    description: Image of the cluster
    label: Pod
  ccepxbto_name:
    description: Pod name
    label: Pod
  ccepxbto_clusterId:
    description: ID of the cluster
    label: Pod
  ccepxbto_namespace:
    description: Namespace in a cluster where a resource is located
    label: Pod
outputs:
  name:
    value:
      get_attribute:
        - ccepxbto
        - refName
    description: pod name