Updated on 2023-12-13 GMT+08:00

CCI.StatefulSet

Element Description

The CCI.StatefulSet element is used to create a StatefulSet.

Element Properties

Table 1 Property Description

Property

Required

Descripiton

k8sManifest

Yes

Native manifest of the StatefulSet object of the Kubernetes

Type: dict

Value Description: This field can be customized. You are advised to use a public image (uploading an image to SWR and setting the image type to public). When updating the image, do not change the name and labels under metadata. If replicas under spec is specified using a get_input function, set type to integer.

Value Constraint: This field cannot be empty.

Suggestion: Customize the value. For details, visit https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/.

namespace

Yes

Namespace in a cluster where a resource is located

Type: HuaweiCloud.CCI.Namespace.Name

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 CCI console. In the navigation pane on the left, choose Namespaces. View and select the target namespace.

Relationships Between Elements

Table 2 Relationship description

Description

Target

DependsOn

RDS.MySQL

DependsOn

CCI.Secret

DependsOn

CCI.Job

DependsOn

CCI.StatefulSet

DependsOn

CCI.Storage.EVS

DependsOn

DCS.Redis

DependsOn

CCI.Service

DependsOn

CCI.Deployment

DependsOn

CCI.Storage.SFS

DependsOn

CCI.ConfigMap

DependsOn

RDS.PostgreSQL

DependsOn

CCI.Ingress

DependsOn

AOS.Batch

DependsOn

OBS.Bucket

ContainedIn

CCI.Namespace

Return Value

Property

Type

Description

refName

string

Name of a stateful service

refLabelsApp

string

Name of label app

Blueprint Example

tosca_definitions_version: huaweicloud_tosca_version_1_0
inputs:
  cciss1pe_namespace:
    description: Namespace in a cluster where a resource is located
    label: ''
node_templates:
  cciss1pe:
    type: HuaweiCloud.CCI.StatefulSet
    properties:
      k8sManifest:
        kind: StatefulSet
        spec:
          replicas: 1
          serviceName: statefulsettest3
          template:
            spec:
              imagePullSecrets:
                - name: default-secret
              containers:
                - image: 'nginx:stable-alpine-perl'
                  name: ll-test
                  resources:
                    requests:
                      cpu: 4
                      memory: 8Gi
                    limits:
                      cpu: 4
                      memory: 8Gi
            metadata:
              labels:
                app: ll-test
          selector:
            matchLabels:
              app: ll-test
        apiVersion: 'apps/v1'
        metadata:
          labels:
            app: ll-test
          name: statefulsettest3
      namespace:
        get_input: cciss1pe_namespace