Documentation ¶
Index ¶
Constants ¶
const ( // MCAPIVersion is the machine config API version MCAPIVersion = "machineconfiguration.openshift.io/v1" // MCKind is the machine config resource kind MCKind = "MachineConfig" // MCPoolKind is the machine config pool resource king MCPoolKind = "MachineConfigPool" // MCRoleLabelName is the machine config role label name MCRoleLabelName = "machineconfiguration.openshift.io/role" // NodeObservabilityNodeRoleLabelName is the role label name // used for enabling profiling of services on requested nodes NodeObservabilityNodeRoleLabelName = "node-role.kubernetes.io/nodeobservability" // NodeObservabilityNodeRoleName is the nodeobservability node role name NodeObservabilityNodeRoleName = "nodeobservability" // ProfilingMCPName is the name of the MCP created for // applying nodeobservability related MC changes on // nodes with nodeobservability role ProfilingMCPName = "nodeobservability" // ResourceLabelsPath is the path of Labels in resource ResourceLabelsPath = "/metadata/labels" // WorkerNodeMCPName is the name of the MCP created for // applying required MC changes on nodes with worker role WorkerNodeMCPName = "worker" // WorkerNodeRoleLabelName is the role label name used // for worker nodes WorkerNodeRoleLabelName = "node-role.kubernetes.io/worker" // WorkerNodeRoleName is the worker node role name WorkerNodeRoleName = "worker" )
const ( // CrioUnixSocketEnvString refers to the environment variable info // string that helps in finding if the profiling is enabled by default CrioUnixSocketEnvString = "ENABLE_PROFILE_UNIX_SOCKET=true" )
Variables ¶
var ( // NodeSelectorLabels is for storing the labels to // match the nodes to include in MCP NodeSelectorLabels = map[string]string{ NodeObservabilityNodeRoleLabelName: empty, } // MachineConfigLabels is for storing the labels to // add in machine config resources MachineConfigLabels = map[string]string{ MCRoleLabelName: NodeObservabilityNodeRoleName, } )
Functions ¶
Types ¶
type MachineConfigReconciler ¶
type MachineConfigReconciler struct { Log logr.Logger Scheme *runtime.Scheme EventRecorder record.EventRecorder // contains filtered or unexported fields }
MachineConfigReconciler reconciles a NodeObservabilityMachineConfig object
func New ¶
func New(mgr ctrl.Manager) *MachineConfigReconciler
New returns a new MachineConfigReconciler instance.
func (*MachineConfigReconciler) Reconcile ¶
func (r *MachineConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile
Reconcile here is for NodeObservabilityMachineConfig controller, which aims to keep the state as required by the NodeObservability operator. If for any service(ex: CRI-O) requires debugging to be enabled/disabled through the MachineConfigs, controller creates the required MachineConfigs, MachineConfigPool and labels the nodes where the changes are to be applied.
func (*MachineConfigReconciler) SetupWithManager ¶
func (r *MachineConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ResourcePatchValue ¶
type ResourcePatchValue struct { Op string `json:"op"` Path string `json:"path"` Value interface{} `json:"value,omitempty"` }
ResourcePatchValue is for creating the patch request for updating a resource