krci-substrate

by sergk

Helm chartv0.6.0-SNAPSHOT.1App 0.6.0-SNAPSHOT.1Apache-2.0Verified publisher

A Helm chart for upstream Agent Substrate, matching the upstream ate-setup install

About this chart

krci-substrate

A Helm chart for upstream Agent Substrate, matching the upstream ate-setup install

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

Introduction

The chart installs objects of Agent Substrate release v1.0.1. The chart version and appVersion are the chart release. Each chart object copied from upstream equals its reference install object: what upstream ate-setup deploy ate-system applies for that release, with the envoy dataplane on a non-kind cluster. Exceptions: Deviations from the reference install.

Objects copied from the upstream manifests of the release tag:

Chart pathUpstream path
crds/ate.dev_*.yamlmanifests/ate-install/generated/ate.dev_*.yaml, byte for byte
templates/namespaces.yamlmanifests/ate-install/ate-system-namespace.yaml, the Namespace of manifests/ate-install/pod-certificate-controller.yaml
templates/podcertificate-controller/serviceaccount.yamlthe ServiceAccount of manifests/ate-install/pod-certificate-controller.yaml
templates/podcertificate-controller/rbac.yamlthe ClusterRole, ClusterRoleBinding, Role and RoleBinding of manifests/ate-install/pod-certificate-controller.yaml
templates/podcertificate-controller/deployment.yamlthe Deployment of manifests/ate-install/pod-certificate-controller.yaml; image podcertificateController.image (<repository>:<tag>@<digest>) and --preview=, as the reference install has them
templates/postgres/ConfigMap postgres-config, Service and StatefulSet of manifests/ate-install/postgres/postgres.yaml
templates/ate-api-server/ClusterRole, ServiceAccount, ClusterRoleBinding, Deployment, PodDisruptionBudget and Service api of manifests/ate-install/ate-api-server.yaml
templates/ate-idp-server/ServiceAccount, Deployment, PodDisruptionBudget and Service idp of manifests/ate-install/ate-idp-server.yaml
templates/ate-controller/ServiceAccounts ate-client, ate-controller, the bindings, Service and Deployment of manifests/ate-install/ate-controller.yaml; ClusterRole and Role of manifests/ate-install/generated/role.yaml
templates/networkpolicies.yamlmanifests/ate-install/ate-system-networkpolicies.yaml
templates/ate-otel-config.yamlmanifests/ate-install/ate-otel-config.yaml
templates/sandboxconfig/gvisor.yamlmanifests/ate-install/sandboxconfig-gvisor.yaml
templates/sandboxconfig/validation.yamlmanifests/ate-install/sandboxconfig-validation.yaml
templates/atelet/ServiceAccount, ClusterRole, ClusterRoleBinding, Role, RoleBinding, ResourceQuota and DaemonSet of manifests/ate-install/atelet.yaml
templates/atenet-router/ServiceAccount, Role, RoleBinding, ConfigMap, Deployment and Service of manifests/ate-install/atenet-router.yaml
templates/atenet-egress/ServiceAccount, ConfigMap, Deployment and Service of manifests/ate-install/atenet-egress.yaml
templates/k8s-credential-provider/manifests/egress-credential-injection/k8s-credential-provider.yaml, manifests/egress-credential-injection/namespace-policy.yaml
files/postgres/setup.sqlpkg/postgressetup/setup.sql, byte for byte
files/atenet-egress/envoy.yamlkey envoy.yaml of ConfigMap atenet-egress in manifests/ate-install/atenet-egress.yaml, byte for byte

Reference install changes in every substrate workload: image <service>.image (<repository>:<tag>@<digest>), --preview= appended. ate-api-server: --authz-bootstrap-owners appended, pod template annotation ate.dev/env-hash. ate-idp-server: --issuer=https://idp.ate-system.svc appended.

Reference install settings of the dataplane: envoy (--atenet-dataplane=envoy), image envoy-dataplane in place of ${ENVOY_DATAPLANE_IMAGE}. Credential provider {"name":"k8s.io"}: k8s-credential-provider deployed; on the atenet-egress ext-proc container, the --credential-provider-* flags in place of the #ATE_EGRESS_INJECT_FLAGS marker, server name k8s-credential-provider.ate-system.svc. atenet-router: --ingress-allowed-spiffe-ids appended when router.ingressAllowedSpiffeIds is not empty. Sandbox classes: gvisor only (--sandbox-classes=gvisor).

Upstream objects not in the chart:

  • manifests/ate-install/atenet-router-monitoring.yaml: PodMonitoring atenet-router-envoy, GKE Managed Prometheus only.
  • manifests/egress-credential-injection/sample-secret.yaml: example; ate-setup does not apply it.
  • manifests/ate-install/sandboxconfig-microvm.yaml.tmpl: microvm sandbox class; needs /dev/kvm and staged guest assets.

Install order

Argo CD sync waves, annotation argocd.argoproj.io/sync-wave on every chart object (templates/_helpers.tpl, krci-substrate.syncWave). Argo CD applies a wave after the objects of the earlier waves are healthy.

WaveObjects
0CRDs (crds/, no annotation), Namespaces, ConfigMap ate-otel-config, NetworkPolicies, ValidatingAdmissionPolicy sandboxconfig-assets
1PKI (templates/pki/), podcertificate-controller, SandboxConfig gvisor-default
2PostgreSQL, atelet
3ate-api-server, ate-idp-server, ate-controller, k8s-credential-provider, atenet-router, atenet-egress

atelet rolls out before ate-api-server on every sync. Helm without Argo CD ignores the waves.

Chart objects without an upstream manifest:

  • templates/pki/: the cert-manager and ESO objects of the pool Secrets. The pool list: templates/pki/_pools.tpl.
  • templates/ate-api-server/config.yaml: the objects ate-setup writes for ate-api-server, bundled PostgreSQL: ConfigMaps ate-api-server-envvars, ate-api-config, ate-api-authentication, Secret ate-api-server-secret-envvars.
  • templates/postgres/configmap.yaml, ConfigMap postgres-setup: the setup SQL run of ate-setup.

Deviations from the reference install

ObjectReference installChartReason
ate-api-server, sidecar objectstore-pluginGCS (ATE_STORAGE_BACKEND=gcs, ambient Google credentials)S3: ATE_STORAGE_BACKEND=s3, AWS_REGION, optional AWS_ENDPOINT_URL, AWS_S3_USE_PATH_STYLE; AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY only from snapshots.s3.credentialsSecretTarget clusters are EKS and kind. Production: no Secret; AWS SDK default chain with EKS Pod Identity or IRSA. The Secret is for the kind test bed or an S3-compatible store with no workload identity.
ServiceAccount ate-api-serverno annotationsapiServer.serviceAccount.annotationsIRSA needs eks.amazonaws.com/role-arn on the ServiceAccount. Default: no annotations.
ConfigMap ate-api-server-envvarsATE_API_SNAPSHOT_LOCATION from --snapshot-locations3://<snapshots.s3.bucket>/<snapshots.s3.prefix>/; empty prefix: s3://<snapshots.s3.bucket>/S3 bucket. The S3 backend reads the bucket from the URI host. The prefix scopes the IAM policies to one cluster.
ConfigMap ate-api-authenticationissuer from GKE coordinates or cluster OIDC discoveryapiServer.serviceAccountIssuerA chart cannot query the cluster. EKS: the cluster OIDC issuer URL.
ConfigMap ate-otel-configOTEL_EXPORTER_OTLP_ENDPOINT of the GKE managed collectorno endpoint; OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER, ATE_WORKER_OTEL_TRACES_EXPORTER, ATE_WORKER_OTEL_METRICS_EXPORTER: noneNo collector on the target clusters yet. Logs stay on stdout.
StatefulSet postgresate-setup runs the setup SQL with kubectl exec after each rolloutthe image entrypoint runs it from /docker-entrypoint-initdb.d, on an empty data directory onlyNo exec under GitOps. An existing volume keeps its roles and schema.
StatefulSet postgres, postStart hookwaits for the Unix socket, then creates atepg when absentwaits for TCP 127.0.0.1:5432 firstThe init server of the image is socket-only. A hook during init races the entrypoint CREATE DATABASE; a failed hook kills the container before the setup SQL runs, and the restart skips it.
StatefulSet postgresbase size: resources and 500Gi claim; StorageClass from --postgres-storage-classpostgres.resources, postgres.storageDefault is the base size. Kind: the upstream kind overlay values.
Every chart objectno Argo CD annotationsargocd.argoproj.io/sync-waveInstall order under Argo CD: Install order.
DaemonSet atelet, sidecar objectstore-pluginGCS (ATE_STORAGE_BACKEND=gcs, ambient Google credentials)S3, same environment as the ate-api-server sidecarSame as ate-api-server.
ServiceAccount ateletno annotationsatelet.serviceAccount.annotationsIRSA, same as ate-api-server.
DaemonSet atelet, image credential providerGKE host paths /home/kubernetes/bin, /etc/srv/kubernetes/cri_auth_config.yamlatelet.imageCredentialProvider: host paths; enabled: false drops the two flags and mounts, as the upstream kind overlay doesHost paths differ per node distribution (EKS: /etc/eks/image-credential-provider). Default: the GKE paths.
Deployments atenet-router, atenet-egress, pod templateatenet-router: annotations prometheus.io/scrape, prometheus.io/port; atenet-egress: no annotations. ate-setup restarts atenet-egress after each deploy with a credential providerannotation checksum/config added, the sha256 of the rendered ConfigMapEnvoy reads its configuration at start only. A ConfigMap change rolls the Deployment.
Deployments atenet-router, atenet-egressreplicas: 1router.replicas, egress.replicasDefault: 1.
ConfigMap k8s-credential-provider-namespace-policyapplied only when absent, policies: []; the operator edits it in the clusterpolicies from credentialProvider.namespacePolicies; the chart owns the ConfigMapGitOps: the policy lives in values. Default: [], same render.
Deployment k8s-credential-provider, pod templateno annotationsannotation checksum/namespace-policyThe provider reads the policy at start only. A policy change rolls the Deployment.
Deployment atenet-egress, egress.upstreamCA setupstream TLS trusts the image system roots /etc/ssl/certs/ca-certificates.crtConfigMap atenet-egress-upstream-ca; init container upstream-ca-bundle (envoy image) writes system roots plus egress.upstreamCA to an emptyDir; clusters egress_forward_proxy and egress_forward_proxy_grpc trust that fileOrigins behind a private CA. Default: empty, same render as the reference install.

S3 access

Every pod with an objectstore-plugin sidecar reads and writes the snapshot bucket with its own credentials. ate-api-server does not pass credentials to other pods.

PodSidecar modeS3 useServiceAccount
ate-api-servercontrolcopies snapshots for tags; deletes snapshots nothing refers toate-system/ate-api-server
ateletnodeuploads and downloads snapshot files; reads sandbox assetsate-system/atelet
  • Give S3 access to both ServiceAccounts: one EKS Pod Identity association each, or the IRSA annotation eks.amazonaws.com/role-arn in <service>.serviceAccount.annotations. IAM roles, policies and associations: EKS.
  • Objects: <snapshots.s3.prefix>/atespaces/...; empty prefix: atespaces/....
  • snapshots.s3 is the shared S3 environment of both sidecars, snapshots.s3.credentialsSecret included.
  • No other pod uses object storage: ate-idp-server, ate-controller, atenet, worker pods.

Values

One top-level key per service. A value exists only for a setting that changes often or that a known requirement needs. All other fields are fixed in the templates, as the reference install has them.

KeyServiceValues
podcertificateControllerpodcertificate-controllerimage, replicas
postgresbundled PostgreSQL (one replica)image, resources, storage
apiServerate-api-server, sidecar objectstorePluginimage, replicas, serviceAccountIssuer, bootstrapOwners, serviceAccount.annotations, objectstorePlugin.image
idpServerate-idp-serverimage, replicas
controllerate-controllerimage, replicas
ateletatelet, sidecar objectstorePluginimage, serviceAccount.annotations, objectstorePlugin.image, imageCredentialProvider
routeratenet-router, container envoyimage, envoy.image, replicas, ingressAllowedSpiffeIds
egressatenet-egress, containers sdsmint, ext-proc, envoyimage, envoy.image, replicas, upstreamCA
credentialProviderk8s-credential-providerimage, namespacePolicies

Shared keys: snapshots.s3 (every objectstore-plugin sidecar), pki (pool Secrets).

Defaults are the reference install.

Control plane

  • PostgreSQL logins: substrate_owner_user and substrate_readwrite_user, client certificates from signer postgres.podcert.ate.dev/identity (pg_hba.conf cert). No role has a password.

  • The setup SQL runs at database init only (ADR-0002). If the first init fails, the data directory stays without roles or schema, and ate-api-server cannot log in. Recovery: run the setup again; it is idempotent and keeps data:

    kubectl -n ate-system exec postgres-0 -c postgres -- sh /docker-entrypoint-initdb.d/substrate-setup.sh
    
  • ate-api-server reaches the database at postgres.ate-system.svc:5432, sslmode=verify-full.

  • kubectl ate port-forwards to Service

Deploy krci-substrate with OpenTenant

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