From 360b00f72e3b13a0584510811cdb3de711ff67e9 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <47090312+singiamtel@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:26:46 +0200 Subject: [PATCH] Add nomad system gc to troubleshooting (#127) Also fixing the headers, the table of contents wasn't rendering properly --- docs/infrastructure-nomad.md | 39 +++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/docs/infrastructure-nomad.md b/docs/infrastructure-nomad.md index 066f664d..a366b49f 100644 --- a/docs/infrastructure-nomad.md +++ b/docs/infrastructure-nomad.md @@ -10,11 +10,11 @@ These all have web interfaces. If you have access, you can log in at .nomad`. @@ -197,7 +197,7 @@ nomad job plan repo.nomad # check if the job can be scheduled nomad job run repo.nomad # actually run the job ``` -### Complex, templated job declarations (e.g. CI) +#### Complex, templated job declarations (e.g. CI) Complicated job declarations are broken up into a common, templated declaration, and multiple YAML "variable files" to declare the variations of the base job to be deployed. These should be collected into a single directory, with multiple `.yaml` files, but only one `.nomad` file per directory. @@ -228,9 +228,9 @@ levant render -var-file vars.yaml | nomad job run - # actually run job [o2physics-ci]: https://github.com/alisw/ci-jobs/blob/master/ci/mesosci-slc7-o2physics.yaml -# Tips and tricks for writing Nomad job declarations +## Tips and tricks for writing Nomad job declarations -## Using Vault secrets +### Using Vault secrets If you want to use Vault secrets in your job declaration, you can substitute them inside of templates. @@ -268,8 +268,19 @@ This example assumes that you have a secret called `my-secret-name` stored in Va ``` -# Troubleshooting +## Troubleshooting +### Stuck allocations/jobs + +When a job is not able to be deleted and recreated, you can force the deletion using the following commands (requires nomad management token): + +```bash +nomad job stop -purge +nomad system gc +``` + + +### Nomad error initializing client: tls: failed to parse private key If you are on macOS you'll need an unencrypted key, you can export it from your certificate with a command like this (note the ``-nodes`` flag)