# Managing Workloads

> Source: https://parallelworks.com/docs/kubernetes/managing-workloads

# Managing Workloads

The Workloads view provides a unified interface for monitoring and managing Kubernetes workloads across all your connected clusters. You can inspect resource status, view detailed metadata, edit configurations, and delete workloads directly from the platform.

## Navigating the Workloads View

Access the workloads view by navigating to **Kubernetes > Workloads** in the sidebar. The page displays a filterable, sortable table of all workloads across your connected clusters.

## Supported Workload Types

The platform supports the following Kubernetes workload types:

| Type | Description |
|------|-------------|
| **Deployment** | Manages stateless application replicas with rolling updates |
| **StatefulSet** | Manages stateful applications with persistent storage and ordered deployment |
| **DaemonSet** | Ensures a pod runs on all (or selected) nodes in a cluster |
| **Job** | Runs a task to completion with a specified number of completions |
| **CronJob** | Schedules Jobs to run on a recurring cron-based schedule |
| **Pod** | The smallest deployable unit in Kubernetes |
| **ReplicaSet** | Maintains a stable set of replica pods (typically managed by a Deployment) |

## List View

The workloads list view presents all workloads in a sortable table. Click any column header to sort by that field.

### Filtering

The filter bar at the top of the table provides several ways to narrow down the displayed workloads:

- **Cluster** -- Select one or more clusters to show workloads from only those clusters. When no cluster is selected, workloads from all connected clusters are shown.
- **Namespace** -- Filter by one or more Kubernetes namespaces.
- **Type** -- Filter by workload type (Deployment, StatefulSet, DaemonSet, Job, CronJob, Pod).
- **Search** -- Type a name to filter workloads by name. The search is case-insensitive and matches partial names.

Use the **Clear all** button to reset all active filters at once.

### Table Columns

Each row in the workloads table displays the following information:

| Column | Description |
|--------|-------------|
| **Name** | The workload name. Click to open the detail view. |
| **Namespace** | The Kubernetes namespace the workload belongs to. |
| **Cluster** | The cluster where the workload is running. |
| **Type** | The workload type (Deployment, StatefulSet, etc.). |
| **Status** | A color-coded status indicator showing the current state of the workload. |
| **Pods** | The number of ready pods versus total pods (e.g., `3/3`). |
| **CPU** | Current CPU usage, when metrics are available. |
| **Memory** | Current memory usage, when metrics are available. |
| **Restarts** | Total container restart count across all pods. |

### Status Indicators

Workload status is shown with a color-coded icon:

- **Ok / Running** -- The workload is healthy and all expected pods are ready.
- **Pending** -- The workload is starting up or waiting for resources.
- **Failed** -- The workload has encountered an error.
- **Completed** -- The workload (Job) has finished successfully.
- **Unknown** -- The status could not be determined.

## Detail View

Click on any workload name in the list to open its detail view. The detail page shows comprehensive information about the selected resource.

### Resource Metadata

The top panel displays key metadata fields that vary by workload type:

**Common fields across all types:**
- Name, Namespace, Resource Version, and Creation Timestamp

**Deployment-specific fields:**
- Replica counts: updated, ready, available, and unavailable

**StatefulSet-specific fields:**
- Desired replicas, observed generation, associated service name, and persistent volume claim specifications

**DaemonSet-specific fields:**
- Pod counts: desired, current, ready, available, and unavailable
- Update strategy type

**Job-specific fields:**
- Parallelism, completions, backoff limit, active/ready/succeeded pod counts, start and completion times
- Job conditions table showing message, reason, type, status, and transition times

**CronJob-specific fields:**
- Cron schedule expression, last schedule time, concurrency policy, and starting deadline
- Job template specification with parallelism and completion settings

**Pod-specific fields:**
- Phase, host IP, pod IP, start time, and labels
- Container statuses table with name, ready state, restart count, image, and started state

**ReplicaSet-specific fields:**
- Owner references (API version, kind, name, UID, controller, block owner deletion)
- Desired, current, and ready replica counts

### Pod Template

For Deployments, StatefulSets, DaemonSets, Jobs, and CronJobs, the detail view includes a **Pod Template** section showing:

- Labels applied to pods
- Termination grace period
- Restart policy
- Init containers (if any)
- Containers
- Volumes

### Pod List

For workload types that manage pods (Deployments, StatefulSets, DaemonSets, ReplicaSets, and Jobs), the detail view includes a table of associated pods with columns for:

| Column | Description |
|--------|-------------|
| **Name** | Pod name (links to the pod detail view) |
| **Status** | Current pod phase (Running, Pending, etc.) |
| **Ready** | Ready containers vs. total containers (e.g., `1/1`) |
| **Restarts** | Total restart count across all containers |
| **Age** | Time since the pod was created |

### ReplicaSet History

For **Deployments**, the detail view includes a ReplicaSet history table showing all associated ReplicaSets sorted by revision number:

| Column | Description |
|--------|-------------|
| **Revision** | Deployment revision number (links to the ReplicaSet detail view) |
| **Name** | ReplicaSet name |
| **Desired** | Desired replica count |
| **Current** | Current replica count |
| **Ready** | Number of ready replicas |
| **Age** | Time since the ReplicaSet was created |

### Viewing JSON and YAML

The detail view provides both a structured view and a raw representation of the resource:

- The structured view displays the resource metadata and status in a readable format.
- Click **View / Edit YAML** to open a side drawer containing the full YAML representation of the resource.
- Use the **Copy** button in the YAML drawer to copy the resource definition to your clipboard.

## Editing Resources

You can edit any workload resource directly from the platform:

1. Navigate to the workload detail view.
2. Click **View / Edit YAML** to open the YAML editor drawer.
3. Modify the YAML in the built-in editor.
4. Click **Update resource** to apply the changes.

The platform sends the updated YAML to the Kubernetes API, which validates and applies the changes. If the update fails (for example, due to a validation error), an error message is displayed.

:::warning Full Replacement
Editing a resource YAML replaces the entire resource specification. Make sure you understand the impact of your changes before applying them.
:::

:::tip Rolling Updates
For Deployments, editing the pod template spec triggers a rolling update by default, creating a new ReplicaSet while scaling down the old one.
:::

## Deleting Workloads

To delete a workload, use the delete action on the workload. The delete operation supports two important options:

### Cascade vs. Orphan

- **Cascade** (default) -- Deletes the workload and all of its dependent resources. For example, deleting a Deployment with cascade enabled also deletes its ReplicaSets and Pods.
- **Orphan** -- Deletes only the workload itself, leaving dependent resources running. Orphaned pods continue to run but are no longer managed by a controller.

### Grace Period

The grace period controls how long Kubernetes waits for pods to shut down gracefully before force-terminating them. The default is **30 seconds**. During this period, pods receive a `SIGTERM` signal and can perform cleanup tasks such as draining connections or saving state.

:::warning Protected Namespace
Deleting workloads in the `kube-system` namespace is not permitted. This protects critical system components from accidental removal.
:::

:::info Supported Types
Supported workload types for deletion: Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob, and Pod.
:::

## Observability

The workload detail view includes an **Observability** panel with real-time metrics charts for:

- **CPU** usage over time
- **Memory** usage over time (in GB)
- **Storage** usage over time (in GiB)

You can select a time range of **1 Hour**, **3 Hours**, or **8 Hours** using the dropdown in the panel header. Metrics refresh automatically.

For more details on metrics, see [Workload Metrics](/docs/kubernetes/workload-metrics).
