Documentation ¶
Index ¶
- Constants
- Variables
- type Controller
- func (c *Controller) CephFilesystemOK(ctx context.Context, rookVersion semver.Version, name string) (bool, error)
- func (c *Controller) CheckRotateCertsDue(ctx context.Context, reset bool) (bool, error)
- func (c *Controller) ClearNode(ctx context.Context, nodeName string) error
- func (c *Controller) DoesHAMinioExist(ctx context.Context, ns string) (bool, error)
- func (c *Controller) EnableHAKotsadm(ctx context.Context, ns string) error
- func (c *Controller) EnsureCephCluster(ctx context.Context, rookStorageClassName string) error
- func (c *Controller) GetBlockPoolReplicationLevel(ctx context.Context, name string) (int, error)
- func (c *Controller) GetCephCluster(ctx context.Context) (*cephv1.CephCluster, error)
- func (c *Controller) GetRookVersion(ctx context.Context) (*semver.Version, error)
- func (c *Controller) JSONPatchCephCluster(ctx context.Context, patches []k8s.JSONPatchOperation) (*cephv1.CephCluster, error)
- func (c *Controller) MaybeRebalanceMinioServers(ctx context.Context, ns string) error
- func (c *Controller) MigrateMinioData(ctx context.Context, utilImage string, ns string) error
- func (c *Controller) PatchFilesystemMDSPlacementMultinode(ctx context.Context, name string, numNodes int) error
- func (c *Controller) PrioritizeRook(ctx context.Context) error
- func (c *Controller) PurgeNode(ctx context.Context, name string, rook bool, rookVersion *semver.Version) error
- func (c *Controller) ReconcileInternalLB(ctx context.Context, nodes []corev1.Node) error
- func (c *Controller) ReconcileMgrCount(ctx context.Context, rookVersion semver.Version, nodeCount int) error
- func (c *Controller) ReconcileMonCount(ctx context.Context, nodeCount int) error
- func (c *Controller) RestartFailedEnvoyPods(ctx context.Context) error
- func (c *Controller) RotateAllCerts(ctx context.Context) error
- func (c *Controller) RotateContourCerts(ctx context.Context) error
- func (c *Controller) RotateKurlProxyCert(ctx context.Context) error
- func (c *Controller) RotateRegistryCert(ctx context.Context) error
- func (c *Controller) ScaleKotsadmRqlite(ctx context.Context, ns string, desiredScale int32) error
- func (c *Controller) ScaleMinioStatefulset(ctx context.Context, ns string) error
- func (c *Controller) SetBlockPoolReplication(ctx context.Context, rookVersion semver.Version, cephVersion *semver.Version, ...) (bool, error)
- func (c *Controller) SetCephCSIResources(ctx context.Context, rookVersion semver.Version, nodeCount int) (bool, error)
- func (c *Controller) SetDeviceHealthMetricsReplication(ctx context.Context, rookVersion semver.Version, cephVersion *semver.Version, ...) (bool, error)
- func (c *Controller) SetFilesystemReplication(ctx context.Context, rookVersion semver.Version, cephVersion *semver.Version, ...) (bool, error)
- func (c *Controller) SetKubeconfigServer(ctx context.Context, node corev1.Node, server string) error
- func (c *Controller) SetObjectStoreReplication(ctx context.Context, rookVersion semver.Version, cephVersion *semver.Version, ...) (bool, error)
- func (c *Controller) UpdateInternalLB(ctx context.Context, nodes []corev1.Node) error
- func (c *Controller) UpdateKubeletClientCertSecret(ctx context.Context) error
- func (c *Controller) UseNodesForStorage(ctx context.Context, rookVersion semver.Version, cluster *cephv1.CephCluster, ...) (int, error)
- func (c *Controller) WaitCephFilesystem(ctx context.Context, rookVersion semver.Version, name string) error
Constants ¶
const ( RookCephNS = "rook-ceph" CephClusterName = "rook-ceph" CephDeviceHealthMetricsPool = "device_health_metrics" CephDeviceHealthMetricsPoolQuincy = ".mgr" RookCephObjectStoreRootPool = ".rgw.root" RotateCertsLabel = "kurl.sh/task" RotateCertsValue = "rotate-certs" RotateCertsLastAttempted = "rotate-certs-last-attempted" TaskLabel = "kurl.sh/task" UpdateInternalLBValue = "update-internallb" SetKubeconfigServerValue = "set-kubeconfig-server" )
const ( DefaultContourNamespace = "projectcontour" DefaultEnvoyPodsNotReadyDuration = 5 * time.Minute )
const (
DefaultEtcKubernetesDir = "/etc/kubernetes"
)
const (
KotsadmRqliteHAReplicaCount = 3
)
Variables ¶
var ( RookCephObjectStoreMetadataPools = []string{ "rgw.control", "rgw.meta", "rgw.log", "rgw.buckets.index", "rgw.buckets.non-ec", } RookCephObjectStoreMetadataPoolsQuincy = []string{ "rgw.control", "rgw.meta", "rgw.log", "rgw.buckets.index", "rgw.buckets.non-ec", "rgw.otp", } RookCephObjectStoreDataPools = []string{ "rgw.buckets.data", } )
var CephPacific = semver.MustParse("16.2.0")
var CephQuincy = semver.MustParse("17.2.0")
var Rookv14 = semver.MustParse("1.4.0")
var Rookv19 = semver.MustParse("1.9.0")
var RotateCertsSelector = labels.SelectorFromSet(labels.Set{RotateCertsLabel: RotateCertsValue})
var SetKubeconfigServerSelector = labels.SelectorFromSet(labels.Set{TaskLabel: SetKubeconfigServerValue})
var UpdateInternalLBSelector = labels.SelectorFromSet(labels.Set{TaskLabel: UpdateInternalLBValue})
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Config types.ControllerConfig SyncExecutor k8s.SyncExecutorInterface Log *zap.SugaredLogger sync.Mutex }
func NewController ¶
func NewController(config types.ControllerConfig, log *zap.SugaredLogger) *Controller
func (*Controller) CephFilesystemOK ¶
func (*Controller) CheckRotateCertsDue ¶ added in v0.5.0
Any time this returns true it updates the last attempted timestamp
func (*Controller) ClearNode ¶ added in v0.3.0
func (c *Controller) ClearNode(ctx context.Context, nodeName string) error
ClearNode force deletes pods stuck in Terminating state on a single node.
func (*Controller) DoesHAMinioExist ¶ added in v0.26.0
func (*Controller) EnableHAKotsadm ¶ added in v0.25.0
func (c *Controller) EnableHAKotsadm(ctx context.Context, ns string) error
func (*Controller) EnsureCephCluster ¶ added in v0.27.2
func (c *Controller) EnsureCephCluster(ctx context.Context, rookStorageClassName string) error
func (*Controller) GetBlockPoolReplicationLevel ¶ added in v0.27.2
getBlockPoolReplicationLevel returns ceph block pool replication size
func (*Controller) GetCephCluster ¶ added in v0.20.0
func (c *Controller) GetCephCluster(ctx context.Context) (*cephv1.CephCluster, error)
func (*Controller) GetRookVersion ¶ added in v0.23.1
GetRookVersion gets the Rook version from the container image tag of the rook-ceph-operator deployment in the rook-ceph namespace.
func (*Controller) JSONPatchCephCluster ¶ added in v0.26.0
func (c *Controller) JSONPatchCephCluster(ctx context.Context, patches []k8s.JSONPatchOperation) (*cephv1.CephCluster, error)
JSONPatchCephCluster patches the "rook-ceph" CephCluster with the given JSON patches.
func (*Controller) MaybeRebalanceMinioServers ¶ added in v0.24.0
func (c *Controller) MaybeRebalanceMinioServers(ctx context.Context, ns string) error
MaybeRebalanceMinioServers first, check if minio is healthy. If it is not healthy, don't do anything. (this may require manual intervention, or may be resolved when nodes come back online) Then, check for pods that have been unschedulable for more than 5 minutes and delete the underlying volume + pod. This will allow the pod to be scheduled on a node that still exists and for data to be rebalanced there. After ensuring that there are as many running replicas as possible, we can rearrange replicas to maximize the number of nodes that can be lost before losing data. To do this, first check if more than ceil(replicas/nodes) replicas exist on one node. If it does, see if we can reschedule one of those replicas safely. If such a node does not exist, instead look for nodes with less than floor(replicas/nodes) replicas, and if it exists reschedule a replica from a node with ceil(replicas/nodes).
func (*Controller) MigrateMinioData ¶ added in v0.24.0
MigrateMinioData moves data from the un-replicated minio deployment to the HA minio statefulset, using kurl's sync-object-store.
func (*Controller) PatchFilesystemMDSPlacementMultinode ¶ added in v0.20.0
func (c *Controller) PatchFilesystemMDSPlacementMultinode(ctx context.Context, name string, numNodes int) error
PatchFilesystemMDSPlacementMultinode will change the patched preferredDuringSchedulingIgnoredDuringExecution podAntiAffinity rule back to the more correct requiredDuringSchedulingIgnoredDuringExecution equivalent if the number of nodes is greater than one.
func (*Controller) PrioritizeRook ¶ added in v0.9.0
func (c *Controller) PrioritizeRook(ctx context.Context) error
func (*Controller) PurgeNode ¶
func (c *Controller) PurgeNode(ctx context.Context, name string, rook bool, rookVersion *semver.Version) error
PurgeNode cleans up a lost node.
func (*Controller) ReconcileInternalLB ¶ added in v0.11.0
func (*Controller) ReconcileMgrCount ¶ added in v0.23.0
func (c *Controller) ReconcileMgrCount(ctx context.Context, rookVersion semver.Version, nodeCount int) error
ReconcileMgrCount ensures the CephCluster has the desired number of mgrs. A single mgr for clusters with 1 node, and 2 mgrs for all other clusters.
func (*Controller) ReconcileMonCount ¶ added in v0.4.0
func (c *Controller) ReconcileMonCount(ctx context.Context, nodeCount int) error
ReconcileMonCount ensures the CephCluster has the desired number of mons. A single mon for clusters with 1 or 2 nodes, and 3 mons for all other clusters.
func (*Controller) RestartFailedEnvoyPods ¶ added in v0.21.0
func (c *Controller) RestartFailedEnvoyPods(ctx context.Context) error
RestartFailedEnvoyPods will forcefully delete envoy pods that have fallen into an unrecoverable state for at least EnvoyPodsNotReadyDuration.
func (*Controller) RotateAllCerts ¶ added in v0.5.0
func (c *Controller) RotateAllCerts(ctx context.Context) error
This launches a pod on each primary to mount /etc/kubernetes and rotate the certs. It leaves the pods up if any fail.
func (*Controller) RotateContourCerts ¶ added in v0.15.0
func (c *Controller) RotateContourCerts(ctx context.Context) error
func (*Controller) RotateKurlProxyCert ¶ added in v0.7.0
func (c *Controller) RotateKurlProxyCert(ctx context.Context) error
func (*Controller) RotateRegistryCert ¶ added in v0.5.0
func (c *Controller) RotateRegistryCert(ctx context.Context) error
func (*Controller) ScaleKotsadmRqlite ¶ added in v0.25.0
func (*Controller) ScaleMinioStatefulset ¶ added in v0.24.0
func (c *Controller) ScaleMinioStatefulset(ctx context.Context, ns string) error
func (*Controller) SetBlockPoolReplication ¶ added in v0.2.4
func (c *Controller) SetBlockPoolReplication(ctx context.Context, rookVersion semver.Version, cephVersion *semver.Version, name string, level int, doFullReconcile bool) (bool, error)
SetBlockPoolReplicationLevel ignores NotFound errors.
func (*Controller) SetCephCSIResources ¶ added in v0.23.0
func (c *Controller) SetCephCSIResources(ctx context.Context, rookVersion semver.Version, nodeCount int) (bool, error)
SetCephCSIResources will set CSI provisioner and plugin resources to their recommendations once the cluster has enough capacity at 3 nodes.
func (*Controller) SetDeviceHealthMetricsReplication ¶ added in v0.4.0
func (*Controller) SetFilesystemReplication ¶
func (c *Controller) SetFilesystemReplication(ctx context.Context, rookVersion semver.Version, cephVersion *semver.Version, name string, level int, doFullReconcile bool) (bool, error)
SetSharedFilesystemReplication will set the shared filesystem replication to the number of OSDs in the cluster. Returns true if the resource was updated.
func (*Controller) SetKubeconfigServer ¶ added in v0.11.0
func (*Controller) SetObjectStoreReplication ¶
func (c *Controller) SetObjectStoreReplication(ctx context.Context, rookVersion semver.Version, cephVersion *semver.Version, name string, level int, doFullReconcile bool) (bool, error)
SetObjectStoreReplication will set the object store pool replication to the number of OSDs in the cluster. Returns true if the resource was updated.
func (*Controller) UpdateInternalLB ¶ added in v0.11.0
Update /etc/haproxy/haproxy.cfg and /etc/kubernetes/manifests/haproxy.yaml on all nodes.
func (*Controller) UpdateKubeletClientCertSecret ¶ added in v0.7.0
func (c *Controller) UpdateKubeletClientCertSecret(ctx context.Context) error
Copies apiserver-kubelet-client.crt into secret used by kotsadm to collect metrics
func (*Controller) UseNodesForStorage ¶
func (c *Controller) UseNodesForStorage(ctx context.Context, rookVersion semver.Version, cluster *cephv1.CephCluster, names []string, manageNodes bool) (int, error)
returns the number of nodes used for storage, which may be higher than the number of names passed in if a node is currently not ready but has not been purged