kimistore

by loafoe

Helm chartv0.3.0App v1.0.0

Kafka-compatible streaming agent that keeps its durable log in object storage

About this chart

kimistore

Kafka-compatible streaming agent that keeps its durable log in object storage

Homepage: https://github.com/kimistore/agent

Maintainers

NameEmailUrl
Andy Lo-A-Foe[email protected]

Values

KeyTypeDefaultDescription
affinityobject{}
agent.autoCreatePartitionsint4
agent.autoCreateTopicsbooltrue
agent.envobject{}
agent.flushIntervalMsint1000
agent.s3TimeoutMsint30000
argslist[]
assignment.enabledboolfalse
assignment.modestring"rendezvous"
assignment.settleMsstring""
broker.portint9092
commandlist[]
configMap.createbooltrue
extraContainerslist[]
extraVolumeMountslist[]
extraVolumeslist[]
fullnameOverridestring""
image.pullPolicystring"IfNotPresent"
image.repositorystring"ghcr.io/kimistore/agent"
image.tagstring"v1.0.0"
imagePullSecretslist[]
livenessProbe.failureThresholdint5
livenessProbe.periodSecondsint10
livenessProbe.timeoutSecondsint5
metrics.portint9091
nameOverridestring""
networkPolicy.enabledboolfalse
networkPolicy.extraEgresslist[]
networkPolicy.extraIngresslist[]
nodeSelector."kubernetes.io/os"string"linux"
objectStorage.accessKeyIdstring""
objectStorage.bucketstring""
objectStorage.endpointstring""
objectStorage.existingSecretstring""
objectStorage.keys.AWS_ACCESS_KEY_IDstring"AWS_ACCESS_KEY_ID"
objectStorage.keys.AWS_SECRET_ACCESS_KEYstring"AWS_SECRET_ACCESS_KEY"
objectStorage.keys.AWS_SESSION_TOKENstring"AWS_SESSION_TOKEN"
objectStorage.regionstring""
objectStorage.secretAccessKeystring""
objectStorage.sessionTokenstring""
ownership.ttlMsint60000
persistence.accessModestring"ReadWriteOnce"
persistence.annotationsobject{}
persistence.enabledbooltrue
persistence.mountPathstring"/var/lib/kimistore/wal"
persistence.sizestring"20Gi"
persistence.storageClassNamestring""
persistence.volumeModestring""
podAnnotationsobject{}
podDisruptionBudget.enabledbooltrue
podDisruptionBudget.maxUnavailablestring""
podDisruptionBudget.minAvailableint1
podManagementPolicystring"Parallel"
podSecurityContext.fsGroupint65532
podSecurityContext.runAsGroupint65532
podSecurityContext.runAsNonRootbooltrue
podSecurityContext.runAsUserint65532
podSecurityContext.seccompProfile.typestring"RuntimeDefault"
priorityClassNamestring""
readinessProbe.failureThresholdint3
readinessProbe.periodSecondsint5
readinessProbe.timeoutSecondsint5
replicaCountint1
resources.limits.cpustring"2"
resources.limits.memorystring"4Gi"
resources.requests.cpustring"500m"
resources.requests.memorystring"1Gi"
retention.checkIntervalMsint300000
retention.retentionBytesint-1
retention.retentionMsint-1
sasl.enabledboolfalse
sasl.existingSecretstring""
sasl.passwordstring""
sasl.passwordKeystring"password"
sasl.usernamestring""
sasl.usernameKeystring"username"
securityContext.allowPrivilegeEscalationboolfalse
securityContext.capabilities.drop[0]string"ALL"
securityContext.readOnlyRootFilesystembooltrue
service.annotationsobject{}
service.externalTrafficPolicystring""
service.loadBalancerIPstring""
service.loadBalancerSourceRangeslist[]
service.metrics.clusterIPboolfalse
service.metrics.enabledbooltrue
service.metrics.typestring"ClusterIP"
service.portint9092
service.sessionAffinitystring""
service.typestring"ClusterIP"
serviceAccount.annotationsobject{}
serviceAccount.createbooltrue
serviceAccount.namestring""
serviceMonitor.enabledboolfalse
serviceMonitor.intervalstring"30s"
serviceMonitor.labelsobject{}
serviceMonitor.metricRelabelingslist[]
serviceMonitor.relabelingslist[]
serviceMonitor.scrapeTimeoutstring"10s"
startupProbe.failureThresholdint60
startupProbe.periodSecondsint5
startupProbe.timeoutSecondsint5
terminationGracePeriodSecondsint60
tolerationslist[]
topologySpreadConstraintslist[]
updateStrategy.rollingUpdate.maxUnavailableint1
updateStrategy.typestring"RollingUpdate"

Before you install

The image is ghcr.io/kimistore/agent, built with ko and signed keyless with cosign. Three tags are published:

TagWhat it is
v1.0.0The current release. Signed, immutable in practice, matches the git tag, and what this chart defaults to.
1.0.0The same image under a bare semver, for tooling that wants one. Same digest.
mainThe moving branch tip. Convenient in development, worth little as a provenance claim.

For a deployment you care about, pin the digest:

helm install kimistore oci://ghcr.io/loafoe/helm-charts/kimistore \
  --set image.tag="sha256:4f9a14bb1015d82420230e2fe8129a13005bc2a9f438ff88abaa9b64fb5df695" \
  --set objectStorage.bucket=kimistore \
  --set objectStorage.region=eu-central-1

A tag can be repointed after you install, so pinning one proves nothing about what you are running. The digest does. And verify it:

cosign verify ghcr.io/kimistore/agent@sha256:4f9a14bb1015d82420230e2fe8129a13005bc2a9f438ff88abaa9b64fb5df695 \
  --certificate-identity-regexp \
    'https://github.com/kimistore/agent/.github/workflows/images.yml@.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Keyless means no key to distribute: Sigstore issues a short-lived certificate from the workflow's identity and records it in a public transparency log. Anyone can verify, and a stolen registry credential cannot mint a certificate that claims to be this workflow. A release image is bound to refs/tags/v1.0.0 rather than to a branch, so the signature says which tag produced it.

The image is multi-platform (linux/arm64 for the Pi nodes, linux/amd64 for x86 peers) and runs as uid 65532 to match this chart's podSecurityContext. It is distroless, so there is no shell in it.

ghcr.io/kimistore/agent-credential holds kimistore-credential, the SCRAM and ACL administration tool, published under the same tags. It is a separate image so that a running broker does not carry a binary that can rewrite its own ACLs.

Install

helm install kimistore oci://ghcr.io/loafoe/helm-charts/kimistore \
  --set objectStorage.bucket=kimistore \
  --set objectStorage.region=eu-central-1

Credentials come from the AWS SDK credential chain by default, so on EKS with IRSA there is no Secret to create:

helm install kimistore ... \
  --set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"=arn:aws:iam::123:role/kimistore

For MinIO or RustFS, point the endpoint at it:

helm install kimistore ... \
  --set objectStorage.endpoint=http://minio.minio.svc:9000 \
  --set objectStorage.accessKeyId=... \
  --set objectStorage.secretAccessKey=...

Things to know

This is a StatefulSet, not a Deployment. The agent's write-ahead log lives on local disk and is the only copy of a record between "producer was acked" and "segment uploaded to object storage". A Deployment that recreates a pod with a fresh emptyDir discards it. Setting persistence.enabled=false is only appropriate for a throwaway cluster.

Scaling the replicas up does not share the work by default. Partition claims are a race, and the first agent to start wins every one of them. With assignment.enabled=false a three-replica chart runs three agents with one doing all the work. Set assignment.enabled=true to have partitions assigned by rendezvous hash instead.

Enabling assignment on a running cluster is not a no-op. The incumbent drains the partitions it no longer wins and hands them over. Expect handovers in the logs (Assignment: released ...) rather than a silent no-op.

Writes cannot go through a load-balanced address. Clients bootstrap via the Service, then connect directly to the per-pod addresses that Metadata reports. Each pod advertises its own IP, so a client redirected to "the leader" reaches it. A shared ClusterIP would mean every broker entry is the same address, and a producer would land on an arbitrary pod and be refused with NOT_LEADER_OR_FOLLOWER.

Reads can go through the Service. Any agent serves a Fetch from object storage, so the Service is a genuine N-way read redundancy rather than only a bootstrap address.

Every agent needs a distinct id. The chart sets KIMISTORE_AGENT_ID from the pod name, which a StatefulSet keeps stable across restarts. Two agents sharing an id are refused rather than allowed to fight over a partition.

terminationGracePeriodSeconds must exceed 25 seconds. That is the agent's drain budget. Below it, eviction truncates a handover and leaves a partition with a half-uploaded segment. The default here is 60.

assignment and replicaCount: 1. Assignment needs a live set to hash over, so with one agent it is a no-op. The notes printed after install say so.

Multi-AZ

Producers must reach the partition leader, so two replicas in one zone give you neither the availability nor the cost profile you want. Spread across zones:

replicaCount: 3
assignment:
  enabled: true
topologySpreadConstraints:
  - maxSkew: 1
    topologyKey: topology.kubernetes.io/zone
    whenUnsatisfiable: ScheduleAnyway
    labelSelector:
      matchLabels:
        app.kubernetes.io/name: kimistore
        app.kubernetes.io/instance: kimistore

For a fully zonal deployment, run one release per zone with its own replica count. Each zone then scales independently, which is the pattern the diskless Kafka vendors recommend and the reason is traffic skew: one HPA over three zones reacts to the aggregate, not to the zone that is actually hot.

Probes

Two endpoints on the metrics port, and they are deliberately different:

  • /live -- "should this process be killed". Stays 200 through an ownership failure. A broker that lost its claims is still a working reader, and restarting it removes that reader while gaining nothing.
  • /ready -- "should clients be sent here". 503 when claims cannot be renewed or the cluster view is stale, with the reason in the body.
kubectl exec kimistore-0 -- wget -qO- http://127.0.0.1:9091/ready

The metrics listener binds all interfaces by default. If you bind it to loopback the probes stop working, so leave KIMISTORE_METRICS_ADDR as the default.

Write durability

acks is a client choice, and it is the single most important thing to get right:

acksPromiseSurvives losing the pod
0nonenot acknowledged at all
1fsynced to local diskno -- the WAL is gone with the node
allin object storageyes

Use acks=all with idempotent producers. That is the only posture that makes a node loss a non-event, and it is the only one worth it if the data cannot be replayed.

Continuous integration

This chart is linted but not install-tested by the repository's CI. The agent's /ready endpoint is deliberately honest: it returns 503 when it cannot renew partition claims or read a fresh cluster view, and in a CI cluster with no object store neither ever succeeds. The pods start, serve, and stay unready, so ct install waits out its timeout.

Making the probe optimistic to satisfy CI would defeat the reason it exists, so kimistore is listed in the NOT_INSTALLABLE set in .github/workflows/lint-test.yml alongside centcom. To install-test it against a real cluster, dispatch that workflow with chart: kimistore.

Metrics worth alerting on

MetricMeaning
kimistore_build_infoVersion, commit and build date of the running agent
kimistore_partitions_ownedPartitions this agent holds. Differs per pod by design.
kimistore_manifest_writes_rejected_totalNon-zero means two agents believed they owned one partition
kimistore_assignment_released_totalPartitions given up because the assignment moved them
kimistore_assignment_acquired_totalPartitions taken because the assignment gave them here
kimistore_durable_timeouts_totalacks=all writes that gave up waiting for object storage
kimistore_handover_kept_totalHandovers that kept their claim because the tail was not durable

A non-zero manifest_writes_rejected_total is the signal that the split-brai

Deploy kimistore with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kimistore 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 chartkimistore is pinned at v0.3.0 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