krci-agent-dispatcher

by sergk

Helm chartv0.1.0-SNAPSHOT.44App 0.1.0-SNAPSHOT.44Apache-2.0Verified publisher

A Helm chart for krci-agent-dispatcher, the dispatcher for KubeRocketCI issue agents

About this chart

krci-agent-dispatcher

A Helm chart for krci-agent-dispatcher, the dispatcher for KubeRocketCI issue agents

Homepage: https://docs.kuberocketci.io/

Maintainers

NameEmailUrl
epmd-edp[email protected]https://solutionshub.epam.com/solution/kuberocketci

Source Code

Secrets

All Secrets are in the release namespace. Two credential scopes; no Secret is in both.

ScopeSecretKeyContentRead by
Dispatcher credentials<fullname>gitlab-tokenGitLab token of the dispatcher's bot userdispatcher
hook-tokenGitLab hook secret tokendispatcher
Actor credentialsgitlabtokenGitLab token of the agent's bot useregress gateway (PRIVATE-TOKEN)
basicbase64 of oauth2:<token>egress gateway (Authorization: Basic, git over HTTPS)
anthropicapi-keyAnthropic API keyegress gateway (x-api-key)
  • Actor credentials: names fixed by the egress policy; label app.edp.epam.com/actor-credential: "true". No pod mounts them.
  • One bot user: the two GitLab tokens are equal.

eso.enabled: false: create the three Secrets by hand, the actor credentials with the label.

eso.enabled: true: ESO creates the three Secrets from one provider secret per scope, a JSON object each:

eso.secretPath.dispatcher   {"gitlab-token": "<token>", "hook-token": "<hook secret token>"}
eso.secretPath.actor        {"gitlab-token": "<token>", "anthropic-api-key": "<api key>"}

ESO makes basic from gitlab-token of the actor scope and sets the label. Objects: one SecretStore (<fullname>), ExternalSecrets <fullname>, gitlab, anthropic, and for aws and vault the ServiceAccount externalsecrets-<fullname>-<provider>. AWS: the IAM role of eso.aws.roleArn trusts this ServiceAccount (IRSA) and allows ssm:GetParameter on the two parameters (kms:Decrypt of their key for a SecureString).

Substrate requirements

The Substrate install provides:

  • The Substrate API at substrate.addr, its serving certificate in a ClusterTrustBundle of substrate.trustBundleSigner with substrate.trustBundleLabels, and network access to it from the release namespace.
  • The atespace substrate.atespace (empty: the release namespace), with access policy role editor for the ServiceAccount <fullname> of the release namespace.
  • Workers with the worker labels of substrate.workerSelector.
  • A credential grant: the egress gateway of the atespace reads the Secrets of the release namespace with label app.edp.epam.com/actor-credential: "true", and no other Secret.

Values

KeyTypeDefaultDescription
affinityobject{}Affinity.
config.agentModelstring"claude-haiku-5-5"Claude model of the agent runs.
config.agentStepsint40Agent steps per turn: the Claude Code --max-turns of one agent run.
config.botUsernamestring"krci-agent"Bot user: ignored note author, marker author.
config.harnessPollIntervalstring"15s"Note poll interval of the harness in each actor, whole seconds. turnTimeout must be at least this plus 2m.
config.pollIntervalstring"10s"Marker poll interval.
config.sweepIntervalstring"5m"Time between sweeps over actors without an issue lane. 0 turns the sweep off.
config.triggerMinRolestring"developer"Trigger role: lowest GitLab project role that can start the agent and write trigger comments: developer, maintainer or owner.
config.turnLimitint20Turn limit per issue.
config.turnTimeoutstring"15m"Dispatcher wait for one turn's marker, whole seconds. The harness cuts a turn at turnTimeout minus harnessPollInterval minus 60s.
eso.apiVersionstring"external-secrets.io/v1"API version of the SecretStore and ExternalSecret objects. ESO 0.16 and 2.x serve external-secrets.io/v1.
eso.aws.regionstring"eu-central-1"AWS region.
eso.aws.roleArnstring"arn:aws:iam::012345678910:role/AWSIRSA_Shared_ExternalSecretOperatorAccess"IAM role of the ESO ServiceAccount externalsecrets-<fullname>-aws (IRSA): ssm:GetParameter on the two eso.secretPath parameters, kms:Decrypt of their key for a SecureString.
eso.enabledboolfalseCreate the dispatcher and actor credentials with the External Secrets Operator (ESO): one SecretStore, one ExternalSecret per Secret. false: create the Secrets by hand.
eso.generic.secretStore.providerConfigobject{}SecretStore spec.provider (if provider is generic). Required.
eso.providerstring"aws"SecretStore provider: aws (Parameter Store), generic or vault.
eso.secretPath.actorstring"/infra/core/addons/krci-agent-dispatcher/actor"Actor scope: gitlab-token (GitLab token of the agent's bot user), anthropic-api-key (Anthropic API key).
eso.secretPath.dispatcherstring"/infra/core/addons/krci-agent-dispatcher/dispatcher"Dispatcher scope: gitlab-token (GitLab token of the dispatcher's bot user), hook-token (GitLab hook secret token).
eso.vault.mountPathstring"core"Mount path of the Kubernetes auth method.
eso.vault.rolestring"krci-agent-dispatcher"Vault role of the Kubernetes auth method.
eso.vault.serverstring"http://vault.vault:8200"Vault server URL.
fullnameOverridestring""Overrides the full name.
gitlab.caConfigMapstring""ConfigMap with key ca.crt: extra CA bundle for GitLab TLS. Empty: system roots.
gitlab.urlstring""GitLab base URL: https://HOST[:PORT][/PATH], for example https://gitlab.example.com. No user info, query or fragment. Trailing slash allowed. Required.
harnessImagestring"epamedp/krci-agent-harness:0.1.0-SNAPSHOT.37@sha256:42be0e0f7dd47cf60efceb5d847666dc2f388e58b968be65bd6006eb03c7cca8"Harness image mounted into every issue actor at /opt/krci-agent: <repo>[:<tag>]@sha256:<digest>. Default: the last harness verified with this chart; bump it with each verified release. Override for a local build.
image.digeststring""Image digest (sha256:...); takes precedence over image.tag.
image.pullPolicystring"IfNotPresent"Image pull policy.
image.repositorystring"epamedp/krci-agent-dispatcher"Dispatcher image repository.
image.tagstring""Image tag. Empty: the chart appVersion.
imagePullSecretslist[]Image pull secrets.
ingress.annotationsobject{}Extra Ingress annotations.
ingress.classNamestring"nginx"Ingress class.
ingress.enabledbooltrueExpose POST /hook through an Ingress with a cert-manager Certificate.
ingress.hoststring""Hook host name. Required when ingress.enabled.
ingress.tls.enabledbooltrueTLS on the Ingress: a cert-manager Certificate and the Ingress tls block. false: neither; TLS ends in front of the ingress controller, for example a load balancer.
ingress.tls.issuerRef.kindstring"ClusterIssuer"cert-manager issuer kind (Issuer or ClusterIssuer).
ingress.tls.issuerRef.namestring""cert-manager issuer name. Required when ingress.enabled and ingress.tls.enabled.
ingress.tls.secretNamestring"krci-agent-dispatcher-tls"Secret of the Ingress certificate.
nameOverridestring""Overrides the chart name.
nodeSelectorobject{}Node selector.
podAnnotationsobject{}Pod annotations.
profiles.existingConfigMapstring""ConfigMap with key profiles.yaml: the agent profiles (agent image, egress, env per profile, project mapping, default profile). Empty: the chart's deploy-templates/profiles.yaml, embedded verbatim. Read at each actor create; a change needs no restart and applies to new sessions.
resourcesobject{"limits":{"memory":"256Mi"},"requests":{"cpu":"50m","memory":"64Mi"}}Container resources.
service.portint8080Service port.
serviceAccount.annotationsobject{}Annotations of the ServiceAccount. Its name is the full name: the Substrate access policy member.
substrate.addrstring"api.ate-system.svc:443"Substrate API address.
substrate.atespacestring""Atespace of the issue actors. Empty: the release namespace. One dispatcher per atespace: the dispatcher owns every actor named issue-<project-id>-<iid> in it.
substrate.tokenAudiencestring"api.ate-system.svc"ServiceAccount token audience of the Substrate API.
substrate.trustBundleLabelsobject{"podcert.ate.dev/canarying":"live"}ClusterTrustBundle label selector.
substrate.trustBundleSignerstring"servicedns.podcert.ate.dev/identity"ClusterTrustBundle signer of the Substrate API serving certificate.
substrate.workerSelectorobject{}Worker selector of the actor template: match labels, key to value. A worker hosts agent actors only when every key equals its worker label, the metadata.labels of its WorkerPool; the WorkerPool name is not matched. Kubernetes label syntax; every value a non-empty string, numbers and booleans quoted (--set-string on the command line). Empty: workload: workers.
tolerationslist[]Tolerations.

Deploy krci-agent-dispatcher with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has krci-agent-dispatcher on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkrci-agent-dispatcher is pinned at v0.1.0-SNAPSHOT.44 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply