Skip to main content
Version: Next

Pod Annotations Reference

This document provides a comprehensive reference for all pod annotations available in interLink. These annotations allow you to customize pod behavior, configure networking, and control various aspects of pod execution.

Overview​

InterLink supports several categories of annotations:


VPN & Networking​

interlink.eu/pod-vpn​

Enables VPN connectivity for the pod, allowing it to access the cluster's internal network.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
interlink.eu/pod-vpn: "true"
spec:
containers:
- name: app
image: nginx:latest

Behavior:

  • When present, the pod will be assigned an IP from the virtual node's CIDR range
  • Enables connectivity to Kubernetes services and other pods
  • Requires proper VPN configuration on the interLink deployment
  • Takes precedence over wstunnel networking features

Default: Not set (VPN disabled)


interlink.eu/pod-ip​

Specifies or retrieves the assigned IP address for the pod.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
interlink.eu/pod-ip: "10.244.1.100"
spec:
containers:
- name: app
image: nginx:latest

Behavior:

  • Can be manually set to request a specific IP (subject to availability)
  • Automatically populated by interLink when VPN is enabled
  • Used internally for IP allocation and tracking
  • IP must be within the configured CIDR range

Default: Automatically assigned when VPN is enabled


Mesh Networking​

interlink.eu/mesh-network​

Disables mesh networking for a specific offloaded pod when set to "disabled".

Usage:

apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
interlink.eu/mesh-network: "disabled"
spec:
containers:
- name: app
image: nginx:latest

Behavior:

  • When set to "disabled", the pod is offloaded without mesh networking even if the global FullMesh configuration is enabled
  • Disables the WireGuard/wstunnel bidirectional communication setup for this pod
  • All other pods without this annotation continue to use mesh networking as configured
  • Value matching is case-insensitive (e.g., "Disabled", "DISABLED" also work)

Default: Not set (mesh networking follows global FullMesh configuration)


Wstunnel Integration​

interlink.virtual-kubelet.io/wstunnel-timeout​

Configures the timeout for wstunnel infrastructure creation and IP assignment.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
interlink.virtual-kubelet.io/wstunnel-timeout: "60s"
spec:
containers:
- name: web-server
image: nginx:latest
ports:
- containerPort: 80
name: http

Behavior:

  • Only effective when wstunnel feature is enabled (Network.EnableTunnel: true)
  • Applies to pods with exposed ports and no VPN annotation
  • Controls how long to wait for the wstunnel pod to get an IP address
  • If timeout is exceeded, pod creation fails and resources are cleaned up

Valid Values:

  • Duration strings: 30s, 1m, 2m30s, 10m
  • Must be parseable by Go's time.ParseDuration()

Default: 30s


interlink.eu/wstunnel-client-commands​

Contains the complete wstunnel client command to connect to exposed ports from a remote location.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
interlink.eu/wstunnel-client-commands: |
curl -L https://github.com/erebe/wstunnel/releases/latest/download/wstunnel-linux-x64 -o wstunnel && chmod +x wstunnel

./wstunnel client --http-upgrade-path-prefix a1b2c3d4 -R tcp://[::]:8080:localhost:8080 -R tcp://[::]:9090:localhost:9090 ws://my-pod-wstunnel.example.com:80
spec:
containers:
- name: web-server
image: nginx:latest
ports:
- containerPort: 8080
name: http
- containerPort: 9090
name: metrics

Behavior:

  • Automatically generated by interLink when wstunnel feature is enabled
  • Only added to pods with exposed ports and no VPN annotation
  • Contains the complete command with download instructions and client connection
  • Includes unique random password for secure tunnel authentication
  • Multiple ports are handled with multiple -R options in a single command
  • Uses the configured wildcard DNS or service name for ingress endpoint

Command Structure:

  1. Download: Downloads the latest wstunnel binary for Linux x64
  2. Connect: Establishes websocket tunnel with:
    • --http-upgrade-path-prefix: Unique password for authentication
    • -R tcp://[::]:PORT:localhost:PORT: Port forwarding rules (one per exposed port)
    • ws://ENDPOINT:80: Websocket endpoint (ingress URL)

Default: Set automatically by interLink when wstunnel is enabled


interlink.eu/wstunnel-extra-ports​

Specifies additional ports to forward through the wstunnel beyond those defined in the pod specification.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
interlink.eu/wstunnel-extra-ports: "8080,9090:metrics:UDP,3000:api"
spec:
containers:
- name: web-server
image: nginx:latest
ports:
- containerPort: 80
name: http

Format:

  • Simple port: 8080 - Forward port 8080 with TCP protocol
  • Named port: 9090:metrics - Forward port 9090 with name "metrics" and TCP protocol
  • Full specification: 3000:api:UDP - Forward port 3000 with name "api" and UDP protocol
  • Multiple ports: 8080,9090:metrics:UDP,3000:api - Comma-separated list

Behavior:

  • Only effective when wstunnel feature is enabled (Network.EnableTunnel: true)
  • Allows forwarding ports not explicitly defined in container specs
  • Useful for internal services, debug ports, or dynamic port allocation
  • Ports are added to the generated wstunnel client command
  • Invalid port specifications are silently ignored

Protocol Support:

  • TCP (default if not specified)
  • UDP
  • Case-insensitive protocol names

Default: Not set (no additional ports forwarded)


SSH Shadow​

Annotations for the SSH shadow (Network.ShadowMode: ssh). interlink.eu/wstunnel-extra-ports applies to it too.

interlink.eu/shadow-socket-ports​

Lists the exposed ports whose server listens on a unix socket instead of a TCP port.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: notebook
annotations:
interlink.eu/shadow-socket-ports: "8888"
spec:
containers:
- name: jupyter
image: docker://jupyter/scipy-notebook
command:
- sh
- -c
- >-
exec jupyter lab --no-browser
--ServerApp.sock=$INTERLINK_SOCKET_DIR/fwd-8888.sock
--ServerApp.allow_remote_access=True
ports:
- containerPort: 8888

Behavior:

  • The shadow forwards each listed port to $INTERLINK_SOCKET_DIR/fwd-<port>.sock on the compute node instead of 127.0.0.1:<port>; the workload creates that socket
  • INTERLINK_SOCKET_DIR is a directory private to the pod's job (mode 0700), set in every container by the plugin
  • Unlike a TCP port on 127.0.0.1, a socket in that directory is closed to other users of the compute node; see Where the workload listens
  • Requires Network.EnableTunnel: true, ShadowMode: ssh, SSH.ForwardTarget: node, and no interlink.eu/pod-vpn on the pod
  • Each entry must be an exposed TCP port of the pod: a containerPort or a port in interlink.eu/wstunnel-extra-ports
  • Pod creation is refused when the value is malformed, names a port that is not an exposed TCP port, or the requirements above are not met: the pod shows reason ProviderFailed with the error as its message (kubectl describe pod), and the virtual kubelet logs it too
  • The plugin must also report a socket directory (SocketDirRoot in the Slurm plugin). The virtual kubelet cannot check that when the pod is created: without it the shadow waits in its init container, logging waiting for the plugin to report a socket directory, until Network.SSH.NodeWaitTimeout and then fails
  • Jupyter needs --ServerApp.allow_remote_access=True, as in the example, to answer requests that come through the shadow's Service; its token stays on, see Pod configuration

Format: Comma-separated port numbers, e.g. "8888" or "8888,6006"

Default: Not set (every port is forwarded over TCP)


interlink.eu/shadow-same-ns​

Creates the pod's shadow in the pod's own namespace instead of a separate one.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: notebook
annotations:
interlink.eu/shadow-same-ns: "true"

Behavior:

  • Applies to every shadow, wstunnel or SSH
  • Without it, the shadow's resources are named <pod>-<namespace> in a namespace <namespace>-shadow; with it, shadow-<pod>-<namespace> in the pod's own namespace
  • Suits multi-tenant setups such as per-user notebook namespaces, where the shadow's Service belongs next to the pod
  • With the SSH shadow, the credential is copied into that namespace unless ReplicateCredentials is false; see Credential replication
  • Only the value "true" enables it
  • Pod creation fails when the namespace name is so long that the shadow's name and namespace together cannot fit in 63 characters; use a shorter namespace or drop the annotation

Default: Not set (shadow in <namespace>-shadow)


SSH Reverse Tunnel​

With the SSH shadow and Network.SSH.Reverse.Enabled: true, these annotations let an offloaded pod open connections to endpoints inside the cluster. How it works, what the site has to allow and the limits are in Pod to cluster: the reverse tunnel.

interlink.eu/reverse-forwards​

Lists the cluster endpoints the pod may connect to.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: trainer
annotations:
interlink.eu/reverse-forwards: "minio.user.svc.cluster.local:9000 6443:kubernetes.default.svc.cluster.local:443"
spec:
containers:
- name: trainer
image: docker://python:3.12

Format:

  • Endpoint: host:port - the job connects to the same port
  • Remapped: listen-port:host:port - the job connects to listen-port; needed when port is below 1024
  • Several: space-separated

Behavior:

  • The virtual kubelet adds the names to the container's /etc/hosts and waits for the tunnel before the workload starts
  • A Service FQDN also resolves as name.namespace.svc and name.namespace, and as name in the pod's own namespace
  • A bare name such as minio is a Service in the pod's own namespace: the job uses minio, and the shadow, which usually runs in another namespace, connects to minio.<namespace>
  • An entry that does not parse, or a listen port below 1024, is refused when the pod is created
  • Needs Network.SSH.Reverse.Enabled: true and no interlink.eu/pod-vpn on the pod; otherwise the pod is refused rather than run without its tunnel
  • Needs a plugin that gives the job a socket directory (SocketDirRoot in the Slurm plugin); otherwise the job fails at start

Default: Not set (no connections back into the cluster)


interlink.eu/reverse-socks-port​

Adds a SOCKS5 proxy for endpoints not listed in interlink.eu/reverse-forwards.

warning

The proxy listens on 127.0.0.1 of the compute node, where every user of that node can use it to reach any endpoint the shadow reaches in the cluster. The virtual kubelet refuses it unless Network.SSH.Reverse.AllowSocks is true. A site that agreed to fixed endpoints and no proxy has not agreed to this: ask before turning it on.

Usage:

metadata:
annotations:
interlink.eu/reverse-socks-port: "1080"

Behavior:

  • Any cluster address, resolved inside the cluster at connect time, for programs told to use the proxy (ALL_PROXY=socks5h://127.0.0.1:1080)
  • Pod creation is refused unless the virtual kubelet sets Network.SSH.Reverse.AllowSocks: true; when it does, the pod gets a ReverseSocksProxy warning event
  • A plain listener on 127.0.0.1, with no owner check: every user of the compute node can use it
  • Two pods on one compute node cannot use the same port; the job fails at start when another user already listens on it, and the shadow's tunnel fails when another pod of the same account does
  • The job also fails at start when the node's sshd sets GatewayPorts yes, which binds the proxy on every address of the node instead of 127.0.0.1
  • Must be above 1023 and not clash with a forward's listen port

Default: Not set (no proxy)


interlink.eu/reverse-bind​

The 127.x.y.z address of the owner-only relay: the forwards listen there, inside the job.

Behavior:

  • Derived from the pod UID when unset, which makes two pods on one node unlikely to share it, though not impossible: if they do and forward the same listen port, the second job fails at start, and setting this annotation on one of them resolves it
  • Must be in 127.0.0.0/8 and not 127.0.0.1
  • The job fails at start if something else already listens on that address and a forward's port

Default: Derived from the pod UID


Job Management​

JobID​

Tracks the remote job identifier for pods executed through interLink.

Usage:

apiVersion: v1
kind: Pod
metadata:
name: my-pod
annotations:
JobID: "slurm-12345"
spec:
containers:
- name: compute
image: ubuntu:latest
command: ["sleep", "3600"]

Behavior:

  • Automatically set by interLink when a pod is successfully submitted to a remote system
  • Used to correlate Kubernetes pods with remote jobs (e.g., SLURM, PBS, Docker)
  • Required for pod status tracking and lifecycle management
  • Used during cluster restart to reassign pods to the virtual kubelet

Default: Set automatically by interLink


System Annotations​

interlink.virtual-kubelet.io/ping-response​

Stores the response from interLink API health checks.

Usage: This annotation is set automatically by the virtual kubelet.

Behavior:

  • Updated during periodic health checks to the interLink API
  • Contains the response body from successful ping operations
  • Used for monitoring and debugging connectivity issues
  • Visible in node annotations, not pod annotations

Default: Set automatically by virtual kubelet


Configuration Examples​

Basic Pod with VPN​

apiVersion: v1
kind: Pod
metadata:
name: vpn-enabled-pod
annotations:
interlink.eu/pod-vpn: "true"
spec:
containers:
- name: app
image: nginx:latest
ports:
- containerPort: 80
restartPolicy: Never

Pod with Wstunnel (No VPN)​

apiVersion: v1
kind: Pod
metadata:
name: wstunnel-pod
annotations:
interlink.virtual-kubelet.io/wstunnel-timeout: "2m"
spec:
containers:
- name: web-server
image: nginx:latest
ports:
- containerPort: 80
name: http
- containerPort: 443
name: https
restartPolicy: Never

Pod with Custom IP​

apiVersion: v1
kind: Pod
metadata:
name: custom-ip-pod
annotations:
interlink.eu/pod-vpn: "true"
interlink.eu/pod-ip: "10.244.1.50"
spec:
containers:
- name: app
image: alpine:latest
command: ["sleep", "3600"]
restartPolicy: Never

Best Practices​

VPN Configuration​

  • Use VPN annotations when pods need to access Kubernetes services
  • Ensure CIDR ranges are properly configured in the virtual kubelet config
  • Monitor IP allocation to avoid conflicts

Wstunnel Usage​

  • Enable wstunnel only when needed for external port access
  • Use appropriate timeouts based on your infrastructure
  • Remember that wstunnel and VPN are mutually exclusive

Job Management​

  • Never manually set JobID annotations
  • Use JobID for debugging and monitoring remote job execution
  • Check JobID presence to verify successful job submission

Networking Considerations​

  • VPN takes precedence over wstunnel networking
  • Pods with exposed ports automatically trigger wstunnel creation (if enabled)
  • Use interlink.eu/pod-vpn for internal cluster communication
  • Use wstunnel for external port exposure without VPN overhead

Troubleshooting​

Common Issues​

  1. Pod IP not assigned

    • Check VPN configuration and CIDR settings
    • Verify interlink.eu/pod-vpn annotation syntax
    • Review virtual kubelet logs for IP allocation errors
  2. Wstunnel timeout errors

    • Increase timeout with interlink.virtual-kubelet.io/wstunnel-timeout
    • Check network connectivity and DNS resolution
    • Verify wstunnel template and configuration
  3. Job not tracked

    • Verify JobID annotation is set after pod creation
    • Check interLink API connectivity
    • Review plugin logs for job submission errors

Debug Commands​

# Check pod annotations
kubectl get pod <pod-name> -o yaml | grep -A 10 annotations

# Check virtual kubelet node annotations
kubectl get node <vk-node-name> -o yaml | grep -A 5 annotations

# Check wstunnel resources (if applicable)
kubectl get deployment,service,ingress -l interlink.virtual-kubelet.io/type=wstunnel

Version Compatibility​

AnnotationVersionNotes
interlink.eu/pod-vpnv0.1.0+Core VPN functionality
interlink.eu/pod-ipv0.1.0+IP allocation and tracking
JobIDv0.1.0+Remote job management
interlink.virtual-kubelet.io/wstunnel-timeoutv0.6.0+Wstunnel integration
interlink.virtual-kubelet.io/ping-responsev0.2.0+Health check responses
interlink.eu/mesh-networkv0.6.x+Per-pod mesh networking opt-out