installer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TridentAppLabelKey = "app"

	TridentLegacyLabelKey   = TridentAppLabelKey
	TridentLegacyLabelValue = "trident.netapp.io"
	TridentLegacyLabel      = TridentLegacyLabelKey + "=" + TridentLegacyLabelValue

	TridentCSILabelKey   = TridentAppLabelKey
	TridentCSILabelValue = "controller.csi.trident.netapp.io"
	TridentCSILabel      = TridentCSILabelKey + "=" + TridentCSILabelValue

	TridentPersistentObjectLabelKey   = "object"
	TridentPersistentObjectLabelValue = "persistent.trident.netapp.io"
	TridentPersistentObjectLabel      = TridentPersistentObjectLabelKey + "=" + TridentPersistentObjectLabelValue

	// Constants used for various resource names
	TridentCSI        = "trident-csi"
	TridentCSIWindows = "trident-csi-windows"
	TridentLegacy     = "trident"
	OpenShiftSCCName  = "trident"

	TridentControllerResourceName  = "trident-controller"
	TridentNodeLinuxResourceName   = "trident-node-linux"
	TridentNodeWindowsResourceName = "trident-node-windows"

	TridentEncryptionKeys = "trident-encryption-keys"

	CSIDriver  = "csi.trident.netapp.io"
	TridentPSP = "tridentpods"

	TridentNodeLabelKey   = TridentAppLabelKey
	TridentNodeLabelValue = "node.csi.trident.netapp.io"
	TridentNodeLabel      = TridentNodeLabelKey + "=" + TridentNodeLabelValue

	TridentVersionPodLabelKey   = TridentAppLabelKey
	TridentVersionPodLabelValue = "pod.version.trident.netapp.io"
	TridentVersionPodLabel      = TridentVersionPodLabelKey + "=" + TridentVersionPodLabelValue

	// This is used to Watch and List for deployment matching Trident CSI and Legacy labels
	LabelSelector = TridentAppLabelKey + " in (" + TridentCSILabelValue + ", " + TridentLegacyLabelValue + ")"

	// This is the key that stored in the objects created by the CR, value is decided based on the K8s version
	K8sVersionLabelKey = "k8s_version"

	ControllerServer = "127.0.0.1:8000"
	TridentContainer = "trident-main"

	// DefaultLogFormat is the the Trident logging format (text, json)
	DefaultLogFormat = "text"

	// DefaultProbePort is Trident's default port for K8S liveness/readiness probes
	DefaultProbePort = "17546"

	// DefaultKubeletDir is the host location of kubelet's internal state
	DefaultKubeletDir = "/var/lib/kubelet"

	CRAPIVersionKey = "apiVersion"
	CRController    = "controller"
	CRKind          = "kind"
	CRName          = "name"
	CRUID           = "uid"
)
View Source
const (
	// CRD names
	BackendCRDName            = "tridentbackends.trident.netapp.io"
	BackendConfigCRDName      = "tridentbackendconfigs.trident.netapp.io"
	MirrorRelationshipCRDName = "tridentmirrorrelationships.trident.netapp.io"
	SnapshotInfoCRDName       = "tridentsnapshotinfos.trident.netapp.io"
	NodeCRDName               = "tridentnodes.trident.netapp.io"
	StorageClassCRDName       = "tridentstorageclasses.trident.netapp.io"
	TransactionCRDName        = "tridenttransactions.trident.netapp.io"
	VersionCRDName            = "tridentversions.trident.netapp.io"
	VolumeCRDName             = "tridentvolumes.trident.netapp.io"
	VolumePublicationCRDName  = "tridentvolumepublications.trident.netapp.io"
	SnapshotCRDName           = "tridentsnapshots.trident.netapp.io"
	VolumeReferenceCRDName    = "tridentvolumereferences.trident.netapp.io"

	VolumeSnapshotCRDName        = "volumesnapshots.snapshot.storage.k8s.io"
	VolumeSnapshotClassCRDName   = "volumesnapshotclasses.snapshot.storage.k8s.io"
	VolumeSnapshotContentCRDName = "volumesnapshotcontents.snapshot.storage.k8s.io"

	DefaultTimeout = 30
)

Variables

View Source
var (
	DefaultTridentVersion = config.DefaultOrchestratorVersion

	DefaultTridentRepo = "netapp/trident:" // Default repo from where to pull Trident Image

	// TridentImage is the image that the operator installs by default
	TridentImage = DefaultTridentRepo + DefaultTridentVersion

	// This gets stored in the objects created by the CR
	TridentVersionLabelKey   = "trident_version"
	TridentVersionLabelValue = "v" + DefaultTridentVersion // need to append 'v', otherwise label freaks out
	TridentVersionLabel      = TridentVersionLabelKey + "=" + TridentVersionLabelValue
)

Functions

This section is empty.

Types

type ExtendedK8sClient

type ExtendedK8sClient interface {
	k8sclient.KubernetesClient

	CreateCustomResourceDefinition(crdName, crdYAML string) error
	PutCustomResourceDefinition(
		currentCRD *apiextensionv1.CustomResourceDefinition, crdName string, createCRD bool, newCRDYAML string,
	) error
	WaitForCRDEstablished(crdName string, timeout time.Duration) error
	DeleteCustomResourceDefinition(crdName, crdYAML string) error

	GetCSIDriverInformation(csiDriverName, appLabel string, shouldUpdate bool) (*storagev1.CSIDriver,
		[]storagev1.CSIDriver, bool, error)
	PutCSIDriver(currentCSIDriver *storagev1.CSIDriver, createCSIDriver bool, newCSIDriverYAML, appLabel string) error
	DeleteCSIDriverCR(csiDriverName, appLabel string) error
	RemoveMultipleCSIDriverCRs(unwantedCSIDriverCRs []storagev1.CSIDriver) error

	GetClusterRoleInformation(clusterRoleNames []string, appLabel string, shouldUpdate bool) (
		map[string]*rbacv1.ClusterRole, []rbacv1.ClusterRole, map[string]bool, error)
	PutClusterRole(
		currentClusterRole *rbacv1.ClusterRole, createClusterRole bool, newClusterRoleYAML, appLabel string,
	) error
	DeleteTridentClusterRole(clusterRoleNames []string, appLabel string) error
	RemoveMultipleClusterRoles(unwantedClusterRoles []rbacv1.ClusterRole) error

	GetClusterRoleBindingInformation(
		clusterRoleBindingNames []string, appLabel string, shouldUpdate bool,
	) (map[string]*rbacv1.ClusterRoleBinding,
		[]rbacv1.ClusterRoleBinding, map[string]bool, error)
	PutClusterRoleBinding(
		currentClusterRoleBinding *rbacv1.ClusterRoleBinding, createClusterRoleBinding bool,
		newClusterRoleBindingYAML, appLabel string,
	) error
	DeleteTridentClusterRoleBinding(clusterRoleBindingNames []string, appLabel string) error
	RemoveMultipleClusterRoleBindings(unwantedClusterRoleBindings []rbacv1.ClusterRoleBinding) error

	GetResourceQuotaInformation(resourceQuotaName, appLabel, namespace string) (*corev1.ResourceQuota,
		[]corev1.ResourceQuota, bool, error)
	PutResourceQuota(
		currentResourceQuota *corev1.ResourceQuota, createResourceQuota bool, newDeploymentYAML, appLabel string,
	) error
	DeleteTridentResourceQuota(nodeLabel string) error
	RemoveMultipleResourceQuotas(unwantedResourceQuotas []corev1.ResourceQuota) error

	GetDaemonSetInformation(nodeLabel, namespace string, isWindows bool) (*appsv1.DaemonSet, []appsv1.DaemonSet, bool,
		error)
	PutDaemonSet(
		currentDaemonSet *appsv1.DaemonSet, createDaemonSet bool, newDaemonSetYAML, nodeLabel, daemonSetName string,
	) error
	DeleteTridentDaemonSet(nodeLabel string) error
	RemoveMultipleDaemonSets(unwantedDaemonSets []appsv1.DaemonSet) error

	GetDeploymentInformation(deploymentName, appLabel, namespace string) (*appsv1.Deployment, []appsv1.Deployment, bool,
		error)
	PutDeployment(currentDeployment *appsv1.Deployment, createDeployment bool, newDeploymentYAML, appLabel string) error
	DeleteTridentDeployment(appLabel string) error
	RemoveMultipleDeployments(unwantedDeployments []appsv1.Deployment) error

	GetPodSecurityPolicyInformation(pspName, appLabel string, shouldUpdate bool) (*policyv1beta1.PodSecurityPolicy,
		[]policyv1beta1.PodSecurityPolicy, bool, error)
	PutPodSecurityPolicy(currentPSP *policyv1beta1.PodSecurityPolicy, createPSP bool, newPSPYAML, appLabel string) error
	DeleteTridentPodSecurityPolicy(pspName, appLabel string) error
	RemoveMultiplePodSecurityPolicies(unwantedPSPs []policyv1beta1.PodSecurityPolicy) error

	GetSecretInformation(secretName, appLabel, namespace string, shouldUpdate bool) (*corev1.Secret,
		[]corev1.Secret, bool, error)
	PutSecret(createSecret bool, newSecretYAML, secretName string) error
	DeleteTridentSecret(secretName, appLabel, namespace string) error
	RemoveMultipleSecrets(unwantedSecrets []corev1.Secret) error

	GetServiceInformation(serviceName, appLabel, namespace string, shouldUpdate bool) (*corev1.Service,
		[]corev1.Service, bool, error)
	PutService(currentService *corev1.Service, createService bool, newServiceYAML, appLabel string) error
	DeleteTridentService(serviceName, appLabel, namespace string) error
	RemoveMultipleServices(unwantedServices []corev1.Service) error

	GetServiceAccountInformation(
		serviceAccountNames []string, appLabel, namespace string, shouldUpdate bool,
	) (map[string]*corev1.ServiceAccount,
		[]corev1.ServiceAccount, map[string][]string, map[string]bool, error)
	PutServiceAccount(
		currentServiceAccount *corev1.ServiceAccount, createServiceAccount bool, newServiceAccountYAML, appLabel string,
	) (bool,
		error)
	DeleteTridentServiceAccount(serviceAccountNames []string, appLabel, namespace string) error
	RemoveMultipleServiceAccounts(unwantedServiceAccounts []corev1.ServiceAccount) error

	GetTridentOpenShiftSCCInformation(openShiftSCCNames, openShiftSCCUserNames []string, shouldUpdate bool) (map[string][]byte,
		map[string]bool, map[string]bool, error)
	PutOpenShiftSCC(
		currentOpenShiftSCCJSON []byte,
		createOpenShiftSCC bool, newOpenShiftSCCYAML string,
	) error
	DeleteOpenShiftSCC(
		openShiftSCCUserNames, openShiftSCCNames []string,
		appLabelValue string,
	) error

	DeleteTridentStatefulSet(appLabel string) error
	RemoveMultipleStatefulSets(unwantedStatefulSets []appsv1.StatefulSet) error

	DeleteTransientVersionPod(tridentVersionPodLabel string) error
	RemoveMultiplePods(unwantedPods []corev1.Pod) error

	ExecPodForVersionInformation(podName string, cmd []string, timeout time.Duration) ([]byte, error)
	GetCSISnapshotterVersion(currentDeployment *appsv1.Deployment) string
}

ExtendedK8sClient extends the vanilla k8s client Interface and is responsible for enabling the TridentInstaller.

func NewExtendedK8sClient

func NewExtendedK8sClient(kubeConfig *rest.Config, namespace string, k8sTimeout time.Duration) (ExtendedK8sClient,
	error,
)

NewExtendedK8sClient returns a concrete ExtendedK8sClient object

type Installer

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

func (*Installer) CreateOrPatchCRD

func (i *Installer) CreateOrPatchCRD(crdName, crdYAML string, performOperationOnce bool) error

CreateOrPatchCRD creates and establishes a CRD or patches an existing one. TODO: Once Trident v22.01 approaches EOL or CRD versioning schema is established,

re-evaluate if performOperationOnce is necessary.

func (*Installer) InstallOrPatchTrident

func (i *Installer) InstallOrPatchTrident(
	cr netappv1.TridentOrchestrator, currentInstallationVersion string, k8sUpdateNeeded, crdUpdateNeeded bool,
) (*netappv1.TridentOrchestratorSpecValues, string, error)

func (*Installer) ObliviateCRDs

func (i *Installer) ObliviateCRDs() error

func (*Installer) TridentDaemonSetInformation

func (i *Installer) TridentDaemonSetInformation() (*appsv1.DaemonSet,
	[]appsv1.DaemonSet, bool, error,
)

TridentDaemonSetInformation identifies the Operator based Trident CSI daemonset and unwanted daemonsets, this method can be used for multiple purposes at different point during the Reconcile so it makes sense to keep it separate from the createOrPatchTridentDaemonSet

func (*Installer) TridentDeploymentInformation

func (i *Installer) TridentDeploymentInformation(
	deploymentLabel string,
) (*appsv1.Deployment, []appsv1.Deployment, bool, error)

TridentDeploymentInformation identifies the Operator based Trident CSI deployment and unwanted deployments, this method can be used for multiple purposes at different point during the Reconcile so it makes sense to keep it separate from the createOrPatchTridentDeployment

func (*Installer) UninstallCSIPreviewTrident

func (i *Installer) UninstallCSIPreviewTrident() error

func (*Installer) UninstallLegacyTrident

func (i *Installer) UninstallLegacyTrident() error

func (*Installer) UninstallTrident

func (i *Installer) UninstallTrident() error

type K8sClient

type K8sClient struct {
	k8sclient.KubernetesClient
}

K8sClient is a method receiver that implements the ExtendedK8sClient interface

func (*K8sClient) CreateCustomResourceDefinition

func (k *K8sClient) CreateCustomResourceDefinition(crdName, crdYAML string) error

CreateCustomResourceDefinition creates a CRD.

func (*K8sClient) DeleteCSIDriverCR

func (k *K8sClient) DeleteCSIDriverCR(csiDriverName, appLabel string) error

DeleteCSIDriverCR deletes a CSI Driver.

func (*K8sClient) DeleteCustomResourceDefinition

func (k *K8sClient) DeleteCustomResourceDefinition(crdName, crdYAML string) error

DeleteCustomResourceDefinition deletes a CRD.

func (*K8sClient) DeleteOpenShiftSCC

func (k *K8sClient) DeleteOpenShiftSCC(
	openShiftSCCUserNames, openShiftSCCNames []string,
	appLabelValue string,
) error

DeleteOpenShiftSCC deletes an Operator-based OpenShiftSCC associated with Trident.

func (*K8sClient) DeleteTransientVersionPod

func (k *K8sClient) DeleteTransientVersionPod(versionPodLabel string) error

DeleteTransientVersionPod deletes the temporary version pod used by the operator

func (*K8sClient) DeleteTridentClusterRole

func (k *K8sClient) DeleteTridentClusterRole(clusterRoleNames []string, appLabel string) error

DeleteTridentClusterRole deletes Cluster Role(s) associated with Trident.

func (*K8sClient) DeleteTridentClusterRoleBinding

func (k *K8sClient) DeleteTridentClusterRoleBinding(clusterRoleBindingNames []string, appLabel string) error

DeleteTridentClusterRoleBinding deletes Cluster Role Binding(s) associated with Trident.

func (*K8sClient) DeleteTridentDaemonSet

func (k *K8sClient) DeleteTridentDaemonSet(nodeLabel string) error

DeleteTridentDaemonSet deletes a Trident DaemonSet.

func (*K8sClient) DeleteTridentDeployment

func (k *K8sClient) DeleteTridentDeployment(appLabel string) error

DeleteTridentDeployment deletes a Trident Deployment.

func (*K8sClient) DeleteTridentPodSecurityPolicy

func (k *K8sClient) DeleteTridentPodSecurityPolicy(pspName, appLabel string) error

DeleteTridentPodSecurityPolicy deletes a PSP.

func (*K8sClient) DeleteTridentResourceQuota

func (k *K8sClient) DeleteTridentResourceQuota(nodeLabel string) error

DeleteTridentResourceQuota deletes a Trident Resource Quota.

func (*K8sClient) DeleteTridentSecret

func (k *K8sClient) DeleteTridentSecret(secretName, appLabel, namespace string) error

DeleteTridentSecret deletes a Secret associated with Trident.

func (*K8sClient) DeleteTridentService

func (k *K8sClient) DeleteTridentService(serviceName, appLabel, namespace string) error

DeleteTridentService deletes an Operator-based Service associated with Trident.

func (*K8sClient) DeleteTridentServiceAccount

func (k *K8sClient) DeleteTridentServiceAccount(serviceAccountNames []string, appLabel, namespace string) error

DeleteTridentServiceAccount deletes an Operator-based Service Account associated with Trident.

func (*K8sClient) DeleteTridentStatefulSet

func (k *K8sClient) DeleteTridentStatefulSet(appLabel string) error

DeleteTridentStatefulSet deletes an Operator-based StatefulSet associated with Trident.

func (*K8sClient) ExecPodForVersionInformation

func (k *K8sClient) ExecPodForVersionInformation(podName string, cmd []string, timeout time.Duration) ([]byte, error)

ExecPodForVersionInformation takes the pod name and command to execute the command into the container matching the pod name

func (*K8sClient) GetCSIDriverInformation

func (k *K8sClient) GetCSIDriverInformation(csiDriverName, appLabel string, shouldUpdate bool) (*storagev1.CSIDriver,
	[]storagev1.CSIDriver, bool, error,
)

GetCSIDriverInformation gets the CSI drivers info in a cluster associated with Trident.

func (*K8sClient) GetCSISnapshotterVersion

func (k *K8sClient) GetCSISnapshotterVersion(currentDeployment *appsv1.Deployment) string

GetCSISnapshotterVersion uses the below approach to identify CSI Snapshotter Version: If successful in retrieving the CSI Snapshotter CRD Version, use it as it is Else if failed, then CSI Snapshotter CRD Version will be empty then get existing CSI Snapshotter Version as v1.

func (*K8sClient) GetClusterRoleBindingInformation

func (k *K8sClient) GetClusterRoleBindingInformation(
	clusterRoleBindingNames []string, appLabel string, shouldUpdate bool,
) (map[string]*rbacv1.ClusterRoleBinding,
	[]rbacv1.ClusterRoleBinding, map[string]bool, error,
)

GetClusterRoleBindingInformation gets the info on a Cluster Role Binding associated with Trident.

func (*K8sClient) GetClusterRoleInformation

func (k *K8sClient) GetClusterRoleInformation(clusterRoleNames []string, appLabel string, shouldUpdate bool) (
	map[string]*rbacv1.ClusterRole, []rbacv1.ClusterRole, map[string]bool, error,
)

GetClusterRoleInformation gets the Cluster Role info.

func (*K8sClient) GetDaemonSetInformation

func (k *K8sClient) GetDaemonSetInformation(nodeLabel, namespace string, isWindows bool) (*appsv1.DaemonSet,
	[]appsv1.DaemonSet, bool, error,
)

GetDaemonSetInformation identifies the Operator-based Trident daemonset information and any unwanted daemonsets

func (*K8sClient) GetDeploymentInformation

func (k *K8sClient) GetDeploymentInformation(deploymentName, appLabel, namespace string) (*appsv1.Deployment,
	[]appsv1.Deployment, bool, error,
)

GetDeploymentInformation identifies the Operator-based Trident deployment information and any unwanted deployments

func (*K8sClient) GetPodSecurityPolicyInformation

func (k *K8sClient) GetPodSecurityPolicyInformation(
	pspName, appLabel string, shouldUpdate bool,
) (*policyv1beta1.PodSecurityPolicy,
	[]policyv1beta1.PodSecurityPolicy, bool, error,
)

GetPodSecurityPolicyInformation identifies the Operator-based Trident PSP information and any unwanted PSPs.

func (*K8sClient) GetResourceQuotaInformation

func (k *K8sClient) GetResourceQuotaInformation(
	resourcequotaName, label, namespace string,
) (*corev1.ResourceQuota, []corev1.ResourceQuota, bool, error)

GetResourceQuotaInformation identifies the Operator-based Trident resource quota information and any unwanted resource quotas

func (*K8sClient) GetSecretInformation

func (k *K8sClient) GetSecretInformation(secretName, appLabel, namespace string, shouldUpdate bool) (*corev1.Secret,
	[]corev1.Secret, bool, error,
)

GetSecretInformation identifies the Operator-based Trident Secret information.

func (*K8sClient) GetServiceAccountInformation

func (k *K8sClient) GetServiceAccountInformation(
	serviceAccountNames []string, appLabel, namespace string, shouldUpdate bool,
) (map[string]*corev1.ServiceAccount,
	[]corev1.ServiceAccount, map[string][]string, map[string]bool, error,
)

GetServiceAccountInformation identifies the Operator-based Trident Service Account info and any unwanted Service Accounts.

func (*K8sClient) GetServiceInformation

func (k *K8sClient) GetServiceInformation(serviceName, appLabel, namespace string, shouldUpdate bool) (*corev1.Service,
	[]corev1.Service, bool, error,
)

GetServiceInformation identifies the Operator-based Trident Service information.

func (*K8sClient) GetTridentOpenShiftSCCInformation

func (k *K8sClient) GetTridentOpenShiftSCCInformation(
	openShiftSCCNames, openShiftSCCUserNames []string, shouldUpdate bool,
) (map[string][]byte,
	map[string]bool, map[string]bool, error,
)

GetTridentOpenShiftSCCInformation gets OpenShiftSCC info with a supplied name, username and determines if new OpenShiftSCC should be created

func (*K8sClient) PutCSIDriver

func (k *K8sClient) PutCSIDriver(
	currentCSIDriver *storagev1.CSIDriver, createCSIDriver bool, newCSIDriverYAML, appLabel string,
) error

PutCSIDriver creates or updates a CSI Driver associated with Trident.

func (*K8sClient) PutClusterRole

func (k *K8sClient) PutClusterRole(
	currentClusterRole *rbacv1.ClusterRole, reuseClusterRole bool, newClusterRoleYAML, appLabel string,
) error

PutClusterRole creates or updates a Cluster Role associated with Trident.

func (*K8sClient) PutClusterRoleBinding

func (k *K8sClient) PutClusterRoleBinding(
	currentClusterRoleBinding *rbacv1.ClusterRoleBinding, reuseClusterRoleBinding bool,
	newClusterRoleBindingYAML, appLabel string,
) error

PutClusterRoleBinding creates or updates a Cluster Role Binding associated with Trident.

func (*K8sClient) PutCustomResourceDefinition

func (k *K8sClient) PutCustomResourceDefinition(
	currentCRD *apiextensionv1.CustomResourceDefinition, crdName string, createCRD bool, newCRDYAML string,
) error

PutCustomResourceDefinition ensures a CRD is created and on the most recent CRD version.

func (*K8sClient) PutDaemonSet

func (k *K8sClient) PutDaemonSet(
	currentDaemonSet *appsv1.DaemonSet, createDaemonSet bool, newDaemonSetYAML, nodeLabel, daemonSetName string,
) error

PutDaemonSet creates or updates a Trident DaemonSet.

func (*K8sClient) PutDeployment

func (k *K8sClient) PutDeployment(
	currentDeployment *appsv1.Deployment, createDeployment bool, newDeploymentYAML, appLabel string,
) error

PutDeployment creates or updates a Trident Deployment.

func (*K8sClient) PutOpenShiftSCC

func (k *K8sClient) PutOpenShiftSCC(
	currentOpenShiftSCCJSON []byte,
	reuseOpenShiftSCC bool, newOpenShiftSCCYAML string,
) error

PutOpenShiftSCC creates or updates OpenShiftSCCs associated with Trident.

func (*K8sClient) PutPodSecurityPolicy

func (k *K8sClient) PutPodSecurityPolicy(
	currentPSP *policyv1beta1.PodSecurityPolicy, createPSP bool, newPSPYAML, appLabel string,
) error

PutPodSecurityPolicy creates or updates a PSP.

func (*K8sClient) PutResourceQuota

func (k *K8sClient) PutResourceQuota(
	currentResourceQuota *corev1.ResourceQuota, createResourceQuota bool, newResourceQuotaYAML, appLabel string,
) error

PutResourceQuota will create a new Resource Quota or patch an existing one.

func (*K8sClient) PutSecret

func (k *K8sClient) PutSecret(createSecret bool, newSecretYAML, secretName string) error

PutSecret creates or updates a Secret associated with Trident.

func (*K8sClient) PutService

func (k *K8sClient) PutService(
	currentService *corev1.Service, createService bool, newServiceYAML, appLabel string,
) error

PutService creates or updates a Service associated with Trident.

func (*K8sClient) PutServiceAccount

func (k *K8sClient) PutServiceAccount(
	currentServiceAccount *corev1.ServiceAccount, reuseServiceAccount bool, newServiceAccountYAML, appLabel string,
) (bool,
	error,
)

PutServiceAccount creates or updates a Service Account associated with Trident.

func (*K8sClient) RemoveMultipleCSIDriverCRs

func (k *K8sClient) RemoveMultipleCSIDriverCRs(unwantedCSIDriverCRs []storagev1.CSIDriver) error

RemoveMultipleCSIDriverCRs removes a list of unwanted CSI drivers in a cluster.

func (*K8sClient) RemoveMultipleClusterRoleBindings

func (k *K8sClient) RemoveMultipleClusterRoleBindings(unwantedClusterRoleBindings []rbacv1.ClusterRoleBinding) error

RemoveMultipleClusterRoleBindings removes a list of unwanted cluster role bindings in a cluster.

func (*K8sClient) RemoveMultipleClusterRoles

func (k *K8sClient) RemoveMultipleClusterRoles(unwantedClusterRoles []rbacv1.ClusterRole) error

RemoveMultipleClusterRoles removes a list of unwanted cluster roles in a cluster.

func (*K8sClient) RemoveMultipleDaemonSets

func (k *K8sClient) RemoveMultipleDaemonSets(unwantedDaemonSets []appsv1.DaemonSet) error

RemoveMultipleDaemonSets removes a list of unwanted beta CSI drivers in a namespace

func (*K8sClient) RemoveMultipleDeployments

func (k *K8sClient) RemoveMultipleDeployments(unwantedDeployments []appsv1.Deployment) error

RemoveMultipleDeployments removes a list of unwanted beta CSI drivers in a namespace

func (*K8sClient) RemoveMultiplePodSecurityPolicies

func (k *K8sClient) RemoveMultiplePodSecurityPolicies(unwantedPSPs []policyv1beta1.PodSecurityPolicy) error

RemoveMultiplePodSecurityPolicies removes a list of unwanted pod security policies in a cluster.

func (*K8sClient) RemoveMultiplePods

func (k *K8sClient) RemoveMultiplePods(unwantedPods []corev1.Pod) error

RemoveMultiplePods removes a list of unwanted pods in a namespace

func (*K8sClient) RemoveMultipleResourceQuotas

func (k *K8sClient) RemoveMultipleResourceQuotas(unwantedResourceQuotas []corev1.ResourceQuota) error

RemoveMultipleResourceQuotas removes a list of unwanted resource quotas in a namespace

func (*K8sClient) RemoveMultipleSecrets

func (k *K8sClient) RemoveMultipleSecrets(unwantedSecrets []corev1.Secret) error

RemoveMultipleSecrets removes a list of unwanted secrets in a namespace.

func (*K8sClient) RemoveMultipleServiceAccounts

func (k *K8sClient) RemoveMultipleServiceAccounts(unwantedServiceAccounts []corev1.ServiceAccount) error

RemoveMultipleServiceAccounts removes a list of unwanted service accounts in a namespace

func (*K8sClient) RemoveMultipleServices

func (k *K8sClient) RemoveMultipleServices(unwantedServices []corev1.Service) error

RemoveMultipleServices removes a list of unwanted services in a namespace

func (*K8sClient) RemoveMultipleStatefulSets

func (k *K8sClient) RemoveMultipleStatefulSets(unwantedStatefulSets []appsv1.StatefulSet) error

RemoveMultipleStatefulSets removes a list of unwanted statefulsets in a namespace

func (*K8sClient) WaitForCRDEstablished

func (k *K8sClient) WaitForCRDEstablished(crdName string, timeout time.Duration) error

WaitForCRDEstablished waits until a CRD is Established.

type TridentInstaller

type TridentInstaller interface {
	CreateOrPatchCRD(crdName, crdYAML string, performOperationOnce bool) error
	InstallOrPatchTrident(
		cr v15.TridentOrchestrator, currentInstallationVersion string, shouldUpdate, crdUpdateNeeded bool,
	) (*v15.TridentOrchestratorSpecValues, string, error)
	ObliviateCRDs() error
	TridentDeploymentInformation(deploymentLabel string) (*appsv1.Deployment, []appsv1.Deployment, bool, error)
	TridentDaemonSetInformation() (*appsv1.DaemonSet, []appsv1.DaemonSet, bool, error)
	UninstallTrident() error
	UninstallCSIPreviewTrident() error
	UninstallLegacyTrident() error
}

TridentInstaller is responsible for installing, patching, or uninstalling orchestrator controlled instances of Trident.

func NewInstaller

func NewInstaller(kubeConfig *rest.Config, namespace string, timeout int) (TridentInstaller, error)

Jump to

Keyboard shortcuts

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