Go for Infrastructure Engineers›Part 3 · Cheat sheet & self-check

Part 3 — Go and Kubernetes · wrap-up

Cheat sheet & self-check

6 questions across 3 lessons. Each answer links back to the lesson it came from.

Pick an answer to see if you got it, and why.

  1. Q1. Why use informers instead of calling List every few seconds in a long-running tool?

    Show answer

    B. Polling with List from many tools is a classic cause of API server load; informers are how controllers stay efficient.

    From lesson 07 · client-go: talking to Kubernetes
  2. Q2. Why is a patch usually better than Get-modify-Update for changing a label?

    Show answer

    B. Update replaces the whole object and fails or clobbers on concurrent changes; a merge patch touches only the fields you send.

    From lesson 07 · client-go: talking to Kubernetes
  3. Q3. What must every reconcile function be?

    Show answer

    B. Reconcile runs on every relevant event and on resyncs. It compares desired with actual and only fixes the difference.

    From lesson 08 · A small controller with Kubebuilder
  4. Q4. What is a finalizer for?

    Show answer

    B. Objects in the cluster are cleaned up by owner references; finalizers are for anything else (cloud resources, DNS, external systems).

    From lesson 08 · A small controller with Kubebuilder
  5. Q5. How do you test code that calls an HTTP API without the real API?

    Show answer

    B. httptest gives a real HTTP server on localhost, so the client code is tested as it runs.

    From lesson 09 · Testing, linting and shipping
  6. Q6. Why build with CGO_ENABLED=0 for container images?

    Show answer

    B. A static binary needs nothing from the image, which keeps images tiny and the attack surface small.

    From lesson 09 · Testing, linting and shipping