Skip to main content

Configuring Workload Entries

1. Understanding Workload Entry Purpose

Aspect Description Notes
Workload Entry Represents a workload that is not managed by Kubernetes Used for integrating non-K8s workloads into the service mesh
Use Case Allows non-native workloads to participate in service mesh features Enables observability, security, and traffic management for VMs or bare metal services
Integration Connects external services to the mesh via Istio's control plane Supports both static and dynamic registration methods
Note: Workload Entries are essential for hybrid environments where some services run outside Kubernetes but still need to interact with the mesh.

2. Creating Workload Entry Resources

Resource Type YAML Example Description
WorkloadEntry
{
  "apiVersion": "v1",
  "kind": "WorkloadEntry",
  "metadata": {
    "name": "vm-workload"
  },
  "spec": {
    "address": "192.168.1.100",
    "ports": {
      "http": 8080
    }
  }
}
Defines a workload entry in the service mesh

Example: Creating a WorkloadEntry

apiVersion: networking.istio.io/v1beta1
kind: WorkloadEntry
metadata:
  name: vm-workload
spec:
  address: 192.168.1.100
  ports:
    http: 8080

3. Configuring Workload Address and Ports

Field Value Description
address 192.168.1.100 IP address of the workload
ports {"http": 8080} Port mapping for service traffic
port name http Name used for port identification in the mesh

Example: Setting Address and Ports

apiVersion: networking.istio.io/v1beta1
kind: WorkloadEntry
metadata:
  name: vm-workload
spec:
  address: 192.168.1.100
  ports:
    http: 8080
    https: 8443

4. Setting Workload Labels and Annotations

Field Value Description
labels {"app": "web-app", "version": "v1"} Used for service selection and routing
annotations {"istio.io/region": "us-west"} Metadata for observability and configuration

Example: Adding Labels and Annotations

apiVersion: networking.istio.io/v1beta1
kind: WorkloadEntry
metadata:
  name: vm-workload
  labels:
    app: web-app
    version: v1
  annotations:
    istio.io/region: us-west
spec:
  address: 192.168.1.100
  ports:
    http: 8080

5. Implementing VM Workload Registration

Method Description Notes
Static Registration Manually define WorkloadEntry resource Best for stable, long-lived VMs
Auto Registration Use Istio agent to register VMs dynamically Requires istioctl x workload group create

Workflow: VM Registration Steps

  1. Create a WorkloadGroup resource
  2. Generate registration manifest using istioctl x workload group create
  3. Apply the generated manifest to the VM
  4. Verify registration in Istio control plane

6. Configuring Workload Service Account

Field Value Description
serviceAccount default Name of the Kubernetes service account used by the workload
namespace default Kubernetes namespace where the service account exists

Example: Setting Service Account

apiVersion: networking.istio.io/v1beta1
kind: WorkloadEntry
metadata:
  name: vm-workload
spec:
  address: 192.168.1.100
  serviceAccount: default
  namespace: default

7. Managing Workload Health Status

Field Value Description
status Healthy Indicates whether the workload is operational
conditions [{"type": "Ready", "status": "True"}] Health check conditions reported by the workload
Note: Health status is managed by the Istio agent on the VM or external workload.

8. Implementing Workload Auto-Registration

Feature Description Notes
WorkloadGroup Template for auto-registration of workloads Used with istioctl x workload group create
Registration Automatically creates WorkloadEntry when VM joins mesh Requires istioctl x register command on VM

Example: Auto Registration Setup

istioctl x workload group create --name vm-group --namespace default --labels app=web-app

9. Configuring Workload Network Settings

Setting Value Description
network default Network name for the workload in the mesh
addressType IPV4 IP address type used for workload communication

Example: Network Configuration

apiVersion: networking.istio.io/v1beta1
kind: WorkloadEntry
metadata:
  name: vm-workload
spec:
  address: 192.168.1.100
  network: default
  addressType: IPV4

10. Managing Workload Entry Lifecycle

State Description Action
Registered Workload is registered in the mesh Can receive traffic and participate in services
Unregistered Workload is removed from the mesh No longer receives traffic or participates in services
Healthy Workload is operational and responding to health checks Active in service routing

Workflow: Lifecycle Management

  1. Create WorkloadEntry resource
  2. Verify registration in Istio control plane
  3. Monitor health status via Istio dashboard or CLI
  4. Delete WorkloadEntry to unregister the workload

11. Troubleshooting Workload Entry Issues

Issue Symptom Solution
Registration Failure Workload does not appear in Istio dashboard Check network connectivity and permissions
Health Check Failure Workload marked as unhealthy in mesh Verify workload agent is running and reporting status correctly
Traffic Not Routing Service calls to workload fail or timeout Ensure labels match service selectors and port configurations are correct

Common Troubleshooting Steps

  • Verify workload address and port configurations
  • Confirm labels match service selectors
  • Check for network connectivity between workload and Istio control plane
  • Review logs from Istio agent on the VM or external workload

12. Integrating Non-Kubernetes Workloads

Workload Type Integration Method Notes
VMs Use WorkloadEntry or auto-registration via istioctl x register Requires Istio agent installed on VM
Bare Metal Services Manually define WorkloadEntry resources Supports static IP addresses and custom port mappings
Legacy Applications Use WorkloadEntry with appropriate labels and annotations Enables legacy apps to participate in service mesh features

Comparison: VM vs Bare Metal Integration

  • VMs: Use auto-registration or static WorkloadEntry
  • Bare Metal: Requires manual WorkloadEntry creation and configuration

Was this article helpful?