Skip to main content
Version: Preview

Runner reference

Every setting for runners: the server's serving config, the runner's flags, its policy file, the Kubernetes plugin's triggers and the tools chart.

Server configuration​

Self-hosted servers only. Marmot Cloud sets these for you.

KeyDescriptionDefault
query.serve.enabledAccept runnersfalse
query.serve.listen_addressAddress the serve listener binds:8443
query.serve.public_addresshost:port runners dial, when it isn't the Marmot host on the listen port
query.serve.replica_addressHost or host:port other replicas forward queries to. Only with more than 1 replica
query.serve.ca_key_uriKMS key for the serving CA
query.serve.signing_key_uriKMS key that signs every request
query.serve.approval_key_uriKMS key that signs approvals, and nothing else

Serving needs the server encryption key, and Marmot won't start with serving on and no key. Name all 3 KMS keys or none. Each is an ECDSA P-256 key:

KMSURI
AWS KMSawskms:///<key-arn>
Google Cloud KMSgcpkms://projects/<project>/locations/<location>/keyRings/<ring>/cryptoKeys/<key>/cryptoKeyVersions/<version>
Azure Key Vaultazurekms://<vault>.vault.azure.net/<key>
HashiCorp Vault transithashivault://<key>

Runner flags​

Flags of marmot plugin, also called marmot ingest:

FlagDescription
--serveAfter ingesting, stay running and serve the run marked queryable: true
--policy <path>A YAML policy limiting what the runner serves. Once given, sources it doesn't name are refused
--audit-log <path>Append a hash-chained JSON line for every query, read, plan, tool and trigger event
--allow-toolsAlso serve the reads, tools and triggers the policy names. Needs --audit-log
--ca-fingerprint sha256:<hex>A CA fingerprint Marmot's first enrolment must include. Repeatable
--ca-file <path>A PEM CA to trust for the Marmot API, as well as the system's. Also MARMOT_CA_FILE

The runner reads MARMOT_HOST, which must be HTTPS, and MARMOT_API_KEY.

Commands​

CommandDescription
marmot admin serve-keysList the serving key generations, their fingerprints and when they activate and retire
marmot admin rotate-serve-keysRotate the serving keys gracefully. --immediate switches at once and closes every connection
marmot ingest verify-audit-log <path>Check a runner's audit log for edited or removed lines

rotate-serve-keys takes --ca-key-uri, --signing-key-uri and --approval-key-uri to move the keys into a KMS or change them. Name all 3 or none.

Policy file​

Unknown keys are an error, so a misspelt key can't loosen the policy. The runner checks the policy against the plugin's manifest when it starts.

Top level​

KeyDescription
approvals.trustHow the runner trusts approvals. marmot is the only value. Required when any write needs approval
approvals.max_ageThe longest an approval stays valid, at most 1h
approvals.key_fingerprintAccept only the approval key with this fingerprint, from marmot admin serve-keys
sources.<name>A source the runner serves, by its pipeline name

Sources​

KeyDescriptionDefault
queryWhether the source answers queries. false refuses themtrue
max_rowsA ceiling on rows. A query signed with a higher limit is cut to itNo ceiling
actorsPatterns the signed actor must match, such as user:alice or service_account:*Any actor
originsPatterns the signed origin must match, such as task_run:*. Tools only ever come from task runs, whatever this saysAny origin
manifestsha256:<hex> pin of the plugin's tools. Any change to them refuses every tool until updatedNo pin
tools.<name>A read or tool the runner serves. One the policy doesn't name is refused
triggers.<name>A trigger the runner runs

In patterns, * matches any run of characters.

Tools​

KeyDescription
actors, originsAllow-lists checked as well as the source's
params.<param>.min, .maxBounds for a whole-number parameter
params.<param>.valuesThe only values allowed. A constrained parameter must be given
approvalsDistinct people who must approve: 1 when unset, at most 2. 0 only for a risk 1, reversible tool, written out
approversOnly these people count, by Marmot user id or user name

Reads take no approvals.

Triggers​

KeyDescriptionDefault
paramsThe trigger's parameters, checked against the plugin's manifest
cooldownHow long repeats for the same object are dropped, from 1m to 24h30m

Each source sends at most 30 trigger events a minute.

Kubernetes triggers​

Every trigger only reads and is scoped by namespaces and selector. Nodes, and watching every namespace, need the chart's triggers.clusterWide.

TriggerFires whenParameters
workload_unhealthyA workload or its pods hold a condition for for_minuteskinds, namespaces, selector, conditions, for_minutes
node_unhealthyA node holds a condition for for_minutesselector, conditions, for_minutes
warning_eventsAn object gathers min_count Warning events of one listed reason within window_minutesnamespaces, reasons, min_count, window_minutes
custom_conditionA CEL expression when over object is true for for_minuteskind, namespaces, selector, name, when, for_minutes

workload_unhealthy conditions are crash_looping, image_pull_failing, config_error, oom_killed, not_ready, unschedulable, replicas_unavailable, rollout_stuck and job_failed. node_unhealthy conditions are not_ready, memory_pressure, disk_pressure, pid_pressure, network_unavailable and unschedulable_for.

A custom_condition must compile and return a bool when the runner starts. An evaluation error counts as false. For example, a deployment with fewer replicas available than it wants:

custom_condition:
params:
kind: deployment
namespaces: [payments]
name: below_desired
when: object.status.?availableReplicas.orValue(0) < object.spec.replicas
for_minutes: 5
cooldown: 2h

Kubernetes tools chart​

Values of marmotdata/marmot-kubernetes-tools:

ValueDescriptionDefault
namespacesNamespaces tools may change. Each gets its own Role. Match the plugin's tools.namespaces[]
tools.scaleGrant scaling Deployments and StatefulSetstrue
tools.rolloutRestartGrant restarting Deployments, StatefulSets and DaemonSetstrue
tools.cronJobsGrant suspending and resuming CronJobstrue
tools.cordonGrant cordoning and uncordoning nodes, through a ClusterRolefalse
tools.observeGrant the reads: pods, their logs and eventstrue
triggers.enabledGrant watching workloads and events in namespacestrue
triggers.clusterWideGrant watching every namespace and nodes. Reads every pod's status, never a Secret or logfalse
maxReplicasMost replicas the admission policy admits. At or above the plugin's tools.max_replicas20
selectorLabels every changed object must carry. Match the plugin's tools.selector{}
admissionPolicy.enabledInstall the admission policytrue
serviceAccount.nameThe runner's service accountThe release name

The chart grants no access to Secrets, no create or delete, no exec and nothing on RBAC. Its admission policy refuses, from the runner, any change beyond the fields a tool touches, and refuses every change if it can't be evaluated. It doesn't grant rolling back, because admission can't tell a rollback from any other change to a pod template.