20 Repositories

Repositories

On Klok, Git is the truth also for what runs. An image is built on main and tagged with the commit it was built from, the tenant's deploy manifests say which image each workload runs, and Argo CD applies the manifests to the cluster. Repositories puts that chain on one page: every repository of the tenant with its last pipeline on the default branch, its open merge requests, and whether what runs was built from main. Developers, architects and whoever keeps the integrations running use it to see what is deployed, and from which commit, without access to the cluster.

  • In the menu: Run → Repositories (/tenant-admin/repositories)
  • For: every member of the tenant, within the domains they may read: a domain admin or developer sees the repositories of their domains, plus common and public
  • Reads: GitLab (the projects, the last pipeline on each default branch, the open merge requests) and the tenant's deploy manifests repository <tenant>/environment/<tenant>-deploy-manifests on main, folder <tenant>/, every time the page loads; Argo CD when klok.dev may read the cluster

What You See

The line above the list says where the deployments were read from, here klok/environment/klok-deploy-manifests, folder klok/. When klok.dev may read Argo CD, the same line names the tenant's application, ipaas-se-<tenant>, and whether it is synced and healthy. In production klok.dev's service account has no rights in the cluster yet, so the line says the application is not readable and the workloads have no health (klok-environment-setup#34).

The services do not deploy from the tenant's own repository yet. klok-cli's klok manifest update, which every project's update_manifest job runs, still writes every tenant's images to the shared klok/environment/ipaas/ipaas-service-deploy-manifests, so until it writes to the tenant's own (frontend-klok-dev#158), Deployed says Not deployed for services that run. The example on this page shows Repositories as it reads once they do.

Column What it says
Repository The path, linked to GitLab, with its group and domain under it; a repository klok.dev could not read shows the error in amber
Pipeline The last pipeline on the default branch, Passed, Failed, Running and so on, linked to the pipeline in GitLab, and when it last changed; None when the branch has no pipeline yet, as for a repository whose only commit is the [skip ci] one it was created with
Merge requests How many are open, linked to the list in GitLab
Deployed From main when every image that runs was built from the commit of the last pipeline on main; Other build when one was built from another commit, or is tagged with something other than a commit; Not deployed when no manifest uses the repository's image
Workloads How many workloads run its image; the count opens a panel with each workload's name and kind, its image tag, its health in Argo CD and the manifest file it is declared in

Not deployed is the normal state of a repository that does not run: a datamodel, a template, a dependency catalog, a documentation project or the solution registry.

Search by path, group or domain, narrow the list to one domain with the filter next to the search box, and press Refresh to read it all again. For every tenant but klok, Platform services under the list shows what klok runs for the tenant, such as its own ODL and task instance, read from klok's own deploy manifests repository.

Walkthrough: Is What Runs Built From Main?

  1. Open Run → Repositories. The list is sorted by path, so the datamodels come first.

  2. Narrow it to a domain with the filter next to the search box, here hr, or search for a repository's name.

  3. Read each row from left to right. In the example, klok-egress-personec has a failed pipeline on main, so no new image reached the deploy manifests: the service still runs the build before, which Deployed shows as Other build. The fix waits as an open merge request. When a person has merged it and the pipeline on main passes, the pipeline writes the new tag into the manifests and the row reads From main.

  4. Open Workloads on the row to see what runs: the workload, its tag (the short commit the image was built from), its health and the manifest file. Here the tag is the commit before the failed one.

  5. After a merge, press Refresh. klok.dev keeps none of this, so a repository made by hand in GitLab, or a manifest edited by hand, shows the next time the page reads.

Walkthrough: Follow A Pipeline That Runs

  1. Search for the repository, here klok-api. klok-api-ai has a pipeline running on main; the time under the status is when the pipeline last changed.
  2. Choose the status to open the pipeline in GitLab, or 1 open for its merge requests.

What Happens In Git

On the page What it reads or writes Merged or approved by By hand
Opening the page, Refresh Writes nothing. Reads the projects under the tenant's root group in the domains you may read, the last pipeline on each default branch and the number of open merge requests, through the GitLab API — The project's Pipelines and Merge requests in GitLab
Deployed, Workloads Reads every manifest under <tenant>/ in <tenant>/environment/<tenant>-deploy-manifests on main; an image belongs to the project whose path it starts with, repo.klok.dev/<project path>:<short commit> — The manifest file in GitLab; klok fleet status --manifests-repo <tenant>/environment/<tenant>-deploy-manifests lists the same workloads in a terminal, with a verdict for each
What changes the page: a merge into main The pipeline on main builds the image and pushes it tagged with the short commit; update_manifest writes the new tag into the deploy manifests as a commit with [skip ci] (today into the shared klok/environment/ipaas/ipaas-service-deploy-manifests, #158); Argo CD applies it A person merges the merge request; the pipeline and Argo CD do the rest Merge in GitLab; klok manifest update is the command the job runs

Nothing on this page changes anything. See What klok.dev Does In Git for every page.

Who Does What

Automation Kloker You
Every merge into main is a release: the pipeline builds and pushes the image, a library or datamodel writes its new version into the dependency catalog, update_manifest writes the new tag into the deploy manifests, and Argo CD rolls it out When a merge request opened from klok.dev or by Kloker fails its pipeline, Kloker can find the cause and push a fix to the merge request's branch, when you ask for it or the tenant's policy lets it (Kloker → Background); it never merges and never pushes to main Review and merge; fix a failing main with a merge request; run a pipeline again in GitLab when it is needed

See You, The Automation And Kloker.

How It Connects

The repositories come from the Build pages: Integration Projects and Datamodels create them from their templates. What Repositories shows as running is what the other Run pages watch: Logs follows the services' log events and Broker their topics, and Documentation shows what each build published about itself. How The Run Pages Fit Together puts them side by side.

Read More