Documentation
¶
Index ¶
- Constants
- Variables
- func AddSeccompProfileForOpenShift(client client.Client, podspec *corev1.PodSpec)
- func GenerateUniqueResourceName(argoComponentName string, cr *argoproj.ArgoCD) string
- func GetImageAndTag(envVar, containerSpecImage, containerSpecVersion, commonSpecImage, ... string) (string, string)
- func InspectCluster() error
- func IsImageUpdaterAPIAvailable() bool
- func IsOpenShiftCluster() bool
- func IsPrometheusAPIAvailable() bool
- func IsVersionAPIAvailable() bool
- func Register(h ...Hook)
- func UseApplicationController(name string, cr *argoproj.ArgoCD) bool
- func UseDex(cr *argoproj.ArgoCD) bool
- func UseRedis(name string, cr *argoproj.ArgoCD) bool
- func UseServer(name string, cr *argoproj.ArgoCD) bool
- func ZapLogger(development bool) logr.Logger
- type BuilderHook
- type DeprecationEventEmissionStatus
- type DexConnector
- type Hook
- type LocalUsersInfo
- type ReconcileArgoCD
- func (r *ReconcileArgoCD) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)
- func (r *ReconcileArgoCD) ReconcileNetworkPolicies(cr *argoproj.ArgoCD) error
- func (r *ReconcileArgoCD) ReconcileRedisHANetworkPolicy(cr *argoproj.ArgoCD) error
- func (r *ReconcileArgoCD) ReconcileRedisNetworkPolicy(cr *argoproj.ArgoCD) error
- func (r *ReconcileArgoCD) SetupWithManager(mgr ctrl.Manager) error
- type SchemeOpt
- type TokenRenewalTimer
Constants ¶
const ( ApplicationSetGitlabSCMTlsCertPath = "/app/tls/scm/cert" ApplicationSetGitlabSCMTlsMountPath = "/app/tls/scm/" )
const ( DefaultImageUpdaterImage = "quay.io/argoprojlabs/argocd-image-updater" DefaultImageUpdaterTag = "latest" ArgocdImageUpdaterConfigCM = "argocd-image-updater-config" ArgocdImageUpdaterSSHConfigCM = "argocd-image-updater-ssh-config" ArgocdImageUpdaterSecret = "argocd-image-updater-secret" // #nosec G101 )
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" )
const (
DefaultNotificationsConfigurationInstanceName = "default-notifications-configuration"
)
Variables ¶
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"}) )
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
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.
var ( TCPProtocol = func() *corev1.Protocol { tcpProtocol := corev1.ProtocolTCP return &tcpProtocol }() )
Functions ¶
func AddSeccompProfileForOpenShift ¶ added in v0.2.3
func GenerateUniqueResourceName ¶
GenerateUniqueResourceName generates unique names for cluster scoped resources
func GetImageAndTag ¶ added in v0.16.0
func GetImageAndTag(envVar, containerSpecImage, containerSpecVersion, commonSpecImage, commonSpecVersion string) (string, string)
GetImageAndTag determines the image and tag for an ArgoCD component, considering container-level and common-level overrides. Priority order: containerSpec > commonSpec > environment variable > defaults Returns: image, tag
func InspectCluster ¶
func InspectCluster() error
InspectCluster will verify the availability of extra features available to the cluster, such as Prometheus and OpenShift Routes.
func IsImageUpdaterAPIAvailable ¶ added in v0.17.0
func IsImageUpdaterAPIAvailable() bool
IsImageUpdaterAPIAvailable returns true if the image updater api is present
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 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
UseApplicationController determines whether Application Controller resources should be created and configured or not
func UseDex ¶ added in v0.4.0
UseDex determines whether Dex resources should be created and configured or not
func UseRedis ¶ added in v0.14.0
UseRedis determines whether Redis resources should be created and configured or not
Types ¶
type BuilderHook ¶ added in v0.16.0
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 LocalUsersInfo ¶ added in v0.16.0
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 (value is not used)
// - list of namespaces that currently have the 'common.ArgoCDApplicationSetManagedByClusterArgoCDLabel' label
// - items in the list that are NOT mentioned in .spec.applicationset.sourceNamespaces will be cleaned up
// - (or if ALL resources in the list will be cleaned up if ArgoCD instance in namespace-scoped)
ManagedApplicationSetSourceNamespaces map[string]string
// Stores a list of NotificationsSourceNamespaces as keys
ManagedNotificationsSourceNamespaces 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 ¶
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 TokenRenewalTimer ¶ added in v0.16.0
type TokenRenewalTimer struct {
// contains filtered or unexported fields
}
Source Files
¶
- applicationset.go
- argocd_controller.go
- configmap.go
- custommapper.go
- deployment.go
- dex.go
- dexUtil.go
- hooks.go
- hpa.go
- image_updater.go
- ingress.go
- localusers.go
- metrics.go
- namespaceManagement.go
- networkpolicies.go
- notifications.go
- notifications_util.go
- policyrule.go
- prometheus.go
- repo_server.go
- role.go
- rolebinding.go
- route.go
- secret.go
- service.go
- service_account.go
- sso.go
- statefulset.go
- status.go
- testing.go
- util.go