Documentation
¶
Index ¶
- Constants
- Variables
- type Controller
- func (c *Controller) CephFilesystemOK(rookVersion semver.Version, name string) (bool, error)
- func (c *Controller) CheckRotateCertsDue(reset bool) (bool, error)
- func (c *Controller) ClearNode(ctx context.Context, nodeName string) error
- func (c *Controller) GetCephCluster(ctx context.Context) (*cephv1.CephCluster, error)
- func (c *Controller) GetRookVersion(ctx context.Context) (*semver.Version, error)
- func (c *Controller) PatchFilesystemMDSPlacementMultinode(name string, numNodes int) error
- func (c *Controller) PrioritizeRook() 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, count int) error
- func (c *Controller) ReconcileMonCount(ctx context.Context, count int) error
- func (c *Controller) RestartFailedEnvoyPods(ctx context.Context) error
- func (c *Controller) RotateAllCerts(ctx context.Context) error
- func (c *Controller) RotateContourCerts() error
- func (c *Controller) RotateKurlProxyCert() error
- func (c *Controller) RotateRegistryCert() error
- func (c *Controller) SetBlockPoolReplication(rookVersion semver.Version, name string, level int, ...) (bool, error)
- func (c *Controller) SetCephCSIResources(ctx context.Context, rookVersion semver.Version, nodeCount int) (bool, error)
- func (c *Controller) SetDeviceHealthMetricsReplication(rookVersion semver.Version, cephBlockPoolName string, level int, ...) (bool, error)
- func (c *Controller) SetFilesystemReplication(rookVersion semver.Version, name string, level int, ...) (bool, error)
- func (c *Controller) SetKubeconfigServer(ctx context.Context, node corev1.Node, server string) error
- func (c *Controller) SetObjectStoreReplication(rookVersion semver.Version, name string, level int, ...) (bool, error)
- func (c *Controller) UpdateInternalLB(ctx context.Context, nodes []corev1.Node) error
- func (c *Controller) UpdateKubeletClientCertSecret() error
- func (c *Controller) UseNodesForStorage(rookVersion semver.Version, names []string) (int, error)
- func (c *Controller) WaitCephFilesystem(ctx context.Context, rookVersion semver.Version, name string) error
- type ControllerConfig
Constants ¶
const ( RookCephNS = "rook-ceph" CephClusterName = "rook-ceph" CephDeviceHealthMetricsPool = "device_health_metrics" 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"
)
Variables ¶
var ( RookCephObjectStoreMetadataPools = []string{ "rgw.control", "rgw.meta", "rgw.log", "rgw.buckets.index", "rgw.buckets.non-ec", } RookCephObjectStoreDataPools = []string{ "rgw.buckets.data", } )
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 ControllerConfig Log *zap.SugaredLogger sync.Mutex }
func NewController ¶
func NewController(config ControllerConfig, log *zap.SugaredLogger) *Controller
func (*Controller) CephFilesystemOK ¶
func (*Controller) CheckRotateCertsDue ¶ added in v0.5.0
func (c *Controller) CheckRotateCertsDue(reset bool) (bool, error)
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) 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) PatchFilesystemMDSPlacementMultinode ¶ added in v0.20.0
func (c *Controller) PatchFilesystemMDSPlacementMultinode(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() 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 (*Controller) ReconcileMonCount ¶ added in v0.4.0
func (c *Controller) ReconcileMonCount(ctx context.Context, count int) error
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() error
func (*Controller) RotateKurlProxyCert ¶ added in v0.7.0
func (c *Controller) RotateKurlProxyCert() error
func (*Controller) RotateRegistryCert ¶ added in v0.5.0
func (c *Controller) RotateRegistryCert() error
func (*Controller) SetBlockPoolReplication ¶ added in v0.2.4
func (c *Controller) SetBlockPoolReplication(rookVersion semver.Version, name string, level int, cephcluster *cephv1.CephCluster, 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 (c *Controller) SetDeviceHealthMetricsReplication(rookVersion semver.Version, cephBlockPoolName string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
func (*Controller) SetFilesystemReplication ¶
func (c *Controller) SetFilesystemReplication(rookVersion semver.Version, name string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
SetSharedFilesystemReplication ignores NotFound errors.
func (*Controller) SetKubeconfigServer ¶ added in v0.11.0
func (*Controller) SetObjectStoreReplication ¶
func (c *Controller) SetObjectStoreReplication(rookVersion semver.Version, name string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
SetObjectStoreReplication ignores NotFound errors.
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() error
Copies apiserver-kubelet-client.crt into secret used by kotsadm to collect metrics
func (*Controller) UseNodesForStorage ¶
returns the number of nodes used for storage, which may be higher than the number of names passed in if a node is currenlty not ready but has not been purged
func (*Controller) WaitCephFilesystem ¶
type ControllerConfig ¶
type ControllerConfig struct { Client kubernetes.Interface ClientConfig *restclient.Config CephV1 *cephv1.CephV1Client AlertManagerV1 dynamic.NamespaceableResourceInterface PrometheusV1 dynamic.NamespaceableResourceInterface CertificatesDir string RookPriorityClass string RotateCerts bool RotateCertsImage string RotateCertsNamespace string RotateCertsCheckInterval time.Duration RotateCertsTTL time.Duration RegistryCertNamespace string RegistryCertSecret string KurlProxyCertNamespace string KurlProxyCertSecret string KotsadmKubeletCertNamespace string KotsadmKubeletCertSecret string ContourNamespace string ContourCertSecret string EnvoyCertSecret string RestartFailedEnvoyPods bool EnvoyPodsNotReadyDuration time.Duration HostTaskImage string HostTaskNamespace string EnableInternalLoadBalancer bool InternalLoadBalancerHAProxyImage string AutoApproveKubeletCertSigningRequests bool }