M2-S2 — First install and the smoke test
Section titled “M2-S2 — First install and the smoke test”| Module | M2 — Install, upgrade and roll back |
| After this session you can | Install 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. |
| Time | Facilitated: 58 min · On your own: 58 min |
| Before you start | M2-S1: the three values files render cleanly. The lab cluster is running. |
| Go deeper | Deployment: 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”Helm’s hooks, in order
Section titled “Helm’s hooks, in order”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.
Two objects outlive the release
Section titled “Two objects outlive the release”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.
Patience is part of the procedure
Section titled “Patience is part of the procedure”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.
The smoke test
Section titled “The smoke test”A smoke test checks each layer a user’s request depends on, bottom up:
| Layer | Proof |
|---|---|
| Workloads | Every pod Running and ready; both Jobs Complete |
| Migration | The Job’s log ends without an error |
| Redis | The domain and space lists exist under the release’s prefix (nw-:domains, nw-:spaces) |
| Message bus | Every service queue in the nw virtual host has at least one consumer |
| The password-reset email arrives | |
| The product | The 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
- Create the namespace:
kubectl create namespace northwind. - In terminal 2, watch the pods:
kubectl -n northwind get pods -w. - 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. - When Helm returns, read its status:
helm status nw -n northwind. It saysSTATUS: deployedandREVISION: 1, followed by the chart’s notes with the address.
Smoke test: the layers
- Workloads:
kubectl -n northwind get pods,jobs. Every pod1/1(orn/n) ready; the JobsComplete. - Migration:
kubectl -n northwind logs job/nw-osos-migration-1 | tail -20. No line witherrororCannot migrate. - Redis:
kubectl -n datastores exec deploy/redis -- redis-cli -a lab-only-redis -n 1 --scan --pattern 'nw-*'. You seenw-:domainsandnw-:spacesamong the keys. - Bus:
kubectl -n datastores exec deploy/rabbitmq -- rabbitmqctl list_queues -p nw name consumers messages. Every…-service-queuehas1or more consumers; every…dead-letterqueue has0messages.
Smoke test: the product
-
Open
http://localhostin 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
localhostbecauseidentity.ingress.enabledis off. If you see an error page with a Retry button instead, go to the troubleshooting table. -
Select Forgot password?, enter
operator@northwind.example.comin Email and select Reset Password. The page says Check your email for a link to reset your password. -
In terminal 2, stop the watch and run
kubectl -n datastores port-forward svc/mailpit 8025:8025. Openhttp://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.
-
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.
-
Back on
http://localhost, sign in asnwoperatorwith that password. On the welcome page, select START USING followed by the organization’s name. -
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 licenseprints 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.
-
Write the smoke test, with the commands from steps 5 to 14, into
inventory.mdunder a heading Smoke test. You will run it again after every change.
Check.
-
helm statusshowsdeployed, revision 1. - Every pod ready; both Jobs
Complete. - The migration log ends without an error.
-
nw-:domainsandnw-:spacesexist in Redis. - Every service queue in
nwhas a consumer, and no dead-letter queue holds messages. - The reset email arrived in Mailpit.
- You signed in as
nwoperatorand Administration opened. - Your smoke test is written down.
Pass condition. All eight checks hold on your own cluster.
If something goes wrong
| What you see | What to do |
|---|---|
Pods stay ImagePullBackOff | The 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 Job | kubectl -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/1 | Give 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 errors | An address or password in the values does not match the datastore. Compare with M0-S2’s Service names. |
| Helm times out before the migration ran | The 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 failed | kubectl -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 button | The 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 calls | The 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 challenge | Human 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 Mailpit | Check 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 exists | A 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,altchaandemailpods ready; the bus set-up Job andnw-osos-migration-1Complete.- Redis:
nw-:domainsandnw-:spacespresent (alongside othernw-keys). rabbitmqctl list_queues -p nw: queues such asdata-service-queue,workflow-service-queue,notification-service-queue, each with consumers1, and their dead-letter queues with messages0.- Mailpit holds one reset email; after setting the password,
nwoperatorreaches 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”Put these install steps in the order Helm runs them.
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.
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?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
You uninstall a lab release and reinstall it with a newly generated shared key. Services reject the gateway’s calls. What did you forget?
Check your answer
The correct answer is A. Open the explanation under each option to see why.
A colleague reports “the platform is up: helm status says deployed”. Which single check would prove
the most layers at once?
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.