argocd

package
v0.2.0-beta.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

ArgoCD Engine - ArgoCD Workflow Implementation

The argocd package implements the stack.Workflow interface for ArgoCD, generating ArgoCD Application resources from Kure's domain model.

Bootstrap not implemented. GenerateBootstrap returns an error when bootstrap is enabled. If bootstrap generation is required, use the FluxCD engine instead.

Quick Start

import (
    _ "github.com/go-kure/kure/pkg/stack/argocd" // registers "argocd" provider
    "github.com/go-kure/kure/pkg/stack"
    "github.com/go-kure/kure/pkg/stack/layout"
)

// Use via the stack.Workflow registry
wf, err := stack.NewWorkflow("argocd")
ml, err := wf.CreateLayoutWithResources(cluster, layout.LayoutRules{})
_ = ml.WriteToDisk("./clusters/prod")

Engine Construction

// Direct construction (bypasses registry)
engine := argocd.Engine()

// Configure source repository and namespace
engine.SetRepoURL("https://github.com/example/manifests.git")
engine.SetDefaultNamespace("argocd")

Resource Generation

// Generate ArgoCD Applications from a cluster
objects, err := engine.GenerateFromCluster(cluster)

// Generate from a specific node subtree
objects, err := engine.GenerateFromNode(node)

// Generate from a single bundle
objects, err := engine.GenerateFromBundle(bundle)

Each Bundle in the cluster produces one ArgoCD Application (argoproj.io/v1alpha1). The Application's spec.source.path is derived from the bundle's ancestry in the node tree. spec.destination.server defaults to https://kubernetes.default.svc.

Layout Integration

// Create layout with Applications placed in an argocd/ subdirectory
ml, err := engine.CreateLayoutWithResources(cluster, layout.LayoutRules{})

// Integrate Applications into an existing layout
err = engine.IntegrateWithLayout(ml, cluster, layout.LayoutRules{})

CreateLayoutWithResources generates the base manifest layout via layout.WalkCluster, then appends an argocd/ child layout containing the generated Applications.

Known Limitations

  • Bootstrap not implemented: GenerateBootstrap returns nil, nil when config is nil or disabled; returns an error when bootstrap is enabled. SupportedBootstrapModes() returns nil.
  • Applications are generated as unstructured.Unstructured objects; ArgoCD CRD types are not imported.
  • IntegrateWithLayout is a no-op (ArgoCD Applications reference external repos and do not require layout integration).
  • stack/fluxcd — full-featured FluxCD engine including bootstrap
  • stack — domain model and Workflow interface
  • stack/layout — manifest layout generation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkflowEngine

type WorkflowEngine struct {
	// RepoURL is used as the source repo for generated Applications
	RepoURL string
	// DefaultNamespace is the default namespace for ArgoCD Applications
	DefaultNamespace string
}

WorkflowEngine implements the stack.Workflow interface for ArgoCD.

func Engine

func Engine() *WorkflowEngine

Engine creates an ArgoCD workflow engine.

func (*WorkflowEngine) CreateLayoutWithResources

func (w *WorkflowEngine) CreateLayoutWithResources(c *stack.Cluster, rulesInterface stack.LayoutRulesProvider) (stack.ManifestLayoutResult, error)

CreateLayoutWithResources creates a new layout that includes ArgoCD Applications.

func (*WorkflowEngine) GenerateBootstrap

func (w *WorkflowEngine) GenerateBootstrap(config *stack.BootstrapConfig, rootNode *stack.Node) ([]client.Object, error)

GenerateBootstrap creates bootstrap resources for setting up ArgoCD.

func (*WorkflowEngine) GenerateFromBundle

func (w *WorkflowEngine) GenerateFromBundle(b *stack.Bundle) ([]client.Object, error)

GenerateFromBundle creates an ArgoCD Application from a bundle definition.

func (*WorkflowEngine) GenerateFromCluster

func (w *WorkflowEngine) GenerateFromCluster(c *stack.Cluster) ([]client.Object, error)

GenerateFromCluster creates ArgoCD Applications from a cluster definition.

func (*WorkflowEngine) GenerateFromNode

func (w *WorkflowEngine) GenerateFromNode(n *stack.Node) ([]client.Object, error)

GenerateFromNode creates ArgoCD Applications from a node and its children.

func (*WorkflowEngine) GetName

func (w *WorkflowEngine) GetName() string

GetName returns a human-readable name for this workflow engine.

func (*WorkflowEngine) GetVersion

func (w *WorkflowEngine) GetVersion() string

GetVersion returns the version of this workflow engine.

func (*WorkflowEngine) IntegrateWithLayout

func (w *WorkflowEngine) IntegrateWithLayout(ml *layout.ManifestLayout, c *stack.Cluster, rules layout.LayoutRules) error

IntegrateWithLayout adds ArgoCD Applications to an existing manifest layout. For ArgoCD, this is typically not needed as Applications reference external repos.

func (*WorkflowEngine) SetDefaultNamespace

func (w *WorkflowEngine) SetDefaultNamespace(namespace string)

SetDefaultNamespace configures the default namespace for ArgoCD Applications.

func (*WorkflowEngine) SetRepoURL

func (w *WorkflowEngine) SetRepoURL(repoURL string)

SetRepoURL configures the repository URL for generated Applications.

func (*WorkflowEngine) SupportedBootstrapModes

func (w *WorkflowEngine) SupportedBootstrapModes() []string

SupportedBootstrapModes returns the bootstrap modes supported by ArgoCD.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL