package
0.0.0-20240815173558-303cc3735024
Repository: https://github.com/libopenstorage/operator.git
Documentation: pkg.go.dev
# Functions
AppendTLSEnv checks if tls is enabled.
AppendUserVolumeMounts appends "user" vol specs to the pod spec - note, the user volume specs will override container mounts, if the mount destination directory is the same - caveat: caller needs to ensure that the volume specs NAMES are unique.
ApplyStorageClusterSettingsToPodSpec applies settings from StorageCluster to pod spec of any component Which includes: - custom image registry for images - ImagePullPolicy - ImagePullSecret - affinity - toleration.
No description provided by the author
AuthEnabled checks if the auth is set for a cluster.
No description provided by the author
No description provided by the author
CountStorageNodes counts how many px storage node are there on given k8s cluster, use this to count number of storage pods as well.
CSRAutoApprovalEnabled returns true if CSR auto-approval is not explicitly disabled.
DisableCSIAlpha returns true if the cluster env variables has a variable to disable CSI alpha features, else returns false.
EncodeBase64 encode a given src byte slice.
EssentialsEnabled returns true if the env var has an override to deploy an PX Essentials cluster.
GenerateToken generates an auth token given a secret key.
GetCloudDriveConfigMapName gets name of cloud drive configMap.
GetCloudProvider returns the cloud provider string.
GetClusterEnvValue helper routine to get the env value from cluster spec.
GetClusterEnvVarValue returns the environment variable value for a cluster.
GetClusterID returns portworx instance cluster ID.
GetDialOptions is a gRPC utility to get dial options for a connection.
GetGrpcConn creates a new gRPC connection to a given endpoint.
GetImageTag returns the tag of the image.
GetInternalEtcdConfigMapName gets name of internal etcd configMap.
No description provided by the author
GetOciMonArgumentsForTLS constructs tls related arguments for oci-mon.
No description provided by the author
GetPortworxConn returns a new Portworx SDK client.
GetPortworxVersion returns the Portworx version based on the Spec data provided.
GetPxProxyEnvVarValue returns the PX_HTTP(S)_PROXY environment variable value for a cluster.
GetSecretKeyValue gets any key value from a k8s secret.
GetSecretValue gets any secret key value from k8s and decodes to a string value.
GetStorageNodeMapping returns a mapping of node name to node ID, as well as the inverse mapping.
No description provided by the author
GetStorkVersion returns the stork version based on the image provided.
GetTLSCipherSuites gets requested TLS ciphers suites and validates it - RETURN: the normalized comma-separated list of cipher suites, or error if requested unknown cipher.
GetTLSMinVersion gets requested TLS version and validates it.
ImagePullPolicy returns the image pull policy from the cluster spec if present, else returns v1.PullAlways.
IncludeCSISnapshotController determines if the end user has indicated whether or not to include the CSI snapshot-controller.
IsAKS returns true if the annotation has an AKS annotation and is true value.
IsCCMGoSupported returns true if px version is higher than 2.12.
IsCOSupported returns true if px version is >= than MinimumPxVersionCO & ccm-go >= MinimumCcmGoVersionCO.
IsCSIEnabled returns true if CSI is not disabled by the feature flag.
IsEKS returns true if the annotation has an EKS annotation and is true value.
IsEmptyOrNilCertLocation is a helper function that checks whether a CertLocation is empty.
IsEmptyOrNilSecretReference is a helper function that checks whether a SecretRef is empty.
IsEmptyOrNilStringPtr is a helper function that checks whether a string pointer is pointing to a non-empty string.
IsFreshInstall checks whether it's a fresh Portworx install.
IsGKE returns true if the annotation has a GKE annotation and is true value.
IsHostPidEnabled returns if hostPid should be set to true for portworx pod.
IsIKS returns true if the annotation has an IKS annotation and is true value.
No description provided by the author
IsMetricsCollectorSupported returns true if px version is higher than 2.9.1.
IsOKE returns true if the annotation has a OKE annotation and is true value.
IsOpenshift returns true if the annotation has an OpenShift annotation and is true value.
IsPKS returns true if the annotation has a PKS annotation and is true value.
IsPortworxEnabled returns true if portworx is not explicitly disabled using the annotation.
IsPrivileged returns true "privileged" annotation is MISSING, or NOT set to FALSE.
IsPure true if PURE_FLASHARRAY_SAN_TYPE is present in the spec.
IsPxRepoEnabled returns true is pxRepo is enabled.
IsStorkEnabled returns true is Stork scheduler is enabled in StorageCluster.
No description provided by the author
IsTelemetryEnabled returns true is telemetry is enabled.
IsTLSEnabled checks if TLS is enabled for the operator.
IsTLSEnabledOnCluster checks if TLS is enabled on the StorageCluster spec.
IsVsphere returns true if VSPHERE_VCENTER is present in the spec.
KubeletPath returns the kubelet path.
No description provided by the author
MiscArgs returns the miscellaneous arguments from the cluster's annotations.
NewCSIGenerator returns a version generator.
Get list of storagenodes that are a part of the current cluster that need a node PDB.
List of nodes that have an existing pdb but are no longer in k8s cluster or not a portworx storage node.
ParseExtendedDuration returns the duration associated with a string This function supports seconds, minutes, hours, days, and years.
ParsePxProxy trims protocol prefix then splits the proxy address of the form "host:port" with possible basic authentication credential.
PodDisruptionBudgetEnabled returns true if the annotation is absent, or does not have a false value.
PodSecurityPolicyEnabled returns true if the PSP annotation is present and has true value.
PortworxServiceAccountName returns name of the portworx service account.
RunOnMaster returns true if the annotation has truth value for running on master.
SelectorLabels returns the labels that are used to select Portworx pods.
ServiceType returns the k8s service type from cluster annotations if present 1.
No description provided by the author
SetupContextWithToken Gets token or from secret for authenticating with the SDK server.
ShouldUseClusterDomain checks if the node should use the cluster domain field to decide storage status.
ShouldUseQuorumFlag checks if the node should use the quorum member flag to decide storage status.
StartPort returns the start from the cluster if present, else return the default start port.
StorageClassEnabled returns true if default portworx storage classes are disabled.
StorageClusterKind returns the GroupVersionKind for StorageCluster.
UseDeprecatedCSIDriverName returns true if the cluster env variables has an override, else returns false.
UserVolumeName returns modified volume name for the user given volume name.
# Constants
AnnotationAppArmorPrefix controls which AppArmor profile will be used per container.
AnnotationAutopilotCPU annotation for overriding the default CPU for Autopilot.
AnnotationClusterID overwrites portworx cluster ID, which is the storage cluster name by default.
AnnotationDisableCSRAutoApprove annotation will disable CSR auto-approval.
AnnotationDisableStorageClass annotation to disable installing default portworx storage classes.
AnnotationDNSPolicy configures dns policy for portworx pod.
AnnotationFACDTopology is added when FACD topology was successfully installed on a *new* cluster (it's blocked for existing clusters).
AnnotationHostPid configures hostPid flag for portworx pod.
AnnotationIsAKS annotation indicating whether it is an AKS cluster.
AnnotationIsEKS annotation indicating whether it is an EKS cluster.
AnnotationIsGKE annotation indicating whether it is a GKE cluster.
AnnotationIsIKS annotation indicating whether it is an IKS cluster.
AnnotationIsOKE annotation indicating whether it is a OKE cluster.
AnnotationIsOpenshift annotation indicating whether it is an OpenShift cluster.
AnnotationIsPKS annotation indicating whether it is a PKS cluster.
AnnotationIsPrivileged [=false] used to remove privileged containers requirement.
AnnotationLogFile annotation to specify the log file path where portworx logs need to be redirected.
AnnotationMiscArgs annotation to specify miscellaneous arguments that will be passed to portworx container directly without any interpretation.
AnnotationPodDisruptionBudget annotation indicating whether to create pod disruption budgets.
AnnotationPodSecurityPolicy annotation indicating whether to enable creation of pod security policies.
AnnotationPortworxProxy annotation indicating whether to enable creation of portworx proxy for Portworx in-tree driver.
AnnotationPreflightCheck do preflight check before installing Portworx.
AnnotationPVCController annotation indicating whether to deploy a PVC controller.
AnnotationPVCControllerCPU annotation for overriding the default CPU for PVC controller deployment.
AnnotationPVCControllerPort annotation for overriding the default port for PVC controller deployment.
AnnotationPVCControllerSecurePort annotation for overriding the default secure port for PVC controller deployment.
AnnotationPXVersion annotation indicating the portworx semantic version.
AnnotationRunOnMaster annotation to enable running Portworx on master nodes.
AnnotationDisableCSRAutoApprove annotation to set priority for SCCs.
AnnotationServerTLSCipherSuites sets up TLS-servers w/ requested cipher suites.
AnnotationServerTLSMinVersion sets up TLS-servers w/ requested TLS as minimal version.
AnnotationServiceType annotation indicating k8s service type for all services deployed by the operator.
AnnotationStoragePodDisruptionBudget annotation to specify the min available value of the px-storage pod disruption budget.
AnnotationStorkVersion annotation indicating the stork semantic version.
AnnotationTelemetryArcusLocation annotation indicates the location (internal/external) of Arcus that CCM should use.
No description provided by the author
CloudDriveConfigMapPrefix is prefix of the cloud drive configmap.
No description provided by the author
No description provided by the author
CSIDriverName name of the portworx CSI driver.
CSIRegistrarContainerName name of the Portworx CSI node driver registrar container.
DefaultCASecretKey is the default value for EnvKeyCASecretKey.
DefaultCASecretName is the default value for EnvKeyCASecretName.
DefaultOpenshiftStartPort is the default start port for Portworx on OpenShift.
DefaultPortworxServiceAccountName default name of the Portworx service account.
DefaultStartPort is the default start port for Portworx.
DefaultTLSCACertMountPath is the fixed location on the runc container where the CA cert will be mounted.
DefaultTLSServerCertMountPath is the fixed location on the runc container where the server cert will be mounted.
DefaultTLSServerKeyMountPath is the fixed location on the runc container where the server key will be mounted.
DeprecatedCSIDriverName old name of the portworx CSI driver.
DriverName name of the portworx driver.
Dummy Secret value for authentication when Security is disabled.
EnvKeyCASecretKey env var for the name of the key in the k8s secret which will retrieve the CA cert needed to connect to portworx when TLS is enabled.
EnvKeyCASecretName env var for the name of the k8s secret containing the CA cert needed to connect to portworx when TLS is enabled.
EnvKeyDeprecatedCSIDriverName key for the env var that can force Portworx to use the deprecated CSI driver name.
EnvKeyDisableCSIAlpha key for the env var that is used to disable CSI alpha features.
EnvKeyKubeletDir env var to set custom kubelet directory.
EnvKeyMarketplaceName env var for the name of the source marketplace.
EnvKeyPortworxAuthJwtIssuer is an environment variable defining the PX Security JWT Issuer.
EnvKeyPortworxAuthJwtSharedSecret is an environment variable defining the PX Security JWT secret.
EnvKeyPortworxAuthStorkKey is an environment variable for the auth secret that stork and the operator use to communicate with portworx.
EnvKeyPortworxAuthSystemAppsKey is an environment variable defining the PX Security shared secret for Portworx Apps.
EnvKeyPortworxAuthSystemKey is the environment variable name for the PX security secret.
EnvKeyPortworxEnableTLS is a flag for enabling operator TLS with PX.
TLS related constants.
EnvKeyPortworxEssentials env var to deploy Portworx Essentials cluster.
EnvKeyPortworxHTTPProxy env var to use http proxy.
EnvKeyPortworxHTTPSProxy env var to use https proxy.
EnvKeyPortworxNamespace key for the env var which tells namespace in which Portworx is installed.
EnvKeyPortworxSecretsNamespace key for the env var which tells the namespace where portworx should look for secrets.
EnvKeyPortworxServiceAccount key for the env var which tells custom Portworx service account.
EnvKeyPortworxServiceAccountTokenExpirationMinutes key for the env var which tells after how many minutes thg service account token will expire.
EnvKeyPortworxServiceName key for the env var which tells the name of the portworx service to be used.
EnvKeyPXImage key for the environment variable that specifies Portworx image.
EnvKeyPXReleaseManifestURL key for the environment variable that specifies release manifest.
EnvKeyPXSharedSecret is an environment variable defining the shared secret.
EnvKeyStorkPXJwtIssuer is an environment variable defining the jwt issuer for Stork.
ErrMsgGrpcConnection error message if failed to connect to GRPC server.
EssentialsOSBEndpointKey is the secret key for Essentials OSB endpoint.
EssentialsSecretName name of the Portworx Essentials secret.
EssentialsUserIDKey is the secret key for Essentials user ID.
FeatureCSI is DEPRECATED.
HttpProtocolPrefix is the prefix for HTTP protocol.
HttpsProtocolPrefix is the prefix for HTTPS protocol.
ImageNamePause is the container image to use for the pause container.
InternalEtcdConfigMapPrefix is prefix of the internal kvdb configmap.
NdoeLabelPortworxVersion is the label key in the node labels that has the Portworx version of that node.
No description provided by the author
No description provided by the author
OpenshiftMonitoringRouteName namespace of OCP user-workload route.
OpenshiftMonitoringRouteName name of OCP user-workload route.
No description provided by the author
PortworxComponentName name of portworx component to show in the cluster conditions.
PortworxKVDBPortName name of the Portworx internal KVDB port.
PortworxKVDBServiceName name of the Portworx KVDB Kubernetes service.
PortworxRESTPortName name of the Portworx API port.
PortworxRESTTLSPortName name of the Portworx API port that is secured through TLS.
PortworxSDKPortName name of the Portworx SDK port.
PortworxServiceAccountTokenSecretName is the secret name for storing the service account token for px to communicate with k8s.
PortworxServiceName name of the Portworx Kubernetes service.
PortworxSpecsDir is the directory where all the Portworx specs are stored.
pxEntriesKey is key which holds all the bootstrap entries.
SecurityAppsSecretKey is the secret key for the apps issuer.
SecurityAuthTokenKey is the key for accessing a PX auth token in a k8s secret.
SecurityPortworxAppsIssuer is the issuer for portworx apps to communicate with the PX SDK.
SecurityPortworxStorkIssuer is the issuer for stork to communicate with the PX SDK pre-2.6.
SecurityPXAdminTokenSecretName is the secret name for storing an auto-generated admin token.
SecurityPXSharedSecretSecretName is the secret name for the PX Security shared secret.
SecurityPXSystemSecretsSecretName is the secret name for PX security system secrets.
SecurityPXUserTokenSecretName is the secret name for storing an auto-generated user token.
SecuritySharedSecretKey is the key for accessing the jwt shared secret.
SecuritySystemSecretKey is the key for accessing the system secret auth key.
TelemetryCertName is name of the telemetry cert.
TelemetryContainerName name of the Portworx telemetry container.
VsphereInstallModeLocal env value for Vsphere 'local' install.
OS name for windows node.
# Variables
ConfigMapNameRegex regex of configMap.
MinimumCcmGoVersionCO minimum ccm-go version to use 'container orchestrator'.
MinimumPxVersionAutoTLS is a minimal PX version that supports "auto-TLS" setup.
MinimumPxVersionCCM minimum PX version to install ccm.
MinimumPxVersionCCMGO minimum PX version to install ccm-go.
MinimumPxVersionClusterDomain is a minimal PX version that exposes cluster domain field in enumerate nodes response.
MinimumPxVersionCO minimum PX version to use 'container orchestrator'.
MinimumPxVersionMetricsCollector minimum PX version to install metrics collector.
MinimumPxVersionQuorumFlag is a minimal PX version that introduces the quorum member flag in the node object of the PX SDK response.
MinimumSupportedK8sVersion minimum k8s version PX supports.
ParallelUpgradePDBVersion is the portworx version from which parallel upgrades is supported.
SpecsBaseDir functions returns the base directory for specs.
# Structs
CSIConfiguration holds the versions of the all the CSI sidecar containers, containers, CSI Version, and other flags.
CSIGenerator contains information needed to generate CSI side car versions.
CSIImages holds the images of all the CSI sidecar containers.
# Type aliases
Feature is the enum type for different features.