Deploying Workloads

Deploy a workload to run an application in one or more containers.

  1. In the upper left corner, click ☰ > Cluster Management.

  2. Go to the cluster where you want to upgrade a workload and click Explore.

  3. In the left navigation bar, click Workload.

  4. Click Create.

  5. Choose the type of workload.

  6. Select the namespace where the workload will be deployed.

  7. Enter a Name for the workload.

  8. From the Container Image field, enter the name of the Docker image that you want to deploy to the project, optionally prefacing it with the registry host (e.g. quay.io, registry.gitlab.com, etc.). During deployment, Rancher pulls this image from the specified public or private registry. If no registry host is provided, Rancher will pull the image from Docker Hub. Enter the name exactly as it appears in the registry server, including any required path, and optionally including the desired tag (e.g. registry.gitlab.com/user/path/image:tag). If no tag is provided, the latest tag will be automatically used.

  9. Either select an existing namespace, or click Add to a new namespace and enter a new namespace.

  10. Click Add Port to enter a port mapping, which enables access to the application inside and outside of the cluster . For more information, see Services.

  11. Configure the remaining options:

    • Environment Variables

      Use this section to either specify environment variables for your workload to consume on the fly, or to pull them from another source, such as a secret or ConfigMap.

    • Node Scheduling

    • Health Check

    • Volumes

      Use this section to add storage for your workload. You can manually specify the volume that you want to add, use a persistent volume claim to dynamically create a volume for the workload, or read data for a volume to use from a file such as a ConfigMap.

      When you are deploying a Stateful Set, you should use a Volume Claim Template when using Persistent Volumes. This will ensure that Persistent Volumes are created dynamically when you scale your Stateful Set.

    • Scaling/Upgrade Policy

    Deploying Workloads - 图1Amazon Note for Volumes:

    To mount an Amazon EBS volume:

  12. Click Show Advanced Options and configure:

    • Command
    • Networking
    • Labels & Annotations
    • Security and Host Config
  13. Click Launch.

Result: The workload is deployed to the chosen namespace. You can view the workload’s status from the project’s Workloads view.