Skip to content

Latest commit

 

History

History
73 lines (47 loc) · 2.87 KB

README.md

File metadata and controls

73 lines (47 loc) · 2.87 KB

kubernetes-resources

Resources to learn Kubernetes

Learn

Not yet read / tested

Environment

Easy to install/use distributions

  • k3s: single binary kubernetes with containerd and kubectl included. Supports multi-node clusters.
    ❤️ swi's favourite ❤️
  • microk8s: all-in-one install, requires snapd. Supports multi-node clusters.

In the cloud

No lab setup at home?

  • GKE: You start with $300 worth of credits for free🎉

Tips and Tricks

Use kubectl explain

Kubectl has a built in help for every possible field in your manifest similar to man.

$ kubectl explain cronjob.spec.jobTemplate.spec
KIND:     CronJob
VERSION:  batch/v1beta1

RESOURCE: spec <Object>

DESCRIPTION:
     Specification of the desired behavior of the job. More info:
[...]

FIELDS:
   activeDeadlineSeconds	<integer>
     Specifies the duration in seconds relative to the startTime that the job
[...]

Common Misconceptions

Persistent Volume (Claim) Access Modes

The access modes (ReadWriteOnce, ReadOnlyMany, and ReadWriteMany) are about the nodes, not the pods. A ReadWriteOnce volume can still be read-write mounted by many pods, but only by pods on the same node.

FAQ

Why Does My Containerized (Perl) App Not Handle Signals Correctly?

OR: If starting my (Perl) app in a container CTRL-C does no longer work.

Docker creates a new PID namespace for each container. The first process in the container has the process id 1.

Note: A process running as PID 1 inside a container is treated specially by Linux: it ignores any signal with the default action. So, the process will not terminate on SIGINT or SIGTERM unless it is coded to do so.

A good cross-platform solution is running a tiny init system in front of the app. See Solve Signal Handling in Perl Containers with tini.