Every abstract base class a manifest can extend, grouped by area. For the concepts — lifecycle, naming, config, escape hatches — see Manifests; this page is the catalog.
The universal contract, inherited from Klass8s\Manifest\AbstractManifest by everything below:
| Member | Meaning |
|---|
public static function shortName(): string | required — the only method every manifest must implement |
public static function apiVersion(): string / kind(): string | implemented by each base (values listed per class; final where noted) |
public function metadata(MetadataConfigurator $meta): void {} | per-manifest labels/annotations |
$computedShortName, $computedFullName, $fileName | get-only virtual properties (resolved name, output file name) |
Configurator-receiving methods (data(), ports(), rules(), …) are void hooks with empty default bodies — override only what you need. Escape hatches (configure{Kind}()) run after all configurators; a few resource families have none (noted below). And remember: manifest classes must not be final — they are subclassed by runtime proxies.
Generic bases
Klass8s\Manifest\AbstractSelfMakingManifest
Any custom resource — guide. Renders exactly apiVersion + kind + metadata + spec.
| Group | Method |
|---|
| Required | spec(): array|\JsonSerializable, apiVersion(): string, kind(): string, shortName(): string |
Config and Secrets
Klass8s\Core\ConfigMap\AbstractConfigMap — ConfigMap, v1 (final)
| Group | Method (default) |
|---|
| Spec | data(StringMap $data), binaryData(StringMap $binaryData), keysPrefix(): string → '' |
| Escape hatch | configureConfigMap(K8Schema\Api\Core\V1\ConfigMap $configMap) |
Klass8s\Core\Secret\AbstractSecret — Secret, v1 (final)
| Group | Method (default) |
|---|
| Spec | data(StringMap $data) (pre-encoded), stringData(StringMap $stringData) (plaintext), keysPrefix(): string → '', type(): SecretType → Opaque |
| Escape hatch | configureSecret(K8Schema\Api\Core\V1\Secret $secret) |
SecretType: Opaque, ServiceAccountToken, DockerConfig, BasicAuth, SshAuth, TLS.
Three specialized secret bases pin type() and build data() for you (both are final there):
| Class | Required methods | Produces |
|---|
AbstractBasicAuthSecret | protected username(): string, protected password(): string | kubernetes.io/basic-auth |
AbstractDockerConfigSecret | protected auths(): iterable of DockerAuth(string $host, string $username, string $password, ?string $email = null) | .dockerconfigjson |
AbstractServiceAccountSecret | protected serviceAccountName(): string; overridable protected extraData(StringMap $data) | SA token secret with the kubernetes.io/service-account.name annotation (call parent::metadata() if you override metadata()) |
Workloads
All workload bases share this pod-level surface (identical defaults on Deployment, StatefulSet, Job; CronJob inherits via Job):
| Group | Method (default) |
|---|
| Containers | containers(): iterable — required; auto-satisfied by the AbstractContainer* variants (yield $this); initContainers(): iterable → [] |
| Scheduling | affinity(AffinityConfigurator), nodeSelector(StringMap), tolerations(TolerationsConfigurator), topologySpreadConstraints(TopologySpreadConstraintsConfigurator), priorityClass(PriorityClassConfigurator) |
| Identity | serviceAccount(): ?ManifestClassReference → null, serviceAccountName(): ?string → null (raw name wins if both set), imagePullSecrets(ImagePullSecretsConfigurator) |
| Pod | volumes(VolumesConfigurator), restartPolicy(): ?RestartPolicy → null (Always|OnFailure|Never), terminationGracePeriodSeconds(): ?int → null |
| Escape hatch | configurePodSpec(K8Schema\Api\Core\V1\PodSpec $spec) |
Klass8s\Core\Deployment\AbstractDeployment — Deployment, apps/v1 (final)
| Group | Method (default) |
|---|
| Spec | replicas(): int → 1, revisionHistoryLimit(): int → 1, selector(SelectorConfigurator), strategy(StrategyConfigurator), minReadySeconds(): ?int, progressDeadlineSeconds(): ?int |
| Escape hatch | configureDeployment(K8Schema\Api\Apps\V1\Deployment $deployment) |
Klass8s\Core\StatefulSet\AbstractStatefulSet — StatefulSet, apps/v1
| Group | Method (default) |
|---|
| Required | serviceName(): ManifestClassReference — the governing headless Service |
| Spec | replicas(): int → 1, revisionHistoryLimit(): int → 1, podManagementPolicy(): ?PodManagementPolicy → null (OrderedReady|Parallel), selector(SelectorConfigurator), updateStrategy(UpdateStrategyConfigurator), volumeClaimTemplates(): iterable → [] (of PersistentVolumeClaimInterface) |
| Escape hatch | configureStatefulSet(K8Schema\Api\Apps\V1\StatefulSet $statefulSet) |
Klass8s\Core\Job\AbstractJob — Job, batch/v1
| Group | Method (default) |
|---|
| Spec | backoffLimit(): ?int, activeDeadlineSeconds(): ?int, ttlSecondsAfterFinished(): ?int, completions(): ?int, parallelism(): ?int, manualSelector(): ?bool, suspend(): bool → false, selector(SelectorConfigurator) |
| Escape hatch | configureJob(K8Schema\Api\Batch\V1\Job $job) |
Klass8s\Core\CronJob\AbstractCronJob — CronJob, batch/v1 (final); extends AbstractJob
| Group | Method (default) |
|---|
| Required | schedule(): string |
| Spec | job(): JobInterface → $this, concurrencyPolicy(): ConcurrencyPolicy → Forbid (Allow|Forbid|Replace), timeZone(): ?string, startingDeadlineSeconds(): ?int, successfulJobsHistoryLimit(): ?int, failedJobsHistoryLimit(): ?int, suspendCronJob(): bool → $this->suspend() |
| Escape hatch | configureCronJob(K8Schema\Api\Batch\V1\CronJob $cronJob) (+ configureJob, configurePodSpec) |
The Container variants
AbstractContainerDeployment, AbstractContainerStatefulSet, AbstractContainerJob, AbstractContainerCronJob each extend their plain counterpart and implement ContainerInterface themselves — the manifest is its own single container (containers() yields $this). They add the full container API and one extra requirement: image(): Image.
Networking (core)
Klass8s\Core\Service\AbstractService — Service, v1 (final)
| Group | Method (default) |
|---|
| Spec | ports(ServicePortsConfigurator), selector(StringMap) (defaults wired by the framework), type(ServiceTypeConfigurator) (ClusterIP default), clusterIP(): ?string, trafficDistribution(): ?TrafficDistribution → PreferClose (PreferClose|PreferSameZone|PreferSameNode) |
| Escape hatch | configureService(K8Schema\Api\Core\V1\Service $service) |
Klass8s\Core\Ingress\AbstractIngress — Ingress (final), networking.k8s.io/v1
| Group | Method (default) |
|---|
| Required | rules(IngressRulesConfigurator $rules): void |
| Spec | defaultBackend(IngressBackendConfigurator), ingressClassName(): ?string |
| Escape hatch | configureIngress(K8Schema\Api\Networking\V1\Ingress $ingress) |
RBAC and identity
Full guide: RBAC & Service Accounts.
Klass8s\Core\ServiceAccount\AbstractServiceAccount — ServiceAccount, v1 (final)
| Group | Method (default) |
|---|
| Spec | automountServiceAccountToken(): ?bool → false (rendered explicitly; null omits the field), imagePullSecrets(ImagePullSecretsConfigurator) (the SA-level configurator — takes ManifestClassReferences), secrets(SecretsConfigurator) |
| Escape hatch | configureServiceAccount(K8Schema\Api\Core\V1\ServiceAccount $serviceAccount) |
Roles and bindings
All rbac.authorization.k8s.io/v1.
| Class | Required | Extras | Escape hatch |
|---|
Klass8s\Core\Rbac\AbstractRole | rules(PolicyRulesConfigurator) | — | configureRole(K8Schema\Api\Rbac\V1\Role) |
…\AbstractClusterRole | rules(PolicyRulesConfigurator) | aggregationRule(AggregationRuleConfigurator) | configureClusterRole(…\ClusterRole) |
…\AbstractRoleBinding | roleRef(RoleRefConfigurator), subjects(SubjectsConfigurator) | — | none |
…\AbstractClusterRoleBinding | roleRef(RoleRefConfigurator), subjects(SubjectsConfigurator) | — | none |
The binding makers validate at render time: a configured roleRef and ≥ 1 subject, or the render fails.
Storage and scheduling
Klass8s\Core\Persistence\AbstractPersistentVolumeClaim — renders PersistentVolumeClaim, v1
| Group | Method (default) |
|---|
| Required | accessModes(): iterable of AccessMode (ReadWriteOnce|ReadOnlyMany|ReadWriteMany) |
| Spec | resources(PvcResourcesConfigurator), storageClassName(): ?string, volumeMode(): VolumeMode → Filesystem (Filesystem|Block), volumeName(): ?string, dataSource(): ?ManifestClassReference, selector(SelectorConfigurator) |
| Escape hatch | none |
Klass8s\Core\Persistence\AbstractStorageClass — StorageClass (final), storage.k8s.io/v1
| Group | Method (default) |
|---|
| Required | provisioner(): string |
| Spec | parameters(StringMap), reclaimPolicy(): ReclaimPolicy → Delete (Delete|Retain), volumeBindingMode(): VolumeBindingMode → Immediate (Immediate|WaitForFirstConsumer), allowVolumeExpansion(): bool → false, mountOptions(): iterable of string → [], allowedTopologies(AllowedTopologiesConfigurator) |
| Metadata | isDefaultClass(): bool → false — true adds the storageclass.kubernetes.io/is-default-class: "true" annotation (the class every PVC without a storageClassName binds to) |
| Escape hatch | none |
Cluster-scoped: no namespace is rendered. Implement FullNameAwareInterface when the object must carry a conventional cluster-wide name (gp3, standard) instead of the {app}-{short name} form.
Cloud batteries — ready-to-use classes for the storage a managed Kubernetes product expects, shipped under Klass8s\Cloud\{provider}\; subclass one into the app that should own the object (manifest discovery is per app namespace) and override nothing:
| Class | Renders |
|---|
Klass8s\Cloud\Aws\EksAutoMode\Gp3StorageClass | gp3 — the default class EKS Auto Mode does not create: provisioner ebs.csi.eks.amazonaws.com, type=gp3 + encrypted=true, WaitForFirstConsumer, expandable, pinned to Auto Mode nodes (eks.amazonaws.com/compute-type in [auto]), marked default |
Klass8s\Core\PriorityClass\AbstractPriorityClass — PriorityClass (final), scheduling.k8s.io/v1
| Group | Method (default) |
|---|
| Required | value(): int |
| Spec | description(): ?string, globalDefault(): bool → false, preemptionPolicy(): ?PreemptionPolicy → null (Never|PreemptLowerPriority) |
| Escape hatch | none |
Autoscaling
Klass8s\Core\Autoscaling\AbstractHorizontalPodAutoscaler — HorizontalPodAutoscaler, autoscaling/v2
| Group | Method (default) |
|---|
| Required | maxReplicas(): int, metrics(MetricsConfigurator), scaleTargetRef(): VersionedManifestClassReference|CrossVersionObjectReference |
| Spec | minReplicas(): int → 1, behavior(BehaviorConfigurator) |
| Escape hatch | configureHorizontalPodAutoscaler(K8Schema\Api\Autoscaling\V2\HorizontalPodAutoscaler $hpa) |
KEDA
All keda.sh/v1alpha1.
Klass8s\Autoscaling\Keda\Manifest\ScaledObject\AbstractScaledObject — ScaledObject
| Group | Method (default) |
|---|
| Required | scaleTargetRef(): ScaleTargetReference|WorkloadContainerReference |
| Scaling | minReplicaCount(): int → 0, maxReplicaCount(): int → 100, idleReplicaCount(): ?int, pollingInterval(): int → 30, cooldownPeriod(): int → 300, restoreToOriginalReplicaCount(): ?bool, fallback(): ?Fallback, hpaName(): ?string, behavior(BehaviorConfigurator) (the HPA behavior configurator) |
| Triggers | triggers(TriggerBuildersRegistry $builders): iterable → [] — yield trigger builders |
| Escape hatch | configureScaledObject(Klass8s\Autoscaling\Keda\API\ScaledObject\ScaledObject $scaledObject) |
The common case — one scaler per workload — needs no ScaledObject class at all: put #[Autoscale] plus trigger attributes on the workload manifest and the build spawns an AutoscaleScaledObject for it (see Autoscaling).
…\ScaledJob\AbstractScaledJob — ScaledJob
Constructor-injected target: __construct(private readonly JobSpec $jobTargetRef) (K8Schema\Api\Batch\V1\JobSpec); jobTargetRef(): JobSpec overridable.
| Group | Method (default) |
|---|
| Scaling | minReplicaCount(): int → 0, maxReplicaCount(): int → 100, pollingInterval(): int → 30, successfulJobsHistoryLimit(): int → 5, failedJobsHistoryLimit(): int → 5, envSourceContainerName(): ?string |
| Strategy | rollout(RolloutConfigurator), scalingStrategy(ScalingStrategyConfigurator), triggers(TriggerBuildersRegistry): iterable → [] |
| Escape hatch | configureScaledJob(Klass8s\Autoscaling\Keda\API\ScaledJob\ScaledJob $scaledJob) |
Monitoring
The Prometheus Operator's kinds, all monitoring.coreos.com/v1.
ArrayObject-assembled (no k8schema classes) — no escape hatches in this family.
Klass8s\Monitoring\Prometheus\AbstractMonitor (shared base, no kind)
| Group | Method (default) |
|---|
| Required | selector(SelectorConfigurator $selector): void |
| Spec | jobLabel(): ?string, namespaceSelector(NamespaceSelectorConfigurator), podTargetLabels(StringList), sampleLimit(): ?int |
| Class | Kind | Adds |
|---|
…\PodMonitor\AbstractPodMonitor | PodMonitor | required podMetricsEndpoints(EndpointsConfigurator) |
…\ServiceMonitor\AbstractServiceMonitor | ServiceMonitor | required endpoints(EndpointsConfigurator); overridable targetLabels(StringList) |
…\AbstractPrometheusRule | PrometheusRule | required groups(RuleGroupsConfigurator) |
Gateway API
All gateway.networking.k8s.io/v1.
Guide: Networking. ArrayObject-assembled — no configure{Kind}() escape hatches in this family. Kind is final in each class.
Class (Klass8s\GatewayApi\…) | Kind | Required | Spec hooks |
|---|
Gateway\AbstractGateway | Gateway | gatewayClass(): string|ManifestClassReference | listeners(ListenersConfigurator), addresses(AddressesConfigurator), infrastructure(InfrastructureConfigurator) |
GatewayClass\AbstractGatewayClass | GatewayClass | controllerName(): string | description(): ?string, parametersRef(): ?ParametersRef |
HTTPRoute\AbstractHTTPRoute | HTTPRoute | — | parentRefs(ParentRefsConfigurator), hostnames(StringList), rules(HTTPRouteRulesConfigurator) |
GRPCRoute\AbstractGRPCRoute | GRPCRoute | — | parentRefs(ParentRefsConfigurator), hostnames(StringList), rules(GRPCRouteRulesConfigurator) |
BackendTLSPolicy\AbstractBackendTLSPolicy | BackendTLSPolicy | — | targetRefs(TargetRefsConfigurator), validation(TLSValidationConfigurator), options(OptionsConfigurator) |
ReferenceGrant\AbstractReferenceGrant | ReferenceGrant | — | from(ReferenceGrantFromConfigurator), to(ReferenceGrantToConfigurator) |
Custom resource definitions
Klass8s\Core\Crd\AbstractCustomResourceDefinition — CustomResourceDefinition (final), apiextensions.k8s.io/v1
Guide: Custom Resources. Implements FullNameAwareInterface: the resource name is fullName() (default {plural}.{group}), not app-prefixed; shortName() is still required for framework identity.
| Group | Method (default) |
|---|
| Required | group(): string, resourceKind(): string, plural(): string, shortName(): string |
| Identity | fullName(): string → plural().'.'.group() |
| Spec | scope(): CrdScope → Namespaced (Namespaced|Cluster), names(CrdNamesConfigurator), versions(CrdVersionsConfigurator), preserveUnknownFields(): ?bool |
| Escape hatch | configureCrd(K8Schema\ApiextensionsApiserver\Pkg\Apis\Apiextensions\V1\CustomResourceDefinition $crd) |
The container API
Klass8s\Core\Container\AbstractContainer is the base for standalone sidecar/init containers (guide) — not a manifest (no kind, no shortName()), constructed by you, not the container DI. The same surface (via ContainerTrait) is what the four AbstractContainer* workload variants add to their manifests:
| Group | Method (default) |
|---|
| Required | image(): Image |
| Identity | containerName(): string → 'app' |
| Spec | command(StringList), args(StringList), env(EnvConfigurator), ports(PortsConfigurator), resources(ContainerResourcesInterface), probes(ProbesConfigurator), lifecycle(LifecycleConfigurator), securityContext(SecurityContextConfigurator), volumeMounts(VolumeMountsConfigurator), imagePullPolicy(): ImagePullPolicy → IfNotPresent (Always|Never|IfNotPresent), workingDir(): ?string |
| Escape hatch | configureContainer(K8Schema\Api\Core\V1\Container $container) |
Classes implementing ContainerInterface themselves: AbstractContainer, AbstractContainerDeployment, AbstractContainerStatefulSet, AbstractContainerJob, AbstractContainerCronJob.
Next
- Configurators — the full API of every builder the methods above receive
- Manifests — lifecycle, naming, and how to choose a base class