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

CCE.Ingress

Element Description

The CCE.Ingress element is used to create an Ingress object in the Kubernetes cluster on CCE. Currently, the Kubernetes native YAML file can be directly used to create such an 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

Ingress object in the Kubernetes cluster created by the CCE service

Type: dict

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

Suggestion: Enter the native YAML file content of the Kubernetes object.

clusterId

No

ID of the CCE cluster to which the resource belongs (the cluster version must be 1.7 or later)

Type: HuaweiCloud.CCE.Cluster.Id

Value Description: ID of an existing or new container cluster, for example, 32589333-5da1-11e8-9567-0255ac102136.

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

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

Ingress name

Blueprint Example

tosca_definitions_version: huaweicloud_tosca_version_1_0
inputs:
  clusterID:
    default: 32589333-5da1-11e8-9567-0255ac102136
    type: string
  ingressname:
    default: ingress-test
    type: string
  namespace:
    default: default
    type: string
  secretName:
    default: tenant-management-service-server
    type: string
  serviceName:
    default: aos-apiserver
    type: string
  servicePort:
    default: 31800
    type: integer
node_templates:
  my-ingress:
    type: HuaweiCloud.CCE.Ingress
    properties:
      k8sManifest:
        apiVersion: extensions/v1beta1
        kind: Ingress
        metadata:
          clusterId:
            get_input: clusterID
          labels:
            stack-name: aos-aos
            zone:
              get_input: ingressname
          name:
            get_input: ingressname
          namespace:
            get_input: namespace
          selfLink: /apis/extensions/v1beta1/namespaces/aos/ingresses/aos-apiserver-region-ingress
          uid: 56118da4-2d89-11e8-9ed3-286ed488d4c7
        spec:
          rules:
            - http:
                paths:
                  - backend:
                      serviceName:
                        get_input: serviceName
                      servicePort:
                        get_input: servicePort
                    path: /v2/user/agencies
                    property:
                      ingress.beta.kubernetes.io/enable-checksession: 'true'
          tls:
            - secretName:
                get_input: secretName