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

CCI.Service

Element Description

The CCI.Service element is used to create a service.

Element Properties

Table 1 Property Description

Property

Required

Descripiton

k8sManifest

Yes

Description file of the Kubernetes service

Type: dict

Value Description: Supports customization. You are not advised to change the name and labels under the metadata during an update.

Suggestion: For details, see the Kubernetes official guide at https://kubernetes.io/docs/concepts/services-networking/service.

namespace

Yes

Namespace in a cluster where a service is located

Type: HuaweiCloud.CCI.Namespace.Name

Value Description: Supports customization.

Value Constraint: The value must start with a letter. Only lowercase letters, digits, and hyphens (-) are allowed. The length of namespace can't be over 63.

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

Connected

ULB.LoadBalancer

Return Value

Property

Type

Description

refID

string

UID of the cci service

refName

string

Name of the cci service

Blueprint Example

tosca_definitions_version: huaweicloud_tosca_version_1_0
node_templates:
  service:
    properties:
      k8sManifest:
        apiVersion: v1
        kind: Service
        metadata:
          annotations:
            'service.beta.kubernetes.io/role': tenant
          labels:
            app: aos-apiserver-edec06ac-d
            appgroup: cde-cde_aos
            name: aos-apiserver
          name: service-hy
        spec:
          ports:
            - name: https
              nodeport: 30280
              port: 30210
              protocol: TCP
              targetPort: 9763
          selector:
            app: trm-apiserver-e2f63e54-f
          sessionAffinity: None
          type: LoadBalancer
      namespace:
        get_input: ns
    type: HuaweiCloud.CCI.Service
inputs:
  ns:
    description: Namespace where the service locates
    label: ''