Tear down your local Tally
Do this lesson last. It belongs to neither track: it ends the cluster and the compose stack every other lesson works on, and nothing here can be undone. The billing track continues from the state Watch the month in Grafana leaves behind, so a reader going on to it, through Discount a customer group and the four lessons after it, runs this one after that track's last lesson, Book the late events as a credit note. Tearing down between the two tracks leaves the billing track nothing to continue from, and the way back is the core track again from Set up your local Tally.
In this lesson you take the machine back to where lesson 1 started. The simulator stack goes with its broker and its outbox, and the kind cluster goes with every database in it: the month of lesson 2, the run of lesson 3 and the project registry. Every token and credential the lessons issued goes with those databases, because that is where they live. You remove the CA file tally-ca.crt at the repository root and the export directory ~/tally-tutorial by hand.
What stays is the four tally-*:dev images in Docker, the Go build and module caches under your home directory, and the clone.
This lesson takes about 5 minutes.
Before you start
Every lesson you still want to run, done. This one leaves no environment for a later lesson to work on.
The state lesson 1 leaves, or the state any later lesson leaves: a cluster from
make up, and whatever the later lessons added to it. A step that finds nothing to remove says so and changes nothing.A shell at the repository root.
The shell that holds the port-forward lesson 3 started in the background, so that it can be stopped there. Any shell ends it with:
shpkill -f '[p]ort-forward svc/victoriametrics'It prints nothing and ends the background job lesson 3 started, and on a machine where lesson 3 never ran it ends nothing and exits 1, which is fine. The bracket makes a pattern that matches
port-forwardand not itself.pkill -fmatches against the whole command line of every process, so without the bracket a shell whose own command line carries the pattern, abash -chanded this line with a second command, is ended with the job. Thepkillof Linux does that; the one of macOS spares the shells that called it.
Stop the simulator stack
Remove the three containers of the stack, their network, the outbox volume and
deploy/compose/.env:shmake simulator-downtextdocker compose -f deploy/compose/compose.yaml down --volumes Container tally-simulator-simulator-1 Stopping Container tally-simulator-collector-1 Stopping Container tally-simulator-simulator-1 Stopped Container tally-simulator-simulator-1 Removing Container tally-simulator-simulator-1 Removed Container tally-simulator-collector-1 Stopped Container tally-simulator-collector-1 Removing Container tally-simulator-collector-1 Removed Container tally-simulator-rabbitmq-1 Stopping Container tally-simulator-rabbitmq-1 Stopped Container tally-simulator-rabbitmq-1 Removing Container tally-simulator-rabbitmq-1 Removed Network tally-simulator_default Removing Volume tally-simulator_outbox Removing Volume tally-simulator_outbox Removed Network tally-simulator_default Removed rm -f deploy/compose/.envThe names have to match: the three containers, the network
tally-simulator_defaultand the volumetally-simulator_outbox. The order theStoppingandStoppedlines arrive in is your own. With the simulator container the 84 notifications it was holding are discarded: no release was sent, and the held share exists nowhere else. The last line removesdeploy/compose/.env, the file with the ingest credential, and the credential itself stays in the reporting database until the cluster goes in the next step. On a machine where lesson 2 never ran, compose warns about unsetTALLY_SIM_variables, because nodeploy/compose/.envexists, and removes nothing, which is fine.
Delete the cluster
Delete the kind cluster:
shmake downtextDeleting cluster "tally" ... Deleted nodes: ["tally-control-plane"]Both lines have to match. With the node go both databases and what they hold: the month, the run, the project registry, and every token and credential the lessons issued. The series lesson 2 pushed and the state the dashboards of lesson 4 read go with it as well.
Check that no cluster is left:
shkind get clusterstextNo kind clusters found.The line has to match. It is the state lesson 1 starts from. A second
make downprints that same line again, from the check it makes before it deletes anything, and thenkind cluster tally does not exist. It changes nothing.
Remove what the lessons wrote
Remove the CA file, the eight export directories, the seven variables of the core track and the eleven of the billing track:
shrm tally-ca.crt rm -rf ~/tally-tutorial/2026-07 ~/tally-tutorial/2026-07-group ~/tally-tutorial/2026-07-reseller ~/tally-tutorial/2026-07-attributed ~/tally-tutorial/2026-07-final ~/tally-tutorial/2026-07-final-again ~/tally-tutorial/2026-07-final-csv ~/tally-tutorial/2026-07-notes rmdir ~/tally-tutorial unset TALLY_REPORTING_DB_URL TALLY_API_TOKEN TALLY_ENGINE_DB_URL TALLY_ENGINE_REPORTING_DB_URL TALLY_ENGINE_COUNTER_SOURCES TALLY_ENGINE_VM_URL RUN_ID ACME_1_ID ACME_2_ID ACME_3_ID ACME_ID CI_ID PARTNER_ID ALPHA_TENANT_ID BETA_TENANT_ID ALPHA_ID BETA_ID CORRECTION_IDThe four commands print nothing.
tally-ca.crtis stale from here on: the nextmake upcreates a new certificate authority, andmake -s cawrites the file again for it. Therm -rfnames the eight directories the lessons export into and nothing else.2026-07held the export of lesson 3, the six statements withrun.jsonandkickbacks.jsonbeside them. The seven after it are the billing track's,2026-07-group,2026-07-reseller,2026-07-attributed,2026-07-final,2026-07-final-again,2026-07-final-csvand2026-07-notes, and-fis what skips them without a word on a machine where that track never ran.rmdirremoves~/tally-tutorialonly when it is empty.rmdir: /Users/you/tally-tutorial: Directory not empty, which GNUrmdirwordsrmdir: failed to remove '/home/you/tally-tutorial': Directory not empty, means something the lessons did not write lives there, and this step leaves it alone.rmdir: /Users/you/tally-tutorial: No such file or directory, in GNU's wordsrmdir: failed to remove '/home/you/tally-tutorial': No such file or directory, means lesson 3 never ran, which is fine. The home directory in these lines is your own.The seven variables are the shell state lessons 1 to 3 built, and
unsetleaves this shell without them. The eleven afterRUN_IDare the billing track's, andunsetskips a variable that is not set without a word, so the line is the same on a machine where the billing track never ran.rm: tally-ca.crt: No such file or directorymeans the file was already gone, which is fine.
What stays
List the images the track built:
shdocker image ls 'tally-*'textIMAGE ID DISK USAGE CONTENT SIZE EXTRA tally-engine:dev 5411e0bd59f9 15.3MB 0B tally-openstack-collector:dev d879c5ca78ff 15.9MB 0B tally-openstack-simulator:dev 6527cde4f567 17.6MB 0B tally-reporting:dev cf2be4a2bd30 19.3MB 0BThe four
:devimages are whatmake upbuilt, and their names have to match. The ids, the sizes and the column layout are Docker's own. Beside the images stay Docker's build cache from the image builds, whichdocker builder pruneremoves, the Go build and module caches under your home directory, and the clone.Remove the images if you want the disk back:
shdocker image rm tally-reporting:dev tally-engine:dev tally-openstack-collector:dev tally-openstack-simulator:devThis is your choice and not a step of the track: the four images cost about 70 MB, and the next
make upbuilds them again.
What you learned
- No command of Tally deletes an event. The month is gone because the database went with the cluster: why the history is append-only.
- The collector's outbox is a volume of the compose stack, and
make simulator-downdrops it with the stack: the outbox on disk. - The four images are four of the six binaries, built by
make upand rebuilt by the next one: the six binaries. - A second run of this track renders the same month, byte for byte, because the seed decides what the simulated world does: determinism.
Where to go next
Set up your local Tally runs the track again from an empty machine, which is what this machine is now: no kind cluster, no compose stack, no tally-ca.crt, no ~/tally-tutorial, and the clone.
For a cloud of your own, the how-to guides take these commands task by task, and the reference is where the flags, the settings and the formats are written down.