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

CCE.DaemonSet

Element Description

The CCE.DaemonSet element is used to create a DaemonSet object in the Kubernetes cluster. Currently, the Kubernetes native YAML file can be used to create the object.

Element Properties

Table 1 Property Description

Property

Required

Descripiton

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.

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 and labels under the metadata during an update.

Value Constraint: This field cannot be empty.

Suggestion: Compilation guide for your reference: https://support.huaweicloud.com/eu/api-cce/cce_02_0133.html

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 obtain its cluster ID. Connect to the cluster object and use the get_reference function to automatically obtain the value.

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

DaemonSet name

Blueprint Example

tosca_definitions_version: huaweicloud_tosca_version_1_0
inputs:
  clusterId:
    default: 774e6cef-01a3-11e8-8d80-0255ac101b56
  containername:
    default: daemonset-123
    type: string
  deploymentname:
    default: mydaemonset
    type: string
  image:
    default: nginx
    type: string
  imagePullPolicy:
    default: IfNotPresent
    type: string
  labels:
    default: mydaemonset
    type: string
  namespace:
    default: default
    type: string
node_templates:
  my-daemonset:
    type: HuaweiCloud.CCE.DaemonSet
    properties:
      clusterId:
        get_input: clusterId
      k8sManifest:
        apiVersion: 'apps/v1'
        kind: DaemonSet
        metadata:
          labels:
            name:
              get_input: labels
          name:
            get_input: deploymentname
        spec:
          selector:
            matchLabels:
              name:
                get_input: labels
          template:
            metadata:
              labels:
                name:
                  get_input: labels
            spec:
              containers:
                - image:
                    get_input: image
                  imagePullPolicy:
                    get_input: imagePullPolicy
                  name:
                    get_input: containername
              imagePullSecrets: 
                - name: default-secret
      namespace:
        get_input: namespace