controllers

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 41 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultContainerdConfigFile indicates default config file path for containerd
	DefaultContainerdConfigFile = "/etc/containerd/config.toml"
	// DefaultContainerdSocketFile indicates default containerd socket file
	DefaultContainerdSocketFile = "/run/containerd/containerd.sock"
	// DefaultDockerConfigFile indicates default config file path for docker
	DefaultDockerConfigFile = "/etc/docker/daemon.json"
	// DefaultDockerSocketFile indicates default docker socket file
	DefaultDockerSocketFile = "/var/run/docker.sock"
	// TrustedCAConfigMapName indicates configmap with custom user CA injected
	TrustedCAConfigMapName = "gpu-operator-trusted-ca"
	// TrustedCABundleFileName indicates custom user ca certificate filename
	TrustedCABundleFileName = "ca-bundle.crt"
	// TrustedCABundleMountDir indicates target mount directory of user ca bundle
	TrustedCABundleMountDir = "/etc/pki/ca-trust/extracted/pem"
	// TrustedCACertificate indicates injected CA certificate name
	TrustedCACertificate = "tls-ca-bundle.pem"
	// VGPULicensingConfigMountPath indicates target mount path for vGPU licensing configuration file
	VGPULicensingConfigMountPath = "/drivers/gridd.conf"
	// VGPULicensingFileName is the vGPU licensing configuration filename
	VGPULicensingFileName = "gridd.conf"
	// DefaultRuntimeClass represents "nvidia" RuntimeClass
	DefaultRuntimeClass = "nvidia"
	// NvidiaDriverRootEnvName represents env name for indicating root directory of driver installation
	NvidiaDriverRootEnvName = "NVIDIA_DRIVER_ROOT"
	// DriverInstallPathVolName represents volume name for driver install path provided to toolkit
	DriverInstallPathVolName = "driver-install-path"
	// DefaultRuntimeSocketTargetDir represents target directory where runtime socket dirctory will be mounted
	DefaultRuntimeSocketTargetDir = "/runtime/sock-dir/"
	// DefaultRuntimeConfigTargetDir represents target directory where runtime socket dirctory will be mounted
	DefaultRuntimeConfigTargetDir = "/runtime/config-dir/"
	// ValidatorImageEnvName indicates env name for validator image passed
	ValidatorImageEnvName = "VALIDATOR_IMAGE"
	// ValidatorImagePullPolicyEnvName indicates env name for validator image pull policy passed
	ValidatorImagePullPolicyEnvName = "VALIDATOR_IMAGE_PULL_POLICY"
	// ValidatorImagePullSecretsEnvName indicates env name for validator image pull secrets passed
	ValidatorImagePullSecretsEnvName = "VALIDATOR_IMAGE_PULL_SECRETS"
	// ValidatorRuntimeClassEnvName indicates env name for validator image pull secrets passed
	ValidatorRuntimeClassEnvName = "VALIDATOR_RUNTIMECLASS"
	// MigStrategyEnvName indicates env name for passing MIG strategy
	MigStrategyEnvName = "MIG_STRATEGY"
)

Variables

This section is empty.

Functions

func ClusterRole

func ClusterRole(n ClusterPolicyController) (gpuv1.State, error)

ClusterRole creates ClusterRole resource

func ClusterRoleBinding

func ClusterRoleBinding(n ClusterPolicyController) (gpuv1.State, error)

ClusterRoleBinding creates ClusterRoleBinding resource

func ConfigMap

func ConfigMap(n ClusterPolicyController) (gpuv1.State, error)

ConfigMap creates ConfigMap resource

func DaemonSet

func DaemonSet(n ClusterPolicyController) (gpuv1.State, error)

DaemonSet creates Daemonset resource

func Deployment

func Deployment(n ClusterPolicyController) (gpuv1.State, error)

Deployment creates Deployment resource

func GetClusterWideProxy

func GetClusterWideProxy() (*apiconfigv1.Proxy, error)

GetClusterWideProxy returns cluster wide proxy object setup in OCP

func Namespace

func Namespace(n ClusterPolicyController) (gpuv1.State, error)

Namespace creates Namespace object

func OpenshiftVersion

func OpenshiftVersion() (string, error)

OpenshiftVersion fetches OCP version

func PodSecurityPolicy

func PodSecurityPolicy(n ClusterPolicyController) (gpuv1.State, error)

PodSecurityPolicy creates PSP resources

func Role

Role creates Role resource

func RoleBinding

func RoleBinding(n ClusterPolicyController) (gpuv1.State, error)

RoleBinding creates RoleBinding resource

func RuntimeClass

func RuntimeClass(n ClusterPolicyController) (gpuv1.State, error)

RuntimeClass creates RuntimeClass object

func SecurityContextConstraints

func SecurityContextConstraints(n ClusterPolicyController) (gpuv1.State, error)

SecurityContextConstraints creates SCC resources

func Service

Service creates Service object

func ServiceAccount

func ServiceAccount(n ClusterPolicyController) (gpuv1.State, error)

ServiceAccount creates ServiceAccount resource

func ServiceMonitor

func ServiceMonitor(n ClusterPolicyController) (gpuv1.State, error)

ServiceMonitor creates ServiceMonitor object

func TransformDCGMExporter

func TransformDCGMExporter(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n ClusterPolicyController) error

TransformDCGMExporter transforms dcgm exporter daemonset with required config as per ClusterPolicy

func TransformDevicePlugin

func TransformDevicePlugin(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n ClusterPolicyController) error

TransformDevicePlugin transforms k8s-device-plugin daemonset with required config as per ClusterPolicy

func TransformDriver

func TransformDriver(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n ClusterPolicyController) error

TransformDriver transforms Nvidia driver daemonset with required config as per ClusterPolicy

func TransformGPUDiscoveryPlugin

func TransformGPUDiscoveryPlugin(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n ClusterPolicyController) error

TransformGPUDiscoveryPlugin transforms GPU discovery daemonset with required config as per ClusterPolicy

func TransformMIGManager

func TransformMIGManager(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n ClusterPolicyController) error

TransformMIGManager transforms MIG Manager daemonset with required config as per ClusterPolicy

func TransformToolkit

func TransformToolkit(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n ClusterPolicyController) error

TransformToolkit transforms Nvidia container-toolkit daemonset with required config as per ClusterPolicy

func TransformValidator

func TransformValidator(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec, n ClusterPolicyController) error

TransformValidator transforms nvidia-operator-validator daemonset with required config as per ClusterPolicy

func TransformValidatorComponent

func TransformValidatorComponent(config *gpuv1.ClusterPolicySpec, podSpec *corev1.PodSpec, component string) error

TransformValidatorComponent applies changes to given validator component

Types

type ClusterPolicyController

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

ClusterPolicyController represents clusterpolicy controller spec for GPU operator

type ClusterPolicyReconciler

type ClusterPolicyReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

ClusterPolicyReconciler reconciles a ClusterPolicy object

func (*ClusterPolicyReconciler) Reconcile

func (r *ClusterPolicyReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the ClusterPolicy object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.7.0/pkg/reconcile

func (*ClusterPolicyReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type Resources

type Resources struct {
	ServiceAccount             corev1.ServiceAccount
	Role                       rbacv1.Role
	RoleBinding                rbacv1.RoleBinding
	ClusterRole                rbacv1.ClusterRole
	ClusterRoleBinding         rbacv1.ClusterRoleBinding
	ConfigMap                  corev1.ConfigMap
	DaemonSet                  appsv1.DaemonSet
	Deployment                 appsv1.Deployment
	Pod                        corev1.Pod
	Service                    corev1.Service
	ServiceMonitor             promv1.ServiceMonitor
	PriorityClass              schedv1.PriorityClass
	Taint                      corev1.Taint
	SecurityContextConstraints secv1.SecurityContextConstraints
	PodSecurityPolicy          policyv1beta1.PodSecurityPolicy
	Namespace                  corev1.Namespace
	RuntimeClass               nodev1.RuntimeClass
}

Resources indicates resources managed by GPU operator

Jump to

Keyboard shortcuts

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