ekcoops

package
v0.28.7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package ekcoops provides a Kubernetes Operator for an embedded kURL cluster. It automates the functions that would otherwise be required of a cluster administrator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// how long a Node must be unreachable before considered dead
	NodeUnreachableToleration time.Duration `mapstructure:"node_unreachable_toleration"`
	// don't purge if it will result in less than this many ready masters
	MinReadyMasterNodes int `mapstructure:"min_ready_master_nodes"`
	// don't purge if it will result in less than this many ready workers
	MinReadyWorkerNodes int `mapstructure:"min_ready_worker_nodes"`

	// whether to purge dead nodes from the cluster automatically
	PurgeDeadNodes bool `mapstructure:"purge_dead_nodes"`
	// whether to force delete terminating pods on dead nodes automatically
	ClearDeadNodes bool `mapstructure:"clear_dead_nodes"`

	// whether to maintain the list of nodes to use in the CephCluster config. With Rook 1.0
	// Replicated maintains the list to obviate the need to restart the operator, but with
	// earlier versions of Rook we just set `useAllNodes` to true. This also enables control of
	// the replication factor of ceph pools, scaling up and down with the number of nodes in the
	// cluster.
	MaintainRookStorageNodes bool `mapstructure:"maintain_rook_storage_nodes"`
	// when set, only nodes with this label will be added to the ceph cluster
	RookStorageNodesLabel string `mapstructure:"rook_storage_nodes_label"`
	// when set, only nodes in this array will be added to the ceph cluster with the corresponding
	// config
	RookStorageNodes string `mapstructure:"rook_storage_nodes"`
	// names and levels of ceph pools to maintain if MaintainRookStorageNodes is enabled
	CephBlockPool          string `mapstructure:"ceph_block_pool"`
	CephFilesystem         string `mapstructure:"ceph_filesystem"`
	CephObjectStore        string `mapstructure:"ceph_object_store"`
	MinCephPoolReplication int    `mapstructure:"min_ceph_pool_replication"`
	MaxCephPoolReplication int    `mapstructure:"max_ceph_pool_replication"`
	// when set, priority class to be applied to rook deployments and daemonsets
	RookPriorityClass string `mapstructure:"rook_priority_class"`
	// Whether to reconcile CephFilesystem MDS placement when the cluster is scaled beyond one
	// node. MDS pod anti-affinity is made more lenient at install time by kURL to allow for single
	// node Rook upgrades. This setting will revert that change upon the addition of a second node.
	ReconcileRookMDSPlacement bool `mapstructure:"reconcile_rook_mds_placement"`
	// Whether to set Ceph CSI provisioner and plugin resources to their recommendations once the
	// cluster has enough capacity at 3 nodes.
	ReconcileCephCSIResources bool `mapstructure:"reconcile_ceph_csi_resources"`

	// kubernetes certificates directory
	CertificatesDir string `mapstructure:"certificates_dir"`

	ReconcileInterval time.Duration `mapstructure:"reconcile_interval"`
	ReconcileTimeout  time.Duration `mapstructure:"reconcile_timeout"`

	RotateCerts                           bool          `mapstructure:"rotate_certs"`
	RotateCertsImage                      string        `mapstructure:"rotate_certs_image"`
	RotateCertsNamespace                  string        `mapstructure:"rotate_certs_namespace"`
	RotateCertsCheckInterval              time.Duration `mapstructure:"rotate_certs_check_interval"`
	RotateCertsTTL                        time.Duration `mapstructure:"rotate_certs_ttl"`
	RegistryCertNamespace                 string        `mapstructure:"registry_cert_namespace"`
	RegistryCertSecret                    string        `mapstructure:"registry_cert_secret"`
	KurlProxyCertNamespace                string        `mapstructure:"kurl_proxy_cert_namespace"`
	KurlProxyCertSecret                   string        `mapstructure:"kurl_proxy_cert_secret"`
	KotsadmKubeletCertNamespace           string        `mapstructure:"kotsadm_kubelet_cert_namespace"`
	KotsadmKubeletCertSecret              string        `mapstructure:"kotsadm_kubelet_cert_secret"`
	ContourNamespace                      string        `mapstructure:"contour_namespace"`
	ContourCertNamespace                  string        `mapstructure:"contour_cert_namespace"` // deprecated
	ContourCertSecret                     string        `mapstructure:"contour_cert_secret"`
	EnvoyCertSecret                       string        `mapstructure:"envoy_cert_secret"`
	RestartFailedEnvoyPods                bool          `mapstructure:"restart_failed_envoy_pods"`
	EnvoyPodsNotReadyDuration             time.Duration `mapstructure:"envoy_pods_not_ready_duration"`
	EnableInternalLoadBalancer            bool          `mapstructure:"enable_internal_load_balancer"`
	InternalLoadBalancerHAProxyImage      string        `mapstructure:"internal_load_balancer_haproxy_image"`
	InternalLoadBalancerPort              int           `mapstructure:"internal_load_balancer_port"`
	HostTaskImage                         string        `mapstructure:"host_task_image"`
	HostTaskNamespace                     string        `mapstructure:"host_task_namespace"`
	PodImageOverrides                     []string      `mapstructure:"pod_image_overrides"`
	AutoApproveKubeletCertSigningRequests bool          `mapstructure:"auto_approve_kubelet_csrs"`
	RookMinimumNodeCount                  int           `mapstructure:"rook_minimum_node_count"`
	RookStorageClass                      string        `mapstructure:"rook_storage_class"`
	RookCephImage                         string        `mapstructure:"rook_ceph_image"`
	StorageMigrationAuthToken             string        `mapstructure:"storage_migration_auth_token"`

	// options for HA minio
	EnableHAMinio  bool   `mapstructure:"enable_ha_minio"`  // should minio be scaled to multiple replicas on 3+ nodes
	MinioNamespace string `mapstructure:"minio_namespace"`  // the namespace minio is installed in
	MinioUtilImage string `mapstructure:"minio_util_image"` // the image to use to migrate minio from one node to ha

	// options for HA kotsadm
	EnableHAKotsadm bool `mapstructure:"enable_ha_kotsadm"` // should kots components be scaled to multiple replicas on 3+ nodes
}

type Operator

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

func New

func New(
	config Config,
	client kubernetes.Interface,
	controller *cluster.Controller,
	log *zap.SugaredLogger,
) *Operator

func (*Operator) Poll

func (o *Operator) Poll(ctx context.Context, interval, timeout time.Duration)

Poll will run the reconcile function on an interval

func (*Operator) Reconcile

func (o *Operator) Reconcile(ctx context.Context, nodes []corev1.Node, doFullReconcile bool) error

func (*Operator) ReconcilePrometheus added in v0.16.0

func (o *Operator) ReconcilePrometheus(ctx context.Context, nodeCount int) error

func (*Operator) RotateCerts added in v0.16.0

func (o *Operator) RotateCerts(ctx context.Context, force bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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