liveBook · Manning

UTS namespace

As explained in Kubernetes in Action, Second Edition

A UTS namespace is a Linux namespace that isolates the system hostname and NIS domain name visible to processes.

A UTS namespace isolates the system hostname and Network Information Service (NIS) domain name visible to processes. It is one of several Linux namespace types: a process also belongs to namespaces for other resources, such as networking and process IDs. section 2.3.1

Two containers in one pod

Put two containers in the same Kubernetes pod. Because they share a UTS namespace, both see the same system hostname. They also share a network namespace, but that is a separate kind of sharing: it gives them the same network interfaces, IP address, and port space. A pod can share a PID namespace too, but only when that is explicitly enabled. section 3.3.1 section 5.1.1

Figure 2.17 Each process is associated with multiple namespace types, some of which can be shared.
figure

The figure shows why sharing a hostname does not mean that processes share every resource: each process is associated with multiple namespace types, and some can be shared. section 2.3.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Defines the isolated hostname and NIS domain name and explains pod-level sharing, but gives no UTS setup procedure.
Examples
Illustrates containers in one pod seeing the same hostname and contrasts that sharing with network and optional PID sharing.
What it assumes
Introduces namespaces as resource-specific process environments and defines pods as groups of co-located containers.
What you can do after
Evaluate/understand why containers in one pod see the same hostname without assuming they share every namespace.
How it connects
Connects UTS namespaces to Linux namespaces, containers, pods, network namespaces, IPC namespaces, and PID namespaces.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.