liveBook · Manning

Authorization

As explained in Kubernetes in Action, Second Edition

A file permission is an access right specifying whether a user class may read, write, or execute a filesystem object.

File permissions specify whether the file owner, owning group, and other users can read, write, or execute a file. Secret and ConfigMap volume files default to 0644: the owner can read and write, while the group and others can only read. section 9.5.4

Set a volume’s defaultMode to change permissions; for example, 0740 grants the owner full access and the group read access. In YAML, include the leading zero for octal notation; JSON uses decimal. Files are symbolic links, so use ls -lL to inspect the target file’s permissions. section 9.5.4

Restricting permissions can prevent a container process from accessing mounted files if group ownership is not set appropriately. section 9.5.4

  volumes:
  - name: cert-and-key
    secret:
      secretName: kiada-tls
      items:
      - key: tls.key
        path: example-com.key
        mode: 0640             #1

This volume manifest shows a per-file mode for a Secret key. section 9.5.4

How Kubernetes in Action, Second Edition covers it

How deep it goes
Defines permission categories and default modes, then covers configuration, decimal and octal notation, symbolic links, and group ownership.
Examples
Uses default mode 0644, configured mode 0740, and a Secret key mode of 0640.
What it assumes
Introduces owner, group, and other-user permission categories without requiring prior Unix-permissions knowledge.
What you can do after
Configure mounted-file permissions with defaultMode and inspect target-file permissions with ls -lL.
How it connects
Connects Unix file permissions with Kubernetes Secret and ConfigMap volumes, symbolic links, and pod group ownership.

Also explained in

Compare how 28 books explain authorization →

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.