Creating a Pod
Scenario
You can use CCI 2.0 to quickly create pods for running workloads. On the CCI 2.0 console, you can view details about all pods, such as basic information, container list, storage volumes, and events. In addition, you can use remote terminals to access pods. You can also delete pods if you no longer need them.
Prerequisites
- A namespace has been created. If there are no namespaces, create one by referring to Creating a Namespace.
- The image has been uploaded. For details, see Pushing an Image Through a Container Engine Client.
Constraints
There are system components that help run the pods. These system components occupy some underlying resources, such as vCPU and memory. As a result, the resource usages for the pods may not reach the expected limits. To avoid this, refer to Reserved System Overhead.
Creating a Pod
- Log in to the CCI 2.0 console.
- In the navigation pane, choose Workloads. On the Pods tab, click Create Pod.
- On the Create Pod page, enter the basic information.
Parameter
Description
Pod Name
- Enter a name for the pod. The name must be unique in the same namespace.
- Enter 1 to 204 characters. Start and end with a lowercase letter or digit. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. The total length of the pod name and namespace name cannot exceed 217 characters.
Namespace
Namespace that the pod belongs to.
Description (Optional)
Enter a description, which cannot exceed 250 characters.
CPU Architecture
x86 or Kunpeng
Pod Type
General or General-computing-lite
NOTE:Only x86-based general-computing-lite pods are supported.
vCPUs
Select a value from 0.25 to 64.
Memory
Select the memory based on the selected vCPUs.
Data Storage (Optional)
Only emptyDir volumes, ConfigMaps, and secrets are supported. Add a volume to the pod and then mount the volume to the specified container.
Click Add Data Store, select a volume type, and enter a volume name.- emptyDir volume: By default, CCI provides 30 GiB of free storage space, which is shared by emptyDir volumes and the system disk.
- ConfigMap: Select a ConfigMap. If no ConfigMaps are available, create one first. For details, see Creating a ConfigMap.
- Secret: Select a secret. If no secrets are available, create one first. For details, see Creating a Secret.
- Specify container settings.
- Add basic container information. The total resources of a container cannot exceed the pod flavor.
Table 1 Basic container information Parameter
Description
Container Name
- The container name must be unique.
- Enter 1 to 63 characters starting and ending with a lowercase letter or digit. Only lowercase letters, digits, and hyphens (-) are allowed.
Image
Select a container image.
CAUTION:Custom domain name images of the SWR Enterprise Edition cannot be used to create workloads.
Image Version
Select a container image tag.
vCPUs
Specify the vCPUs. The value cannot exceed that in the pod flavor.
Memory
Specify the memory. The value cannot exceed that in the pod flavor.
- (Optional) Specify advanced container settings.
Table 2 Advanced container settings Parameter
Description
Lifecycle
CCI 2.0 provides containers with lifecycle hooks, which enable containers to run code triggered by events during their lifecycle. For example, if you want a container to perform a certain operation before it is stopped, you can register a hook. For details, see Lifecycle. CCI provides the following lifecycle hooks:
- Startup command: Docker ENTRYPOINT commands are used.
- PostStart: This hook is triggered after an application is started.
- PreStop: This hook is triggered before an application is stopped.
Health Check
Container health can be checked regularly when the container is running. For details, see Health Check.
CCI supports the following types of probes:
- Liveness probe: checks whether a container is normal and a restart is required.
- Readiness probe: checks whether a container is ready to respond to requests.
- Startup probe: checks whether an application has already started.
Environment Variables
Environment variables affect the way a running container will behave. You can update them after deploying the workload.
Data Storage
Volumes can be mounted to containers to read data from files or store data files persistently. To mount a volume to a container, add the volume to the pod first.
Security Settings
Specify a user ID for all the containers to run with. For example, enter 0 to run as root.
- Add basic container information. The total resources of a container cannot exceed the pod flavor.
- (Optional) Select an image repository access credential.
- Click Create Now.
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