Updated on 2024-04-11 GMT+08:00

Creating a Container

You can add Kubernetes containers to CBH for management. This section describes how to add a container to CBH.

Constraints

  • You must have the permission on the container to perform operations.
  • The Kubernetes server where the container is located has been added to the bastion host for management. For details, see Creating a Kubernetes Server.
  • To use this function, the bastion host version must be V3.3.48.0 or later.

Procedure

  1. Log in to the CBH system.
  2. Choose Resource > Cloud Service. The Cloud Service is displayed.
  3. Click New in the upper left corner. Configure parameters in the dialog box that is displayed.

    Figure 1 Creating a Container
    Table 1 Parameters for creating a container

    Parameter

    Description

    Container Name

    Enter a container name.

    Kubernetes Server

    Select the Kubernetes server that you added in Creating a Kubernetes Server.

    Namespace

    Namespace where the container to be managed is located.

    Pod

    (Optional) Select the pod where the container to be managed is located.

    If there are only containers to be managed in the pod, you do not need to select pods.

    Container

    (Optional) Select the container to be managed.

    If there are multiple containers in the pod and none of them are selected, the system automatically connects to the first container in the pod by default.

    exec-command

    (Optional) Enter the pre-running command in the container.

    If you do not set this parameter, then no command will be executed, and the input/output is attached to the main process of the container.

    NOTE:

    If you set this parameter, the connection is similar to kubectl exec.

    If you do not set this parameter, the connection is similar to kubectl attach.

    Department Name

    Select the department of the container to be managed.

    Label

    Add a label for the container to be managed.

    Container Description

    Description about the container

  4. Click OK. The container has been managed.