Keyboard shortcuts

/ or ⌘/Ctrl K
Find a note
j / k
Next / previous section or linked note
h / l
Collapse or go to parent / expand or enter
e or Alt-click
Read a linked note here
o
Open focused note on its own
g g / G
First / last section or linked note
g h / g a
Home / all notes
g b / g t
Backlinks / table of contents
t
Cycle System, Light, Dark
? / Esc
Show / close this reference

Search: ↑/↓ or Ctrl N/P, Enter to open. Shortcuts pause while typing.

kubernetes (k8s) [a0a37a5e]

Tags: computers, distributed systems

1. Tracing

  • Need

    securityContext: capabilities: add:

    • SYS_PTRACE

    added to the pod to allow for strace and ptrace to work. Example:

      apiVersion: v1
      kind: Pod
      metadata:
        name: <POD_NAME>
        namespace: default
      spec:
        containers:
          image: <IMAGE>
          imagePullPolicy: IfNotPresent
          name: web
          command: ["/bin/sleep"]
          args: ["1000000"]
          securityContext:
            capabilities:
              add:
              - SYS_PTRACE
          ports:
          - containerPort: 80
            name: http
            protocol: TCP
          resources:
            limits:
              cpu: "40"
              memory: 100G
            requests:
              cpu: "38"
              memory: 100G
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
          - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
            name: kube-api-access-qtpks
            readOnly: true
    

2. Kubernetes get all logs for pods of a specific type

  kubectl get pods -o wide |  rg '<POD_NAME> ' | rg '0/1' --fixed-strings | rg '<POD_NAME>.{20}\s' -o | cut -d ' ' -f 1 | xargs -L 1 kubectl logs --tail 10

3. Kube 1.24 and 1.25 major changes

3.1. Things to worry about

  • volumesnapshot?

4. Cloud Native postgres

5. Kubeshark (API traffic analyzer for kube)

6. BSD Jails vs cgroups and namespaces

  • BSD jails, solaris zones, and linux cgroups + namespaces all do the same thing
  • Containers are built on top of cgroups and namespaces

7. Local Development