Skip to content

M2-S2 — First install and the smoke test

Section titled “M2-S2 — First install and the smoke test”
ModuleM2 — Install, upgrade and roll back
After this session you canInstall the release, follow its hooks, read the migration’s result, and prove with a smoke test that the platform works, not only that its pods are running.
TimeFacilitated: 58 min · On your own: 58 min
Before you startM2-S1: the three values files render cleanly. The lab cluster is running.
Go deeperDeployment: rollout order · Helm chart: provisioning (migration) job

◆ Orientation (1 min) — Running is not working

Section titled “◆ Orientation (1 min) — Running is not working”

Every pod can be Running while nobody can sign in. A database may be empty, the gateway may know no address, the bus may have queues with no one listening. So an install is not finished when Helm says deployed. It is finished when a smoke test has walked the whole path a user takes, and found it working.

▤ Concept (4 min) — What happens during an install

Section titled “▤ Concept (4 min) — What happens during an install”

The chart uses Helm hooks: objects created at a fixed moment around the main install, ordered by their weight (lower first).

flowchart LR
  A["pre-install -10<br/>image pull Secret"] --> B["pre-install -1<br/>shared-key Secret,<br/>bus set-up config"]
  B --> C["pre-install 0<br/>bus set-up Job:<br/>creates the virtual host"]
  C --> D["Main resources<br/>Deployments, Services,<br/>ConfigMaps, Ingress"]
  D --> E["post-install 2<br/>migration Job"]

What to notice: the migration runs last, after the workloads exist. It needs the services up and listening on the bus, because it sets up the first tenant partly by sending them messages.

The bus set-up Job calls RabbitMQ’s management address and creates the release’s virtual host (nw in your lab) with quorum queues. If it cannot reach RabbitMQ, the install stops there.

The migration Job, nw-osos-migration-<revision>, prepares the databases. On the first install it creates the tenant, the root space, the default domain and the super-administrator account you named in migration.config. The account gets no password: you set one through the platform’s own password-reset email, which is why the lab has Mailpit. A finished migration Job is kept for 24 hours (migration.ttlSecondsAfterFinished) so you can read its logs, then Kubernetes deletes it. If a migration fails, the Job fails and so does the install or upgrade: the release reports the error instead of hiding it.

The shared-key Secret (nw-osos-shared) and the image pull Secret carry Helm’s keep policy: helm uninstall leaves them in place, on purpose, so an accidental uninstall does not lose the key every service trusts. For a completely fresh reinstall you delete them yourself.

The combined pods start slowly. Their applications call each other while booting, with back-off, and a pod is ready only when every application in it is up. Their start-up probe allows up to 150 seconds before Kubernetes gives up on them. On a first install, image pulls add minutes more. Give Helm room: --wait --timeout 20m makes it wait for every workload to be ready before it runs the migration and reports success.

A smoke test checks each layer a user’s request depends on, bottom up:

LayerProof
WorkloadsEvery pod Running and ready; both Jobs Complete
MigrationThe Job’s log ends without an error
RedisThe domain and space lists exist under the release’s prefix (nw-:domains, nw-:spaces)
Message busEvery service queue in the nw virtual host has at least one consumer
MailThe password-reset email arrives
The productThe operator signs in and Administration opens

Write it down once and run it after every install and upgrade. You will add to it in M5.

⛏ Lab (47 min) — Install Northwind and prove it works

Section titled “⛏ Lab (47 min) — Install Northwind and prove it works”

Goal. The nw release installed in the northwind namespace, every layer of the smoke test passing, and you signed in as the operator.

Before you start. values set as in M2-S1: values="-f nw-values.yaml -f nw-secrets.yaml -f pack-values.yaml". Keep two terminals open.

Install

  1. Create the namespace: kubectl create namespace northwind.
  2. In terminal 2, watch the pods: kubectl -n northwind get pods -w.
  3. In terminal 1, install: helm install nw ./osos -n northwind $values --wait --timeout 20m. Watch terminal 2: first the bus set-up Job, then the workloads, last the migration Job.
  4. When Helm returns, read its status: helm status nw -n northwind. It says STATUS: deployed and REVISION: 1, followed by the chart’s notes with the address.

Smoke test: the layers

  1. Workloads: kubectl -n northwind get pods,jobs. Every pod 1/1 (or n/n) ready; the Jobs Complete.
  2. Migration: kubectl -n northwind logs job/nw-osos-migration-1 | tail -20. No line with error or Cannot migrate.
  3. Redis: kubectl -n datastores exec deploy/redis -- redis-cli -a lab-only-redis -n 1 --scan --pattern 'nw-*'. You see nw-:domains and nw-:spaces among the keys.
  4. Bus: kubectl -n datastores exec deploy/rabbitmq -- rabbitmqctl list_queues -p nw name consumers messages. Every …-service-queue has 1 or more consumers; every …dead-letter queue has 0 messages.

Smoke test: the product

  1. Open http://localhost in a private browser window. The Sign in page appears, with Username/ Email, Password and Forgot password?.

    Screenshot pending The Sign in page of the lab release, with the Username/ Email and Password fields and the Forgot password? link What to notice: this page comes from the identity server, served under localhost because identity.ingress.enabled is off. If you see an error page with a Retry button instead, go to the troubleshooting table.

  2. Select Forgot password?, enter operator@northwind.example.com in Email and select Reset Password. The page says Check your email for a link to reset your password.

  3. In terminal 2, stop the watch and run kubectl -n datastores port-forward svc/mailpit 8025:8025. Open http://localhost:8025: the reset email is there.

    Screenshot pending Mailpit's inbox holding one password-reset email addressed to operator@northwind.example.com What to notice: the email travelled the whole delivery path you configured: identity, the bus, the notification worker, the email sender, then Mailpit’s SMTP port.

  4. Open the link in the email, enter a new password in Password and Confirm Password, and select Reset Password. Save the password in your password manager.

  5. Back on http://localhost, sign in as nwoperator with that password. On the welcome page, select START USING followed by the organization’s name.

  6. Open Administration. Its landing page loads. Then check the gateway’s logs for license errors: kubectl -n northwind logs -l app=osos-apigateway --tail=500 | grep -i license prints nothing.

    Screenshot pending The Administration landing page of the lab release, opened by the operator account What to notice: this one screen proves the browser, ingress, gateway, Redis lookups, identity, the data pod and MongoDB all work together.

  7. Write the smoke test, with the commands from steps 5 to 14, into inventory.md under a heading Smoke test. You will run it again after every change.

Check.

  • helm status shows deployed, revision 1.
  • Every pod ready; both Jobs Complete.
  • The migration log ends without an error.
  • nw-:domains and nw-:spaces exist in Redis.
  • Every service queue in nw has a consumer, and no dead-letter queue holds messages.
  • The reset email arrived in Mailpit.
  • You signed in as nwoperator and Administration opened.
  • Your smoke test is written down.

Pass condition. All eight checks hold on your own cluster.

If something goes wrong

What you seeWhat to do
Pods stay ImagePullBackOffThe registry address or pull credentials are wrong. kubectl -n northwind describe pod <name> shows the image and the error. Fix image.repository or imageCredentials, then helm upgrade with the same files.
The install stops on the bus set-up Jobkubectl -n northwind logs job/<the vhost job> shows the management call’s answer. Check managementUrl and credentials, then run helm upgrade with the same files: the Job runs again on upgrade.
A combined pod restarts during start-up, Running then 0/1Give it the full 150 seconds. If it keeps restarting, read kubectl -n northwind logs <pod> --previous for the application that did not come up.
Pods Running but never ready, logs show MongoDB or Redis connection errorsAn address or password in the values does not match the datastore. Compare with M0-S2’s Service names.
Helm times out before the migration ranThe cluster is short of memory or CPU (M0-S2 sizing). kubectl describe pod on a Pending pod says which. Then helm upgrade with the same files resumes.
The migration Job failedkubectl -n northwind logs job/nw-osos-migration-1 names the failing step. Fix the cause and upgrade; M2-S3 covers recovery.
localhost shows an error page with a Retry buttonThe license was refused: values missing or not for this environment. Check pack-values.yaml and the Secret against your pack, upgrade, and use the job aid’s refused table.
localhost answers 404 SPACE_ERROR or DOMAIN_ERROR for API callsThe migration’s tenant set-up did not reach Redis. Check step 7; M3-S2 explains this answer.
The sign-in or reset page never finishes its challengeHuman verification on the sign-in pages cannot run. Check nw-osos-altcha is ready; M4-S1 explains this check and how to recover.
No email in MailpitCheck the email sender pod is ready and its logs; check email.deployment.config.smtp points at mailpit.datastores.svc.cluster.local port 1025.
helm install says the release already existsA previous attempt left it. Use helm upgrade nw ./osos -n northwind $values --wait --timeout 20m instead.
Model answer

A passing run, in outline:

  • helm status nw -n northwind: STATUS: deployed, REVISION: 1.
  • kubectl get pods: nw-osos-core-rest, nw-osos-core-data, web, identity, apigateway, storage, notification, indexing, websocket, scheduler, translation, altcha and email pods ready; the bus set-up Job and nw-osos-migration-1 Complete.
  • Redis: nw-:domains and nw-:spaces present (alongside other nw- keys).
  • rabbitmqctl list_queues -p nw: queues such as data-service-queue, workflow-service-queue, notification-service-queue, each with consumers 1, and their dead-letter queues with messages 0.
  • Mailpit holds one reset email; after setting the password, nwoperator reaches Administration.

Your written smoke test is the same list as the Check above, with the command or screen for each.

✓ Practice (5 min) — Check your understanding

Section titled “✓ Practice (5 min) — Check your understanding”
PracticePut the items in the right order.

Put these install steps in the order Helm runs them.

  1. Explanation for A

    Belongs in position 4 of 5

    Fourth, as the main install, once every pre-install hook has succeeded. See Helm’s hooks, in order.

  2. Explanation for B

    Belongs in position 5 of 5

    Last, as a post-install hook, because it needs the services running and listening on the bus. See Helm’s hooks, in order.

  3. Explanation for C

    Belongs in position 2 of 5

    Second, at weight -1, so the key every service trusts exists before any service starts. See Helm’s hooks, in order.

  4. Explanation for D

    Belongs in position 3 of 5

    Third, at weight 0, because the services need their virtual host on RabbitMQ to connect. See Helm’s hooks, in order.

  5. Explanation for E

    Belongs in position 1 of 5

    First, at weight -10, because nothing else can start without pulling its image. See Helm’s hooks, in order.

Check your answer

The correct order is E → C → D → A → B. Open the explanation under each item to see why it sits where it does.

PracticeChoose one answer.

Every pod of a new release is Running, but rabbitmqctl list_queues -p nw shows workflow-service-queue with 0 consumers and messages piling up. What does the smoke test tell you?

  1. Explanation for A

    ✗ Incorrect

    Not this one: with every pod ready, each service queue should have a consumer. See The smoke test.

  2. Explanation for B

    ✓ Correct

    Correct: “running” is not “working”. A queue without a consumer is the bus layer failing the smoke test. See The smoke test.

  3. Explanation for C

    ✗ Incorrect

    Not this one: list_queues answered, so the broker is up; a consumer is missing. See The smoke test.

Check your answer

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

PracticeChoose one answer.

You uninstall a lab release and reinstall it with a newly generated shared key. Services reject the gateway’s calls. What did you forget?

  1. Explanation for A

    ✓ Correct

    Correct: it carries the keep policy on purpose, so a fresh start means deleting it yourself. See Two objects outlive the release.

  2. Explanation for B

    ✗ Incorrect

    Not this one: the gateway took the new key from its configuration; the services did not. See Two objects outlive the release.

  3. Explanation for C

    ✗ Incorrect

    Not this one: the migration does not set the shared key. See Two objects outlive the release.

Check your answer

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

PracticeChoose one answer.

A colleague reports “the platform is up: helm status says deployed”. Which single check would prove the most layers at once?

  1. Explanation for A

    ✗ Incorrect

    Not this one: it proves the workloads only, not the data, routing or sign-in. See The smoke test.

  2. Explanation for B

    ✗ Incorrect

    Not this one: the portal’s page is served by web alone, without the gateway, Redis or the databases. See The smoke test.

  3. Explanation for C

    ✓ Correct

    Correct: it needs the ingress, identity, the gateway, Redis, the data pod and MongoDB at once. See The smoke test.

Check your answer

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

↺ Recap (1 min) — An installed, proven release

Section titled “↺ Recap (1 min) — An installed, proven release”

You installed the release, followed its hooks, read the migration’s result, and proved with a smoke test that a person can sign in and administer the platform. Your smoke test is written down.

Next. In M2-S3 you change the release: an upgrade with a new value, a failed upgrade, and a rollback, and you learn the one thing a Helm rollback never rolls back.