Documentation
¶
Index ¶
- Constants
- Variables
- type Controller
- func (c *Controller) CephFilesystemOK(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) PatchFilesystemMDSPlacementMultinode(name string, numNodes int) error
- func (c *Controller) PrioritizeRook() error
- func (c *Controller) PurgeNode(ctx context.Context, name string, rook bool) error
- func (c *Controller) ReconcileInternalLB(ctx context.Context, nodes []corev1.Node) error
- func (c *Controller) ReconcileMonCount(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(name string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
- func (c *Controller) SetDeviceHealthMetricsReplication(cephBlockPoolName string, level int, cephcluster *cephv1.CephCluster, ...) (bool, error)
- func (c *Controller) SetFilesystemReplication(name string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
- func (c *Controller) SetKubeconfigServer(ctx context.Context, node corev1.Node, server string) error
- func (c *Controller) SetObjectStoreReplication(name string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
- func (c *Controller) UpdateInternalLB(ctx context.Context, nodes []corev1.Node) error
- func (c *Controller) UpdateKubeletClientCertSecret() error
- func (c *Controller) UseNodesForStorage(names []string) (int, error)
- func (c *Controller) WaitCephFilesystem(ctx context.Context, 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 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 (c *Controller) CephFilesystemOK(name string) (bool, error)
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) 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) ReconcileInternalLB ¶ added in v0.11.0
func (*Controller) ReconcileMonCount ¶ added in v0.4.0
func (c *Controller) ReconcileMonCount(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(name string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
SetBlockPoolReplicationLevel ignores NotFound errors.
func (*Controller) SetDeviceHealthMetricsReplication ¶ added in v0.4.0
func (c *Controller) SetDeviceHealthMetricsReplication(cephBlockPoolName string, level int, cephcluster *cephv1.CephCluster, doFullReconcile bool) (bool, error)
func (*Controller) SetFilesystemReplication ¶
func (c *Controller) SetFilesystemReplication(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(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 ¶
func (c *Controller) UseNodesForStorage(names []string) (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 currenlty not ready but has not been purged
func (*Controller) WaitCephFilesystem ¶
func (c *Controller) WaitCephFilesystem(ctx context.Context, name string) error
type ControllerConfig ¶
type ControllerConfig struct { Client kubernetes.Interface ClientConfig *restclient.Config CephV1 *cephv1.CephV1Client AlertManagerV1 dynamic.NamespaceableResourceInterface PrometheusV1 dynamic.NamespaceableResourceInterface CertificatesDir string RookVersion semver.Version 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 }