<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>API Reference :: Go Kure</title><link>https://www.gokure.dev/kure/dev/api-reference/index.html</link><description>API Reference Kure’s public API is organized into focused packages. Each package README below is auto-synced from the source code.
For full Go API documentation, see pkg.go.dev/github.com/go-kure/kure .
Core Domain Package Description Reference Stack Cluster, Node, Bundle, Application domain model pkg.go.dev Flux Engine FluxCD workflow implementation pkg.go.dev Generators Application generator system (GVK) pkg.go.dev Layout Engine Manifest directory organization pkg.go.dev Resource Operations Package Description Reference IO YAML/JSON serialization and resource printing pkg.go.dev Kubernetes Builders Core K8s resource constructors (GVK, HPA, PDB) pkg.go.dev FluxCD Builders Low-level Flux resource constructors pkg.go.dev Prometheus Builders Prometheus Operator CRD constructors (ServiceMonitor, PodMonitor, PrometheusRule) pkg.go.dev Utilities Package Description Reference Errors Structured error types pkg.go.dev CLI Utilities Factory, IOStreams, Printer pkg.go.dev Logger Structured logging pkg.go.dev Compatibility Compatibility Matrix - Supported Kubernetes and dependency versions ArgoCD ArgoCD support exists at pkg/stack/argocd/ but is not yet production-ready. It is not featured in guides or examples. The Flux workflow is the primary supported GitOps integration.</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://www.gokure.dev/kure/dev/api-reference/index.xml" rel="self" type="application/rss+xml"/><item><title>Stack</title><link>https://www.gokure.dev/kure/dev/api-reference/stack/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/stack/index.html</guid><description>Stack - Core Domain Model The stack package defines the hierarchical domain model at the heart of Kure. It provides the Cluster, Node, Bundle, and Application abstractions used to describe a complete Kubernetes deployment topology.
Overview Kure models Kubernetes infrastructure as a four-level hierarchy:
Cluster └── Node (tree structure) └── Bundle (deployment unit) └── Application (workload) Each level maps to a concept in GitOps deployment:</description></item><item><title>Flux Engine</title><link>https://www.gokure.dev/kure/dev/api-reference/flux-engine/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/flux-engine/index.html</guid><description>Flux Engine - FluxCD Workflow Implementation The fluxcd package implements the stack.Workflow interface for FluxCD, providing complete Flux resource generation from domain model definitions.
Overview The Flux engine transforms Kure’s hierarchical domain model (Cluster, Node, Bundle, Application) into FluxCD resources (Kustomizations, source references) organized in a GitOps-ready directory structure.
The engine is composed of three specialized components:
Component Responsibility ResourceGenerator Generates Flux resources from domain objects LayoutIntegrator Integrates resources into directory structures BootstrapGenerator Creates Flux bootstrap manifests Quick Start import "github.com/go-kure/kure/pkg/stack/fluxcd" // Create engine with defaults engine := fluxcd.Engine() // Generate all Flux resources for a cluster objects, err := engine.GenerateFromCluster(cluster) // Or with custom configuration engine = fluxcd.EngineWithConfig( layout.KustomizationExplicit, layout.FluxSeparate, ) Engine Construction // Default engine engine := fluxcd.Engine() // Engine with specific kustomization mode engine := fluxcd.EngineWithMode(layout.KustomizationExplicit) // Engine with full configuration engine := fluxcd.EngineWithConfig(mode, placement) // Engine with custom components engine := fluxcd.NewWorkflowEngine() Resource Generation Generate Flux resources at different hierarchy levels:</description></item><item><title>Generators</title><link>https://www.gokure.dev/kure/dev/api-reference/generators/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/generators/index.html</guid><description>Generators - Application Generator System The generators package provides a type-safe system for creating Kubernetes application workloads from configuration. Generators implement the stack.ApplicationConfig interface, allowing them to be used as applications within the domain model.
Overview Generators use the GroupVersionKind (GVK) type system to identify and instantiate application configurations. Each generator is registered in the stack package’s global registry and can be referenced by its GVK identifier.</description></item><item><title>Layout Engine</title><link>https://www.gokure.dev/kure/dev/api-reference/layout/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/layout/index.html</guid><description>Layout Module The layout module is a sophisticated system for organizing and writing Kubernetes manifests to disk in directory structures that work with GitOps tools like Flux and ArgoCD.
Core Purpose The layout module transforms Kure’s in-memory stack representation (Clusters → Nodes → Bundles → Applications) into organized directory structures with proper kustomization.yaml files that GitOps tools can consume.</description></item><item><title>IO</title><link>https://www.gokure.dev/kure/dev/api-reference/io/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/io/index.html</guid><description>IO - YAML Serialization and Resource Printing The io package provides utilities for parsing, serializing, and printing Kubernetes resources. It supports multiple output formats including YAML, JSON, and kubectl-compatible table views.
Overview This package handles the I/O boundary of Kure: reading Kubernetes manifests from files, serializing resources to YAML/JSON, and printing resources in human-readable formats. It integrates with Kure’s registered scheme for type-aware parsing.</description></item><item><title>Errors</title><link>https://www.gokure.dev/kure/dev/api-reference/errors/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/errors/index.html</guid><description>Errors - Structured Error Handling The errors package provides structured error types with contextual information for Kubernetes resource operations. All Kure packages use this instead of fmt.Errorf.
Overview Errors in Kure carry context: the type of error, what resource was affected, suggestions for fixing the problem, and the original cause. This makes debugging easier and enables programmatic error handling.</description></item><item><title>CLI Utilities</title><link>https://www.gokure.dev/kure/dev/api-reference/cli/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/cli/index.html</guid><description>CLI - Command-Line Interface Utilities The cli package provides foundational components for Kure’s CLI tools (kure and kurel). It implements the Factory pattern for dependency injection, I/O stream abstraction, and output formatting.
Overview This package is used internally by the pkg/cmd/ packages to build CLI commands. It provides a clean separation between command logic and I/O handling.
Key Components Factory Dependency injection container for CLI commands. Provides access to global options, I/O streams, and configuration.</description></item><item><title>Kubernetes Builders</title><link>https://www.gokure.dev/kure/dev/api-reference/kubernetes-builders/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/kubernetes-builders/index.html</guid><description>Kubernetes Builders - Core Resource Helpers The kubernetes package provides GVK utilities, scheme registration, and strongly-typed builder functions for core Kubernetes resources.
Overview This package exposes helpers that other Kure packages (and external consumers such as Crane) use to construct and inspect Kubernetes objects without dealing with low-level struct details.
Import import "github.com/go-kure/kure/pkg/kubernetes" GVK Utilities // Resolve the GVK of any registered runtime.Object gvk, err := kubernetes.GetGroupVersionKind(myDeployment) // Check if a GVK is in an allow list ok := kubernetes.IsGVKAllowed(gvk, allowedGVKs) Scheme Registration // Lazily registers all supported API groups (core K8s, FluxCD, cert-manager, etc.) err := kubernetes.RegisterSchemes() HPA Builders // Create a HorizontalPodAutoscaler hpa := kubernetes.CreateHorizontalPodAutoscaler("my-app", "default") // Set the scale target err := kubernetes.SetHPAScaleTargetRef(hpa, "apps/v1", "Deployment", "my-app") // Set replica bounds err = kubernetes.SetHPAMinMaxReplicas(hpa, 2, 10) // Add CPU and memory metrics err = kubernetes.AddHPACPUMetric(hpa, 80) err = kubernetes.AddHPAMemoryMetric(hpa, 70) // Set scaling behavior window := int32(300) err = kubernetes.SetHPABehavior(hpa, &amp;autoscalingv2.HorizontalPodAutoscalerBehavior{ ScaleDown: &amp;autoscalingv2.HPAScalingRules{ StabilizationWindowSeconds: &amp;window, }, }) // Update metadata err = kubernetes.SetHPALabels(hpa, map[string]string{"env": "prod"}) err = kubernetes.SetHPAAnnotations(hpa, map[string]string{"owner": "platform"}) PDB Builders // Create a PodDisruptionBudget pdb := kubernetes.CreatePodDisruptionBudget("my-app", "default") // Set disruption budget (MinAvailable and MaxUnavailable are mutually exclusive) err := kubernetes.SetPDBMinAvailable(pdb, intstr.FromInt32(2)) // or: err = kubernetes.SetPDBMaxUnavailable(pdb, intstr.FromString("25%")) // Set the label selector err = kubernetes.SetPDBSelector(pdb, &amp;metav1.LabelSelector{ MatchLabels: map[string]string{"app": "my-app"}, }) // Update metadata err = kubernetes.SetPDBLabels(pdb, map[string]string{"env": "prod"}) err = kubernetes.SetPDBAnnotations(pdb, map[string]string{"owner": "platform"}) Deployment Builders // Create a Deployment dep := kubernetes.CreateDeployment("my-app", "default") // Add a container container := &amp;corev1.Container{Name: "app", Image: "nginx:1.25"} err := kubernetes.AddDeploymentContainer(dep, container) // Set replicas and strategy err = kubernetes.SetDeploymentReplicas(dep, 3) err = kubernetes.SetDeploymentStrategy(dep, appsv1.DeploymentStrategy{ Type: appsv1.RollingUpdateDeploymentStrategyType, }) // Configure pod template err = kubernetes.SetDeploymentServiceAccountName(dep, "my-sa") err = kubernetes.SetDeploymentNodeSelector(dep, map[string]string{"role": "web"}) err = kubernetes.AddDeploymentToleration(dep, &amp;corev1.Toleration{Key: "dedicated", Value: "web"}) CronJob Builders // Create a CronJob cj := kubernetes.CreateCronJob("my-job", "default", "*/5 * * * *") // Add a container container := &amp;corev1.Container{Name: "worker", Image: "busybox:1.36"} err := kubernetes.AddCronJobContainer(cj, container) // Configure schedule and policies err = kubernetes.SetCronJobConcurrencyPolicy(cj, batchv1.ForbidConcurrent) err = kubernetes.SetCronJobSuccessfulJobsHistoryLimit(cj, 3) err = kubernetes.SetCronJobFailedJobsHistoryLimit(cj, 1) // Configure pod template err = kubernetes.SetCronJobServiceAccountName(cj, "my-sa") err = kubernetes.SetCronJobNodeSelector(cj, map[string]string{"role": "batch"}) err = kubernetes.AddCronJobToleration(cj, &amp;corev1.Toleration{Key: "dedicated", Value: "batch"}) Service Builders // Create a Service svc := kubernetes.CreateService("my-app", "default") // Configure the service err := kubernetes.SetServiceSelector(svc, map[string]string{"app": "my-app"}) err = kubernetes.AddServicePort(svc, corev1.ServicePort{ Name: "http", Port: 80, TargetPort: intstr.FromInt32(8080), }) err = kubernetes.SetServiceType(svc, corev1.ServiceTypeLoadBalancer) // Update metadata err = kubernetes.AddServiceLabel(svc, "env", "prod") err = kubernetes.AddServiceAnnotation(svc, "external-dns.alpha.kubernetes.io/hostname", "app.example.com") Ingress Builders // Create an Ingress ing := kubernetes.CreateIngress("my-app", "default", "nginx") // Build a rule with paths rule := kubernetes.CreateIngressRule("app.example.com") pt := netv1.PathTypePrefix path := kubernetes.CreateIngressPath("/", &amp;pt, "my-app", "http") kubernetes.AddIngressRulePath(rule, path) err := kubernetes.AddIngressRule(ing, rule) // Add TLS err = kubernetes.AddIngressTLS(ing, netv1.IngressTLS{ Hosts: []string{"app.example.com"}, SecretName: "my-app-tls", }) NetworkPolicy Builders // Create a NetworkPolicy np := kubernetes.CreateNetworkPolicy("my-app", "default") // Set pod selector and policy types err := kubernetes.SetNetworkPolicyPodSelector(np, metav1.LabelSelector{ MatchLabels: map[string]string{"app": "my-app"}, }) err = kubernetes.AddNetworkPolicyPolicyType(np, netv1.PolicyTypeIngress) err = kubernetes.AddNetworkPolicyPolicyType(np, netv1.PolicyTypeEgress) // Build an ingress rule with peers and ports ingressRule := netv1.NetworkPolicyIngressRule{} kubernetes.AddNetworkPolicyIngressPeer(&amp;ingressRule, netv1.NetworkPolicyPeer{ PodSelector: &amp;metav1.LabelSelector{MatchLabels: map[string]string{"app": "frontend"}}, }) kubernetes.AddNetworkPolicyIngressPort(&amp;ingressRule, netv1.NetworkPolicyPort{}) err = kubernetes.AddNetworkPolicyIngressRule(np, ingressRule) HTTPRoute Builders // Create an HTTPRoute route := kubernetes.CreateHTTPRoute("my-app", "default") // Add parent gateway reference and hostname err := kubernetes.AddHTTPRouteParentRef(route, gwapiv1.ParentReference{Name: "my-gateway"}) err = kubernetes.AddHTTPRouteHostname(route, "app.example.com") // Build a rule with match, filter, and backend ref rule := gwapiv1.HTTPRouteRule{} pathType := gwapiv1.PathMatchPathPrefix kubernetes.AddHTTPRouteRuleMatch(&amp;rule, gwapiv1.HTTPRouteMatch{ Path: &amp;gwapiv1.HTTPPathMatch{Type: &amp;pathType, Value: ptrStr("/api")}, }) kubernetes.AddHTTPRouteRuleFilter(&amp;rule, gwapiv1.HTTPRouteFilter{ Type: gwapiv1.HTTPRouteFilterRequestHeaderModifier, RequestHeaderModifier: &amp;gwapiv1.HTTPHeaderFilter{ Set: []gwapiv1.HTTPHeader{{Name: "X-Custom", Value: "val"}}, }, }) kubernetes.AddHTTPRouteRuleBackendRef(&amp;rule, gwapiv1.HTTPBackendRef{ BackendRef: gwapiv1.BackendRef{ BackendObjectReference: gwapiv1.BackendObjectReference{Name: "my-svc"}, }, }) err = kubernetes.AddHTTPRouteRule(route, rule) PSA Security Context Helpers Helpers for Pod Security Admission (PSA) compliance at Restricted, Baseline, and Privileged levels.</description></item><item><title>FluxCD Builders</title><link>https://www.gokure.dev/kure/dev/api-reference/fluxcd-builders/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/fluxcd-builders/index.html</guid><description>FluxCD Builders - Flux Resource Constructors The fluxcd package provides strongly-typed constructor functions for creating FluxCD Kubernetes resources. These are the low-level building blocks used by Kure’s higher-level stack and workflow packages.
Overview Each function takes a configuration struct and returns a fully initialized Flux custom resource. The builders handle API version and kind metadata, letting you focus on the resource specification.</description></item><item><title>Prometheus Builders</title><link>https://www.gokure.dev/kure/dev/api-reference/prometheus-builders/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/prometheus-builders/index.html</guid><description>Prometheus Builders - Prometheus Operator CRD Constructors The prometheus package provides strongly-typed constructor functions for creating Prometheus Operator Kubernetes resources. These are the low-level building blocks used by Kure’s higher-level stack and workflow packages.
Overview Each function takes a configuration struct and returns a fully initialized Prometheus Operator custom resource. The builders handle API version and kind metadata, letting you focus on the resource specification.</description></item><item><title>Logger</title><link>https://www.gokure.dev/kure/dev/api-reference/logger/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/logger/index.html</guid><description>Logger - Logging Utilities The logger package provides structured logging for Kure. All logging in the project should use this package instead of fmt.Print or the standard log package.
Overview The logger provides a simple interface for structured key-value logging with support for different log levels. It wraps an underlying structured logger and provides convenience functions.
Usage import "github.com/go-kure/kure/pkg/logger" // Default logger log := logger.Default() // Log with context log.Info("loading package", "path", "/path/to/package") log.Error("failed to parse", "error", err, "file", "config.yaml") // No-op logger (for quiet mode) log := logger.Noop() Log Levels Level Usage Info Normal operational messages Error Error conditions Debug Detailed debugging information Warn Warning conditions Conventions Use key-value pairs for structured data: log.Info("msg", "key1", val1, "key2", val2) Use logger.Noop() when verbose output is disabled Pass the logger through function parameters or options structs Use logger.Default() only at initialization points (CLI entry, tests) Related Packages All Kure packages use this logger. See the errors package for error handling patterns.</description></item><item><title>Compatibility Matrix</title><link>https://www.gokure.dev/kure/dev/api-reference/compatibility/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.gokure.dev/kure/dev/api-reference/compatibility/index.html</guid><description>Kure Compatibility Matrix This document describes the versions of infrastructure tools that Kure supports.
Version Philosophy Kure maintains two version concepts for each dependency:
Build Version (current in versions.yaml): The exact library version Kure imports in go.mod Deployment Compatibility (supported_range): The range of deployed tool versions that Kure can generate YAML for Go Version Current: Go 1.26.1
Infrastructure Dependencies Tool Build Version Deployment Compatibility Notes cert-manager 1.20.0 1.14 - 1.20 Stable v1 APIs. v1.20 deprecated ObjectReference in favor of IssuerReference (type alias). fluxcd 2.8.2 2.4 - 2.8 v1beta2 APIs removed in 2.8, DependsOn uses DependencyReference. image-automation-controller promoted to v1. All github.com/fluxcd/* packages upgraded together. flux-operator 0.40.0 0.23 - 0.40 Upgraded with FluxCD 2.8 ecosystem. metallb 0.15.3 0.14 - 0.15 Stable v1beta1 APIs, patch release prometheus-operator 0.89.0 0.75 - 0.89 Prometheus operator monitoring API types (ServiceMonitor, PodMonitor, PrometheusRule). Only the /pkg/apis/monitoring submodule is imported — not the full operator. Stable v1 APIs (monitoring.coreos.com/v1). external-secrets 0.0.0-20260213133823-31b0c7c37342 1.3 Module path changed from root to /apis submodule in v1.0 (#5494). No semver tags for apis submodule — use pseudo-versions pinned to release commits. v1.3.2+ commit: 31b0c7c3734255a92dfe5cf9e1e204de127eb24c (includes controller-runtime v0.23.1 compat) cnpg 1.28.1 1.24 - 1.28 CloudNativePG operator for PostgreSQL on Kubernetes. Cluster CR (with managed roles), Database CR (postgresql.cnpg.io/v1), ObjectStore CR (barmancloud.cnpg.io/v1), and ScheduledBackups. ObjectStore lives in a separate module (plugin-barman-cloud). cnpg-barman-cloud 0.11.0 0.9 - 0.11 Barman Cloud plugin for CNPG — provides ObjectStore CR (barmancloud.cnpg.io/v1). Versioned independently from the CNPG operator. controller-runtime 0.23.3 0.22 - 0.23 Upgraded with FluxCD 2.8 and external-secrets 1.3 migrations gateway-api 1.5.1 1.0 - 1.5 Gateway API v1 types (HTTPRoute). Used by pkg/kubernetes HTTPRoute builders. Kure generates gateway.networking.k8s.io/v1 resources (GA since v1.0). kubernetes 0.35.1 1.33 - 1.35 Go 1.26 baseline; generated YAML uses stable APIs compatible across this range Understanding the Matrix Build Version (go.mod) The version Kure imports and builds against. This is validated by CI to match versions.yaml.</description></item></channel></rss>