CCE.Job
Element Description
The CCE.Job element is used to create a Job object in the Kubernetes cluster on Huawei CCE.
For example, if you want to run a container to execute a specific task, the container does not need to exist once the task is completed. In this scenario, you can use jobs, which refer to one-time tasks. A job is performed to run a container. After the job completes, it automatically exits, and the cluster does not wake it up again.
Element Properties
Property |
Required |
Descripiton |
---|---|---|
k8sManifest |
Yes |
Native manifest of the job 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. Value Constraint: This field cannot be empty. Suggestion: Customize the value. For details, visit https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/. |
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. |
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: 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. |
Relationships Between Elements
Description |
Target |
---|---|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
DependsOn |
|
ContainedIn |
Return Value
Property |
Type |
Description |
---|---|---|
refName |
string |
Task name |
Blueprint Example
tosca_definitions_version: huaweicloud_tosca_version_1_0 inputs: job-image-addr: default: "*.*.*.*:20202/***/redis:V1" description: "job used image address." node_templates: ccej4ipi: type: HuaweiCloud.CCE.Job properties: k8sManifest: apiVersion: 'batch/v1' kind: Job metadata: name: my-job spec: template: metadata: name: my-job spec: containers: - command: - bash - '-c' - 'echo job finished > /var/log/job-finished' image: get_input: job-image-addr imagePullPolicy: IfNotPresent name: job-sample volumeMounts: - mountPath: '/var/log' name: sample imagePullPolicy: IfNotPresent imagePullSecrets: - name: default-secret restartPolicy: Never volumes: - hostPath: path: '/var/log' name: sample
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot