argocd

package
v0.16.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 70 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ApplicationSetGitlabSCMTlsCertPath  = "/app/tls/scm/cert"
	ApplicationSetGitlabSCMTlsMountPath = "/app/tls/scm/"
)
View Source
const (
	// RedisIngressNetworkPolicy is the name of the network policy which controls Redis Ingress traffic
	RedisNetworkPolicy = "redis-network-policy"
	// RedisHAIngressNetworkPolicy is the name of the network policy which controls Redis HA Ingress traffic
	RedisHANetworkPolicy = "redis-ha-network-policy"
)
View Source
const (
	DefaultNotificationsConfigurationInstanceName = "default-notifications-configuration"
)

Variables

View Source
var (
	ActiveInstancesByPhase = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "active_argocd_instances_by_phase",
			Help: "Number of active argocd instances by phase",
		},
		[]string{"phase"},
	)

	ActiveInstancesTotal = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "active_argocd_instances_total",
			Help: "Total number of active argocd instances",
		},
	)

	ActiveInstanceReconciliationCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "active_argocd_instance_reconciliation_count",
			Help: "Number of reconciliations performed for a given instance",
		},
		[]string{"namespace"},
	)

	// ReconcileTime is a prometheus metric which keeps track of the duration
	// of reconciliations for a given instance
	ReconcileTime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:    "controller_runtime_reconcile_time_seconds_per_instance",
		Help:    "Length of time per reconciliation per instance",
		Buckets: []float64{0.05, 0.075, 0.1, 0.15, 0.2, 0.22, 0.24, 0.26, 0.28, 0.3, 0.32, 0.34, 0.37, 0.4, 0.42, 0.44, 0.48, 0.5, 0.55, 0.6, 0.75, 0.9, 1.00},
	}, []string{"namespace"})
)
View Source
var ActiveInstanceMap = make(map[string]string)

Map to keep track of running Argo CD instances using their namespaces as key and phase as value This map will be used for the performance metrics purposes Important note: This assumes that each instance only contains one Argo CD instance as, having multiple Argo CD instances in the same namespace is considered an anti-pattern

View Source
var DeprecationEventEmissionTracker = make(map[string]DeprecationEventEmissionStatus)

DeprecationEventEmissionTracker map stores the namespace containing ArgoCD instance as key and DeprecationEventEmissionStatus as value, where DeprecationEventEmissionStatus tracks the events that have been emitted for the instance in the particular namespace. This is temporary and can be removed in v0.0.6 when we remove the deprecated fields.

View Source
var (
	TCPProtocol = func() *corev1.Protocol {
		tcpProtocol := corev1.ProtocolTCP
		return &tcpProtocol
	}()
)

Functions

func AddSeccompProfileForOpenShift added in v0.2.3

func AddSeccompProfileForOpenShift(client client.Client, podspec *corev1.PodSpec)

func GenerateUniqueResourceName

func GenerateUniqueResourceName(argoComponentName string, cr *argoproj.ArgoCD) string

GenerateUniqueResourceName generates unique names for cluster scoped resources

func InspectCluster

func InspectCluster() error

InspectCluster will verify the availability of extra features available to the cluster, such as Prometheus and OpenShift Routes.

func IsOpenShiftCluster added in v0.14.0

func IsOpenShiftCluster() bool

func IsPrometheusAPIAvailable

func IsPrometheusAPIAvailable() bool

IsPrometheusAPIAvailable returns true if the Prometheus API is present.

func IsRouteAPIAvailable

func IsRouteAPIAvailable() bool

IsRouteAPIAvailable returns true if the Route API is present.

func IsVersionAPIAvailable added in v0.2.3

func IsVersionAPIAvailable() bool

IsVersionAPIAvailable returns true if the version api is present

func Register

func Register(h ...Hook)

Register adds a modifier for updating resources during reconciliation.

func UseApplicationController added in v0.14.0

func UseApplicationController(name string, cr *argoproj.ArgoCD) bool

UseApplicationController determines whether Application Controller resources should be created and configured or not

func UseDex added in v0.4.0

func UseDex(cr *argoproj.ArgoCD) bool

UseDex determines whether Dex resources should be created and configured or not

func UseRedis added in v0.14.0

func UseRedis(name string, cr *argoproj.ArgoCD) bool

UseRedis determines whether Redis resources should be created and configured or not

func UseServer added in v0.14.0

func UseServer(name string, cr *argoproj.ArgoCD) bool

UseServer determines whether ArgoCD Server resources should be created and configured or not

func ZapLogger

func ZapLogger(development bool) logr.Logger

Types

type BuilderHook

type BuilderHook struct {
	client.Client
	*builder.Builder
}

BuilderHook can be used to modify the controller-runtime builder.

type DeprecationEventEmissionStatus added in v0.5.0

type DeprecationEventEmissionStatus struct {
	SSOSpecDeprecationWarningEmitted    bool
	DexSpecDeprecationWarningEmitted    bool
	DisableDexDeprecationWarningEmitted bool
	TLSInsecureWarningEmitted           bool
}

DeprecationEventEmissionStatus is meant to track which deprecation events have been emitted already. This is temporary and can be removed in v0.0.6 once we have provided enough deprecation notice

type DexConnector

type DexConnector struct {
	Config map[string]interface{} `yaml:"config,omitempty"`
	ID     string                 `yaml:"id"`
	Name   string                 `yaml:"name"`
	Type   string                 `yaml:"type"`
}

DexConnector represents an authentication connector for Dex.

type Hook

type Hook func(*argoproj.ArgoCD, interface{}, string) error

Hook changes resources as they are created or updated by the reconciler.

type LocalUsersInfo

type LocalUsersInfo struct {
	// Stores the the timers that will auto-renew the API tokens for local users
	// after they expire. The key format is "argocd-namespace/user-name"
	TokenRenewalTimers map[string]*TokenRenewalTimer
	// Protects access to the token renewal timers and the K8S resources that
	// get updated as part of renewing the user tokens
	UserTokensLock lock
}

type ReconcileArgoCD

type ReconcileArgoCD struct {
	client.Client
	Scheme            *runtime.Scheme
	ManagedNamespaces *corev1.NamespaceList
	// Stores a list of ApplicationSourceNamespaces as keys
	ManagedSourceNamespaces map[string]string
	// Stores a list of ApplicationSetSourceNamespaces as keys
	ManagedApplicationSetSourceNamespaces map[string]string
	// Stores label selector used to reconcile a subset of ArgoCD
	LabelSelector string

	K8sClient  kubernetes.Interface
	LocalUsers *LocalUsersInfo
	// FipsConfigChecker checks if the deployment needs FIPS specific environment variables set.
	FipsConfigChecker argoutil.FipsConfigChecker
}

ArgoCDReconciler reconciles a ArgoCD object TODO(upgrade): rename to ArgoCDRecoonciler

func (*ReconcileArgoCD) Reconcile

func (r *ReconcileArgoCD) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. the ArgoCD object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.9.2/pkg/reconcile

func (*ReconcileArgoCD) ReconcileNetworkPolicies added in v0.10.1

func (r *ReconcileArgoCD) ReconcileNetworkPolicies(cr *argoproj.ArgoCD) error

func (*ReconcileArgoCD) ReconcileRedisHANetworkPolicy added in v0.10.1

func (r *ReconcileArgoCD) ReconcileRedisHANetworkPolicy(cr *argoproj.ArgoCD) error

ReconcileRedisHANetworkPolicy creates and reconciles network policy for Redis HA

func (*ReconcileArgoCD) ReconcileRedisNetworkPolicy added in v0.10.1

func (r *ReconcileArgoCD) ReconcileRedisNetworkPolicy(cr *argoproj.ArgoCD) error

ReconcileRedisNetworkPolicy creates and reconciles network policy for Redis

func (*ReconcileArgoCD) SetupWithManager

func (r *ReconcileArgoCD) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type SchemeOpt added in v0.7.1

type SchemeOpt func(*runtime.Scheme) error

type TokenRenewalTimer

type TokenRenewalTimer struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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