controllers

package
v0.0.0-...-15f5db6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (

	// ConditionAvailable indicates that the resources maintained by the operator,
	// is functional and available in the cluster.
	ConditionAvailable string = "Available"

	// ConditionProgressing indicates that the operator is actively making changes to the resources maintained by the
	// operator
	ConditionProgressing string = "Progressing"

	// ConditionDegraded indicates that the resources maintained by the operator are not functioning completely.
	// An example of a degraded state would be if not all pods in a deployment were running.
	// It may still be available, but it is degraded
	ConditionDegraded string = "Degraded"

	// ConditionUpgradeable indicates whether the resources maintained by the operator are in a state that is safe to upgrade.
	// When `False`, the resources maintained by the operator should not be upgraded and the
	// message field should contain a human readable description of what the administrator should do to
	// allow the operator to successfully update the resources maintained by the operator.
	ConditionUpgradeable string = "Upgradeable"
)

Variables

View Source
var (
	RetryInterval = time.Second * 5
	Timeout       = time.Second * 30
)

Functions

This section is empty.

Types

type NFD

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

NFD holds the needed information to watch from the Controller. The following descriptions elaborate on each field in this struct:

type NodeFeatureDiscoveryReconciler

type NodeFeatureDiscoveryReconciler struct {
	// Client interface to communicate with the API server. Reconciler needs this for
	// fetching objects.
	client.Client

	// Scheme is used by the kubebuilder library to set OwnerReferences. Every
	// controller needs this.
	Scheme *runtime.Scheme

	// Recorder defines interfaces for working with OCP event recorders. This
	// field is needed by the operator in order for the operator to write events.
	Recorder record.EventRecorder
}

NodeFeatureDiscoveryReconciler reconciles a NodeFeatureDiscovery object

func (*NodeFeatureDiscoveryReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*NodeFeatureDiscoveryReconciler) SetupWithManager

func (r *NodeFeatureDiscoveryReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with a specified manager responsible for initializing shared dependencies (like caches and clients)

type ResourceStatus

type ResourceStatus int

ResourceStatus defines the status of the resource as being Ready or NotReady

const (
	Ready ResourceStatus = iota
	NotReady
)

func ClusterRole

func ClusterRole(n NFD) (ResourceStatus, error)

ClusterRole checks if the ClusterRole exists, and creates it if it doesn't

func ClusterRoleBinding

func ClusterRoleBinding(n NFD) (ResourceStatus, error)

ClusterRoleBinding checks if a ClusterRoleBinding exists and creates one if it doesn't

func ConfigMap

func ConfigMap(n NFD) (ResourceStatus, error)

ConfigMap checks if a ConfigMap exists and creates one if it doesn't

func DaemonSet

func DaemonSet(n NFD) (ResourceStatus, error)

DaemonSet checks the readiness of a DaemonSet and creates one if it doesn't exist

func Deployment

func Deployment(n NFD) (ResourceStatus, error)

Deployment checks the readiness of a Deployment and creates one if it doesn't exist

func Job

func Job(n NFD) (ResourceStatus, error)

Job checks the readiness of a Job and creates one if it doesn't exist

func Role

func Role(n NFD) (ResourceStatus, error)

Role checks if a Role exists and creates a Role if it doesn't

func RoleBinding

func RoleBinding(n NFD) (ResourceStatus, error)

RoleBinding checks if a RoleBinding exists and creates a RoleBinding if it doesn't

func SecurityContextConstraints

func SecurityContextConstraints(n NFD) (ResourceStatus, error)

SecurityContextConstraints attempts to create SecurityContextConstraints in a given Namespace. If the scc already exists, then attempt to update it.

func Service

func Service(n NFD) (ResourceStatus, error)

Service checks if a Service exists and creates one if it doesn't exist

func ServiceAccount

func ServiceAccount(n NFD) (ResourceStatus, error)

ServiceAccount checks the readiness of the NFD ServiceAccount and creates it if it doesn't exist

func (ResourceStatus) String

func (s ResourceStatus) String() string

String implements the fmt.Stringer interface and returns describes ResourceStatus as a string.

type Resources

type Resources struct {
	Namespace                  corev1.Namespace
	ServiceAccount             corev1.ServiceAccount
	Role                       rbacv1.Role
	RoleBinding                rbacv1.RoleBinding
	ClusterRole                rbacv1.ClusterRole
	ClusterRoleBinding         rbacv1.ClusterRoleBinding
	ConfigMap                  corev1.ConfigMap
	DaemonSet                  appsv1.DaemonSet
	Job                        batchv1.Job
	Deployment                 appsv1.Deployment
	Pod                        corev1.Pod
	Service                    corev1.Service
	SecurityContextConstraints secv1.SecurityContextConstraints
}

Resources holds objects owned by NFD

type Status

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

The status of the resource (available, upgradeable, progressing, or degraded).

Jump to

Keyboard shortcuts

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