K8SWORKLOAD: K8s Workload
A Kubernetes workload such as a Deployment, StatefulSet, DaemonSet, Job, or CronJob running container images in a namespace.
Default definition. This article describes the default
K8SWORKLOAD definition shipped with DemandFlow. Administrators can add, remove, rename, or re-type fields, change which ones are required, and alter the layout from the Definitions screen in Settings. Your tenant's current schema may differ from what is shown here. To read the current definition at any time, GET the DEFINITION object whose id matches K8SWORKLOAD.Entity properties
| Property | Value |
|---|---|
| Entity code | K8SWORKLOAD |
| Display name | K8s Workload |
| Plural | K8s Workloads |
| Level | 402 |
Use cases
K8SWORKLOAD represents the runnable unit in Kubernetes. The workloadType select covers all major controller kinds (Deployment, StatefulSet, DaemonSet, Job, CronJob, ReplicaSet, bare Pod) because each has different scaling and persistence semantics that operators must understand. The namespace objectLookup establishes the parent relationship to K8SNAMESPACE.
Fields
Workload Information
| Field | Type | Required | Notes |
|---|---|---|---|
name | text | Yes | Workload Name |
namespace | reference → K8SNAMESPACE | Yes | Namespace |
workloadType | enum | Yes | Workload Type Valid ids: 1 (Deployment), 2 (StatefulSet), 3 (DaemonSet), 4 (Job), 5 (CronJob), 6 (ReplicaSet), 7 (Pod). |
status | enum | Yes | Status Valid ids: 1 (Running), 2 (Pending), 3 (Failed), 4 (Succeeded), 5 (Unknown), 6 (Terminating), 7 (CrashLoopBackOff). |
application | text | Application or service name |
Container Configuration
| Field | Type | Required | Notes |
|---|---|---|---|
image | text | Yes | e.g., nginx:1.21 |
imageTag | text | Image Tag | |
imagePullPolicy | enum | Image Pull Policy Valid ids: 1 (Always), 2 (IfNotPresent), 3 (Never). | |
containerPort | number | Container Port | |
protocol | enum | Protocol Valid ids: 1 (TCP), 2 (UDP), 3 (SCTP). | |
command | text (multi-line) | Container command override |
Scaling & Replicas
| Field | Type | Required | Notes |
|---|---|---|---|
replicas | number | Yes | Desired Replicas |
readyReplicas | number | Ready Replicas Read only. | |
availableReplicas | number | Available Replicas Read only. | |
updatedReplicas | number | Updated Replicas Read only. | |
autoScalingEnabled | boolean | Auto Scaling Enabled | |
minReplicas | number | Min Replicas | |
maxReplicas | number | Max Replicas | |
targetCPUUtilization | number | For HPA |
Resource Requests
| Field | Type | Required | Notes |
|---|---|---|---|
cpuRequest | number | e.g., 100 = 0.1 CPU | |
memoryRequest | number | Memory Request (MB) | |
storageRequest | number | Ephemeral Storage (GB) | |
gpuRequest | number | GPU Request |
Resource Limits
| Field | Type | Required | Notes |
|---|---|---|---|
cpuLimit | number | CPU Limit (millicores) | |
memoryLimit | number | Memory Limit (MB) | |
storageLimit | number | Ephemeral Storage Limit (GB) | |
gpuLimit | number | GPU Limit |
Environment & Configuration
| Field | Type | Required | Notes |
|---|---|---|---|
envVars | text (multi-line) | KEY=VALUE format, one per line | |
configMaps | multiselect | ConfigMaps | |
secrets | multiselect | Secrets | |
serviceAccount | text | Service Account |
Volume Mounts
| Field | Type | Required | Notes |
|---|---|---|---|
volumeMounts | text (multi-line) | JSON format volume mount configuration | |
persistentVolumeClaims | multiselect | PVCs | |
hostPath | text | Host Path | |
emptyDir | boolean | Use EmptyDir |
Deployment Strategy
| Field | Type | Required | Notes |
|---|---|---|---|
updateStrategy | enum | Update Strategy Valid ids: 1 (RollingUpdate), 2 (Recreate), 3 (Blue-Green), 4 (Canary). | |
maxSurge | number | Max pods above desired | |
maxUnavailable | number | Max pods unavailable | |
revisionHistoryLimit | number | Revision History Limit | |
progressDeadlineSeconds | number | Progress Deadline (sec) |
Labels & Selectors
| Field | Type | Required | Notes |
|---|---|---|---|
labels | text (multi-line) | Key-value pairs (JSON) | |
selector | text (multi-line) | Label selector (JSON) | |
annotations | text (multi-line) | Key-value pairs (JSON) | |
nodeSelector | text (multi-line) | Node selection constraints |
Health Checks
| Field | Type | Required | Notes |
|---|---|---|---|
livenessProbe | enum | Liveness Probe Type Valid ids: 1 (None), 2 (HTTP GET), 3 (TCP Socket), 4 (Exec Command). | |
livenessPath | text | e.g., /health | |
livenessPort | number | Liveness Port | |
livenessInitialDelay | number | Initial Delay (sec) | |
livenessPeriod | number | Check Period (sec) | |
livenessTimeout | number | Timeout (sec) |
Readiness Check
| Field | Type | Required | Notes |
|---|---|---|---|
readinessProbe | enum | Readiness Probe Type Valid ids: 1 (None), 2 (HTTP GET), 3 (TCP Socket), 4 (Exec Command). | |
readinessPath | text | e.g., /ready | |
readinessPort | number | Readiness Port | |
readinessInitialDelay | number | Initial Delay (sec) | |
readinessPeriod | number | Check Period (sec) | |
readinessTimeout | number | Timeout (sec) |
Security Context
| Field | Type | Required | Notes |
|---|---|---|---|
runAsUser | number | Run As User ID | |
runAsGroup | number | Run As Group ID | |
fsGroup | number | FS Group | |
runAsNonRoot | boolean | Run As Non-Root | |
readOnlyRootFilesystem | boolean | Read-Only Root FS | |
allowPrivilegeEscalation | boolean | Allow Privilege Escalation | |
privileged | boolean | Privileged |
Pod Security
| Field | Type | Required | Notes |
|---|---|---|---|
securityPolicy | text | Pod Security Policy | |
seLinuxOptions | text (multi-line) | JSON format | |
capabilities | text (multi-line) | Add/Drop capabilities | |
hostNetwork | boolean | Host Network | |
hostPID | boolean | Host PID | |
hostIPC | boolean | Host IPC |
Metrics & Performance
| Field | Type | Required | Notes |
|---|---|---|---|
cpuUsage | gauge | CPU Usage % Read only. | |
memoryUsage | gauge | Memory Usage % Read only. | |
networkIn | number | Network In (MB/s) Read only. | |
networkOut | number | Network Out (MB/s) Read only. | |
restartCount | number | Restart Count Read only. | |
lastRestartTime | datetime | Last Restart Read only. | |
crashCount | number | Crash Count Read only. | |
uptime | number | Uptime (hours) Read only. |
Recent Events
| Field | Type | Required | Notes |
|---|---|---|---|
events | text (multi-line) | Last 50 Kubernetes events Read only. | |
lastEventTime | datetime | Last Event Time Read only. | |
warningCount | number | Warning Events Read only. |
Relationships
- Lookups:
namespacepoints at aK8SNAMESPACErecord.
Creating a K8s Workload via the API
POST /v1/objects
Authorization: Bearer <your-pat>
Content-Type: application/json
{
"entity": "K8SWORKLOAD",
"level": 402,
"comboKey": "SUB:<your-sub-id>|ENT:",
"name": "Example",
"namespace": "",
"workloadType": "1",
"status": "1"
}
Listing K8s Workloads records
# All k8s workloads in your tenant
GET /v1/entities/K8SWORKLOAD/SUB