Skip to content
ModuleM0 — Start here
After this session you canStand up and verify the local evaluation cluster every later lab uses: Kubernetes, ingress, MongoDB, RabbitMQ, Redis and a mail catcher, with the chart pulled and ready.
TimeFacilitated: 54 min · On your own: 54 min
Before you startM0-S1. Docker, kind, kubectl and helm installed. Your vendor’s evaluation pack.
Go deeperHelm chart: external prerequisites

◆ Orientation (1 min) — Why you bring your own datastores

Section titled “◆ Orientation (1 min) — Why you bring your own datastores”

The Osos chart installs only Osos‘s own services. It never installs a database, a message broker or a cache: in production those are run by a database team or a managed cloud service, and the chart only receives their addresses. So before you can install anything, you need a cluster and the three datastores. In this session you build both, on your own computer.

▤ Concept (4 min) — The lab you are building

Section titled “▤ Concept (4 min) — The lab you are building”
DependencyWhat Osos uses it forIn productionIn your lab
KubernetesRuns every workload the chart rendersA managed or self-run clusterkind: a whole cluster inside one Docker container
Ingress controllerReceives web traffic and routes it to the platformnginx by default (the chart creates the Ingress, not the controller)ingress-nginx, listening on your ports 80 and 443
MongoDBEvery record, definition and settingA replica set, with authentication and TLSOne-member replica set, no authentication
RabbitMQThe message bus between servicesA cluster with quorum queuesOne node with the management API on
RedisCaches, the gateway’s lookups, background job queuesSentinel or a managed service, with TLSOne instance with a lab password
Mail serverPassword-reset and notification emailsYour organization’s SMTP relayMailpit: catches every email and shows it in a web page
Object storageUploaded filesAzure, S3-compatible or Google storageA disk volume (set in M2-S1)

The lab cuts corners that production never may: single copies, no TLS, no authentication on MongoDB, and passwords such as lab-only-redis that are deliberately obvious. Every lab secret in this course starts with lab-only so you can never mistake it for a real one.

flowchart LR
  B["Your browser"] -->|"localhost:80"| I["ingress-nginx"]
  subgraph K["kind cluster nw-lab"]
    I --> P["Osos release nw<br/>namespace northwind (M2)"]
    subgraph D["namespace datastores"]
      M[("MongoDB rs0")]
      R[("RabbitMQ")]
      C[("Redis")]
      E["Mailpit"]
    end
    P --> M
    P --> R
    P --> C
    P -->|"SMTP"| E
  end

What to notice: the platform and its datastores live in separate namespaces. The platform only knows the datastores’ addresses, exactly as it would with a managed database in production.

The whole platform runs about fifteen pods. Give Docker at least 6 CPU cores and 16 GB of memory and keep 30 GB of disk free; with less, pods stay Pending or are killed for memory during the first install.

The steps use kind. If you prefer k3d, create the cluster with k3d cluster create nw-lab -p "80:80@loadbalancer" -p "443:443@loadbalancer" --k3s-arg "--disable=traefik@server:0" and install ingress-nginx from its Helm chart; every later step is the same.

⛏ Lab (43 min) — Build and verify the lab

Section titled “⛏ Lab (43 min) — Build and verify the lab”

Goal. A running nw-lab cluster with ingress, the three datastores and Mailpit, each proven to answer, and the chart pulled from your vendor’s registry.

Before you start. Make a working folder, for example ~/acde-lab, and run every command from it. Check your tools: docker version, kind version, kubectl version --client, helm version.

Create the cluster

  1. Save this as kind-nw-lab.yaml. It labels the node for the ingress controller and maps your ports 80 and 443 into the cluster.

    kind: Cluster
    apiVersion: kind.x-k8s.io/v1alpha4
    name: nw-lab
    nodes:
    - role: control-plane
    kubeadmConfigPatches:
    - |
    kind: InitConfiguration
    nodeRegistration:
    kubeletExtraArgs:
    node-labels: "ingress-ready=true"
    extraPortMappings:
    - { containerPort: 80, hostPort: 80, protocol: TCP }
    - { containerPort: 443, hostPort: 443, protocol: TCP }
  2. Create the cluster: kind create cluster --config kind-nw-lab.yaml. It takes about a minute and switches your kubectl context to kind-nw-lab.

  3. Install the ingress controller built for kind, and wait for it:

    Terminal window
    kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
    kubectl wait -n ingress-nginx --for=condition=ready pod \
    -l app.kubernetes.io/component=controller --timeout=180s

Run the datastores

  1. Save this as datastores.yaml. Read it before you apply it: it is the whole lab back end.

    # LAB ONLY: single copies, no TLS, throwaway passwords. Never use in production.
    apiVersion: v1
    kind: Namespace
    metadata: { name: datastores }
    ---
    apiVersion: v1
    kind: Service
    metadata: { name: mongo, namespace: datastores }
    spec:
    clusterIP: None
    selector: { app: mongo }
    ports: [{ name: mongo, port: 27017 }]
    ---
    apiVersion: apps/v1
    kind: StatefulSet
    metadata: { name: mongo, namespace: datastores }
    spec:
    serviceName: mongo
    replicas: 1
    selector: { matchLabels: { app: mongo } }
    template:
    metadata: { labels: { app: mongo } }
    spec:
    containers:
    - name: mongo
    image: mongo:7.0
    args: ["--replSet", "rs0", "--bind_ip_all"]
    ports: [{ containerPort: 27017 }]
    volumeMounts: [{ name: data, mountPath: /data/db }]
    volumeClaimTemplates:
    - metadata: { name: data }
    spec:
    accessModes: ["ReadWriteOnce"]
    resources: { requests: { storage: 5Gi } }
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata: { name: rabbitmq, namespace: datastores }
    spec:
    selector: { matchLabels: { app: rabbitmq } }
    template:
    metadata: { labels: { app: rabbitmq } }
    spec:
    containers:
    - name: rabbitmq
    image: rabbitmq:3.13-management
    env:
    - { name: RABBITMQ_DEFAULT_USER, value: lab }
    - { name: RABBITMQ_DEFAULT_PASS, value: lab-only-rabbit }
    ports: [{ containerPort: 5672 }, { containerPort: 15672 }]
    ---
    apiVersion: v1
    kind: Service
    metadata: { name: rabbitmq, namespace: datastores }
    spec:
    selector: { app: rabbitmq }
    ports: [{ name: amqp, port: 5672 }, { name: management, port: 15672 }]
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata: { name: redis, namespace: datastores }
    spec:
    selector: { matchLabels: { app: redis } }
    template:
    metadata: { labels: { app: redis } }
    spec:
    containers:
    - name: redis
    image: redis:7.2
    args: ["--requirepass", "lab-only-redis"]
    ports: [{ containerPort: 6379 }]
    ---
    apiVersion: v1
    kind: Service
    metadata: { name: redis, namespace: datastores }
    spec:
    selector: { app: redis }
    ports: [{ name: redis, port: 6379 }]
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata: { name: mailpit, namespace: datastores }
    spec:
    selector: { matchLabels: { app: mailpit } }
    template:
    metadata: { labels: { app: mailpit } }
    spec:
    containers:
    - name: mailpit
    image: axllent/mailpit:v1.20
    ports: [{ containerPort: 1025 }, { containerPort: 8025 }]
    ---
    apiVersion: v1
    kind: Service
    metadata: { name: mailpit, namespace: datastores }
    spec:
    selector: { app: mailpit }
    ports: [{ name: smtp, port: 1025 }, { name: web, port: 8025 }]
  2. Apply it and wait until every pod is ready: kubectl apply -f datastores.yaml then kubectl -n datastores wait --for=condition=ready pod --all --timeout=300s.

  3. Turn MongoDB into a one-member replica set. Osos expects a replica set, and this is the smallest one there is:

    Terminal window
    kubectl -n datastores exec mongo-0 -- mongosh --quiet --eval \
    'rs.initiate({_id:"rs0",members:[{_id:0,host:"mongo-0.mongo.datastores.svc.cluster.local:27017"}]})'

Prove each one answers

  1. MongoDB: kubectl -n datastores exec mongo-0 -- mongosh --quiet --eval 'rs.status().ok' prints 1.
  2. Redis: kubectl -n datastores exec deploy/redis -- redis-cli -a lab-only-redis ping prints PONG (ignore the warning about a password on the command line: lab only).
  3. RabbitMQ: kubectl -n datastores exec deploy/rabbitmq -- rabbitmq-diagnostics -q ping prints Ping succeeded.
  4. Mailpit: run kubectl -n datastores port-forward svc/mailpit 8025:8025, open http://localhost:8025 in your browser, and see an empty inbox. Stop the port-forward with Ctrl+C.
  5. Ingress: curl -s -o /dev/null -w "%{http_code}\n" http://localhost/ prints 404. That is good: the controller answers, and nothing is routed yet.

Pull the chart

  1. Log in to your vendor’s registry. Type the token at the prompt rather than on the command line, so it stays out of your shell history: helm registry login <registry from your vendor> --username <user from your vendor>.
  2. Pull and unpack the chart: helm pull oci://<chart reference from your vendor> --version <chart version> --untar. A folder osos/ appears, holding Chart.yaml, values.yaml and templates/.
  3. Read the version: grep -E "^(version|appVersion)" osos/Chart.yaml. Write both numbers down; the course was written against chart 1.11.0 and app version 1.10.0.

Check.

  • kubectl config current-context prints kind-nw-lab.
  • The ingress controller pod is Running and curl http://localhost/ returns 404.
  • mongo-0 answers rs.status().ok with 1.
  • Redis answers PONG and RabbitMQ answers Ping succeeded.
  • Mailpit’s inbox opens at http://localhost:8025 through the port-forward.
  • osos/Chart.yaml exists and you noted its version and appVersion.
  • No file in your working folder contains your registry token.

Pass condition. All seven checks hold. The lab cluster is the starting state for M1.

If something goes wrong

What you seeWhat to do
kind create cluster fails on port 80 or 443Another program (a local web server, another cluster) holds the port. Stop it, or change hostPort to 8080 and 8443 and use localhost:8080 everywhere after.
Datastore pods stay PendingDocker has too little memory or CPU. Raise the limits in Docker’s settings, then kind delete cluster --name nw-lab and start again.
rs.initiate says “already initialized”You ran it twice. Nothing to do: check rs.status().ok.
rs.status().ok prints an error about no replica set configStep 6 did not run, or ran before the pod was ready. Run it again.
helm registry login answers 401 or unauthorizedThe user or token is wrong or expired. Check them against the pack; ask your vendor if they still fail.
helm pull answers not foundThe chart reference or version is mistyped. Copy both from the pack exactly.
curl http://localhost/ hangs instead of returning 404The ingress controller is not ready yet, or port 80 is not mapped. Re-run the wait in step 3 and check docker ps shows 0.0.0.0:80->80.
Model answer

A correct lab, seen from kubectl get pods -A (names shortened):

NamespacePodStatus
ingress-nginxingress-nginx-controller-…Running
datastoresmongo-0Running
datastoresrabbitmq-…Running
datastoresredis-…Running
datastoresmailpit-…Running

The two ingress admission jobs show Completed, which is normal. The addresses you will give the chart in M2-S1 are the in-cluster Service names: mongo-0.mongo.datastores.svc.cluster.local:27017 for MongoDB, rabbitmq.datastores.svc.cluster.local (ports 5672 and 15672), redis.datastores.svc.cluster.local:6379 and mailpit.datastores.svc.cluster.local:1025. To start again from nothing at any time: kind delete cluster --name nw-lab, then repeat from step 2.

✓ Practice (5 min) — Check your lab knowledge

Section titled “✓ Practice (5 min) — Check your lab knowledge”
PracticeChoose one answer.

Why does the lab run MongoDB, RabbitMQ and Redis in their own namespace instead of letting the chart install them?

  1. Explanation for A

    ✓ Correct

    Correct: the chart deploys only Osos‘s own services. Keeping the datastores separate copies the production shape. See What the chart expects around it.

  2. Explanation for B

    ✗ Incorrect

    Not this one: no environment gets datastores from the chart. See What the chart expects around it.

  3. Explanation for C

    ✗ Incorrect

    Not this one: they may share a cluster, as in the lab; what matters is that the chart does not own them. See What the chart expects around it.

Check your answer

The correct answer is A. Open the explanation under each option to see why.

PracticeChoose one answer.

Your teammate’s lab MongoDB runs as a plain single server, without --replSet. What should they change before installing the platform?

  1. Explanation for A

    ✗ Incorrect

    Not this one: the platform expects a replica set, and the lab copies that with a one-member set. See The lab you are building.

  2. Explanation for B

    ✓ Correct

    Correct: even one member makes it a replica set, which is what the platform expects. See Build and verify the lab.

  3. Explanation for C

    ✗ Incorrect

    Not this one: authentication matters in production, but it does not replace the replica set the platform expects. See The lab you are building.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

After step 11, curl http://localhost/ returns 404. What does that tell you?

  1. Explanation for A

    ✗ Incorrect

    Not this one: a broken controller would not answer at all. See Build and verify the lab.

  2. Explanation for B

    ✓ Correct

    Correct: 404 is the controller’s own answer for an unrouted request. The chart adds the routes in M2-S2. See Build and verify the lab.

  3. Explanation for C

    ✗ Incorrect

    Not this one: nothing is installed yet; that answer belongs to the gateway, which you meet in M3. See Build and verify the lab.

Check your answer

The correct answer is B. Open the explanation under each option to see why.

PracticeChoose one answer.

Why does step 12 have you type the registry token at a prompt?

  1. Explanation for A

    ✗ Incorrect

    Not this one: Helm accepts --password, but the token then lands in your shell history. See Build and verify the lab.

  2. Explanation for B

    ✗ Incorrect

    Not this one: the login only proves you may pull the chart and images; expiry is not the reason. See Your evaluation pack.

  3. Explanation for C

    ✓ Correct

    Correct: keep every credential from the pack out of files and history; the last check of the lab confirms it. See Build and verify the lab.

Check your answer

The correct answer is C. Open the explanation under each option to see why.

↺ Recap (1 min) — After Module 0 you can

Section titled “↺ Recap (1 min) — After Module 0 you can”

After this module you can say what is your job as the operator, confirm you have the skills the course assumes, and stand up and verify a local evaluation cluster with the three datastores, a mail catcher and the chart.

Next. In M1 you read the chart before you install it: what it will create, how the parts talk to each other, and what stops when one of them fails.