Deployments

    For more information, see the official documentation of Kubernetes.

    You need to create a workspace, a project and a user (). The user must be invited to the project with the role of operator. For more information, see .

    Log in to the console as . Go to Application Workloads of a project, select Workloads, and click Create under the tab Deployments.

    Step 2: Enter basic information

    Specify a name for the Deployment (for example, demo-deployment) and click Next to continue.

    Step 3: Set a Pod

    1. Before you set an image, define the number of replicated Pods in Pod Replicas by clicking or Deployments - 图2, which is indicated by the field in the manifest file.

      Tip

      You can see the Deployment manifest file in YAML format by enabling Edit YAML in the upper-right corner. KubeSphere allows you to edit the manifest file directly to create a Deployment. Alternatively, you can follow the steps below to create a Deployment via the dashboard.

    2. Click Add Container.

    3. Set requests and limits for CPU and memory resources based on your needs. For more information, see Resource Request and Resource Limit in Container Image Settings.

    4. Click Use Default Ports for Port Settings or you can customize Protocol, Name and Container Port.

    5. For other settings (Health Check, Start Command, Environment Variables, Container Security Context and Synchronize Host Timezone), you can configure them on the dashboard as well. For more information, see detailed explanations of these properties in . When you finish, click in the lower-right corner to continue.

    6. Select an update strategy from the drop-down menu. It is recommended that you choose Rolling Update. For more information, see Update Strategy.

    7. Select a Pod scheduling rule. For more information, see .

    8. Click Next to continue when you finish setting the Pod.

    You can add a volume directly or mount a ConfigMap or Secret. Alternatively, click Next directly to skip this step. For more information about volumes, visit Volumes.

    Note

    Deployments can’t use a volume template, which is used by StatefulSets.

    Step 5: Configure advanced settings

    You can set a policy for node scheduling and add metadata in this section. When you finish, click Create to complete the whole process of creating a Deployment.

    • Select Nodes

      Assign Pod replicas to run on specified nodes. It is specified in the field .

    • Add Metadata

      Additional metadata settings for resources such as Labels and Annotations.

    Details page

      • Edit Information: View and edit the basic information.
      • Edit YAML: View, upload, download, or update the YAML file.
      • Re-create: Re-create the Deployment.
      • Delete: Delete the Deployment.
    1. Click More to display the operations about this Deployment you can do.

      • Roll Back: Select the revision to roll back.
      • Edit Autoscaling: Autoscale the replicas according to CPU and memory usage. If both CPU and memory are specified, replicas are added or deleted if any of the conditions is met.
      • Edit Settings: Configure update strategies, containers and volumes.
      • Edit YAML: View, upload, download, or update the YAML file.
      • Re-create: Re-create this Deployment.
      • Delete: Delete the Deployment, and return to the Deployment list page.
    2. Click the Resource Status tab to view the port and Pod information of the Deployment.

      • Replica Status: Click or Deployments - 图5 to increase or decrease the number of Pod replicas.

      • Pods

        • The Pod list provides detailed information of the Pod (status, node, Pod IP and resource usage).
        • You can view the container information by clicking a Pod item.
        • Click the container log icon to view output logs of the container.
        • You can view the Pod details page by clicking the Pod name.

    After the resource template of workload is changed, a new log will be generated and Pods will be rescheduled for a version update. The latest 10 versions will be saved by default. You can implement a redeployment based on the change log.

    Metadata

    Click the Metadata tab to view the labels and annotations of the Deployment.

    Monitoring

    1. Click the Monitoring tab to view the CPU usage, memory usage, outbound traffic, and inbound traffic of the Deployment.

    2. Click the drop-down menu in the upper-right corner to customize the time range and sampling interval.

    3. Click in the upper-right corner to manually refresh the data.

    Click the Environment Variables tab to view the environment variables of the Deployment.

    Events