common

package
v2.19.8 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ARM64Architecture = "arm64"
	X64Architecture   = "x64"
)
View Source
const (
	MachineDeploymentEventWarningType = "warning"
	MachineDeploymentEventNormalType  = "normal"
)
View Source
const (
	UserClusterComponentKey       = "component"
	UserClusterRoleComponentValue = "userClusterRole"
	UserClusterRoleLabelSelector  = "component=userClusterRole"
)
View Source
const (
	UserClusterBindingComponentValue = "userClusterBinding"
)

Variables

ClusterTypes holds a list of supported cluster types

Functions

func AssignSSHKeyEndpoint added in v2.16.3

func AssignSSHKeyEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID, keyID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, sshKeyProvider provider.SSHKeyProvider, privilegedSSHKeyProvider provider.PrivilegedSSHKeyProvider) (interface{}, error)

func BindUserToClusterRoleEndpoint added in v2.16.3

func BindUserToClusterRoleEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, clusterRoleUser apiv1.ClusterRoleUser, projectID, clusterID, roleID string) (interface{}, error)

func BindUserToRoleEndpoint added in v2.16.3

func BindUserToRoleEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, roleUser apiv1.RoleUser, projectID, clusterID, roleID, namespace string) (interface{}, error)

func ConvertClusterMetrics

func ConvertClusterMetrics(podMetrics *v1beta1.PodMetricsList, nodeMetrics []v1beta1.NodeMetrics, availableNodesResources map[string]corev1.ResourceList, clusterName string) (*apiv1.ClusterMetrics, error)

func ConvertInternalClusterToExternal added in v2.18.0

func ConvertInternalClusterToExternal(internalCluster *kubermaticv1.Cluster, datacenter *kubermaticv1.Datacenter, filterSystemLabels bool, incompatibilities ...*version.ProviderIncompatibility) *apiv1.Cluster

func ConvertNodeMetrics

func ConvertNodeMetrics(metrics []v1beta1.NodeMetrics, availableResources map[string]corev1.ResourceList) ([]apiv1.NodeMetric, error)

func CreateAddonEndpoint added in v2.16.3

func CreateAddonEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, addon apiv1.Addon, projectID, clusterID string) (interface{}, error)

func CreateEndpoint

func CreateEndpoint(
	ctx context.Context,
	projectID string,
	body apiv1.CreateClusterSpec,
	projectProvider provider.ProjectProvider,
	privilegedProjectProvider provider.PrivilegedProjectProvider,
	seedsGetter provider.SeedsGetter,
	credentialManager provider.PresetProvider,
	exposeStrategy kubermaticv1.ExposeStrategy,
	userInfoGetter provider.UserInfoGetter,
	caBundle *x509.CertPool,
	configGetter provider.KubermaticConfigurationGetter,
	features features.FeatureGate,
) (interface{}, error)

func CreateMachineDeployment added in v2.16.3

func CreateMachineDeployment(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, sshKeyProvider provider.SSHKeyProvider, seedsGetter provider.SeedsGetter, machineDeployment apiv1.NodeDeployment, projectID, clusterID string) (interface{}, error)

func CreateOIDCKubeconfigEndpoint added in v2.16.3

func CreateOIDCKubeconfigEndpoint(ctx context.Context, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, oidcIssuerVerifier auth.OIDCIssuerVerifier, oidcCfg common.OIDCConfiguration, req CreateOIDCKubeconfigReq) (interface{}, error)

func DecodeCreateOIDCKubeconfig added in v2.16.3

func DecodeCreateOIDCKubeconfig(c context.Context, r *http.Request) (interface{}, error)

func DeleteAddonEndpoint added in v2.16.3

func DeleteAddonEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, addonID string) (interface{}, error)

func DeleteEndpoint

func DeleteEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, deleteVolumes, deleteLoadBalancers bool, sshKeyProvider provider.SSHKeyProvider, privilegedSSHKeyProvider provider.PrivilegedSSHKeyProvider, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func DeleteMachineDeployment added in v2.16.3

func DeleteMachineDeployment(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, machineDeploymentID string) (interface{}, error)

func DeleteMachineNode added in v2.16.3

func DeleteMachineNode(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, machineID string) (interface{}, error)

func DetachSSHKeyEndpoint added in v2.16.3

func DetachSSHKeyEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID, keyID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, sshKeyProvider provider.SSHKeyProvider, privilegedSSHKeyProvider provider.PrivilegedSSHKeyProvider) (interface{}, error)

func EncodeKubeconfig added in v2.16.3

func EncodeKubeconfig(c context.Context, w http.ResponseWriter, response interface{}) (err error)

func EncodeOIDCKubeconfig added in v2.16.3

func EncodeOIDCKubeconfig(c context.Context, w http.ResponseWriter, response interface{}) (err error)

func FilterCPU added in v2.17.0

func FilterCPU(record, min, max int) bool

func FilterGPU added in v2.17.0

func FilterGPU(record int, enableGPU bool) bool

func FilterMemory added in v2.17.0

func FilterMemory(record, min, max int) bool

func GenerateCluster added in v2.18.0

func GenerateCluster(
	ctx context.Context,
	projectID string,
	body apiv1.CreateClusterSpec,
	seedsGetter provider.SeedsGetter,
	credentialManager provider.PresetProvider,
	exposeStrategy kubermaticv1.ExposeStrategy,
	userInfoGetter provider.UserInfoGetter,
	caBundle *x509.CertPool,
	configGetter provider.KubermaticConfigurationGetter,
	features features.FeatureGate,
) (*kubermaticv1.Cluster, error)

func GetAddonConfigEndpoint added in v2.16.3

func GetAddonConfigEndpoint(addonConfigProvider provider.AddonConfigProvider, addonID string) (interface{}, error)

func GetAddonEndpoint added in v2.16.3

func GetAddonEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, addonID string) (interface{}, error)

func GetAdminKubeconfigEndpoint added in v2.16.3

func GetAdminKubeconfigEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func GetCluster

func GetCluster(ctx context.Context, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, options *provider.ClusterGetOptions) (*kubermaticv1.Cluster, error)

GetCluster returns the cluster for a given request

func GetClusterEventsEndpoint

func GetClusterEventsEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID, eventType string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func GetClusterOidcEndpoint added in v2.18.0

func GetClusterOidcEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func GetClusters added in v2.18.0

func GetClusters(ctx context.Context, userInfoGetter provider.UserInfoGetter, clusterProvider provider.ClusterProvider, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, seedsGetter provider.SeedsGetter, projectID string, configGetter provider.KubermaticConfigurationGetter) ([]*apiv1.Cluster, error)

func GetEndpoint

func GetEndpoint(ctx context.Context, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, seedsGetter provider.SeedsGetter, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, configGetter provider.KubermaticConfigurationGetter) (interface{}, error)

func GetInternalCluster

func GetInternalCluster(ctx context.Context, userInfoGetter provider.UserInfoGetter, clusterProvider provider.ClusterProvider, privilegedClusterProvider provider.PrivilegedClusterProvider, project *kubermaticv1.Project, projectID, clusterID string, options *provider.ClusterGetOptions) (*kubermaticv1.Cluster, error)

func GetKubeconfigEndpoint added in v2.19.0

func GetKubeconfigEndpoint(cluster *kubermaticv1.ExternalCluster, privilegedClusterProvider provider.PrivilegedExternalClusterProvider) (interface{}, error)

func GetMachineDeployment added in v2.16.3

func GetMachineDeployment(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, machineDeploymentID string) (interface{}, error)

func GetMetricsEndpoint added in v2.16.3

func GetMetricsEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func GetOidcKubeconfigEndpoint added in v2.16.3

func GetOidcKubeconfigEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func GetUpgradesEndpoint added in v2.16.3

func GetUpgradesEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, configGetter provider.KubermaticConfigurationGetter) (interface{}, error)

func HealthEndpoint added in v2.16.3

func HealthEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func ListAddonConfigsEndpoint added in v2.16.3

func ListAddonConfigsEndpoint(addonConfigProvider provider.AddonConfigProvider) (interface{}, error)

func ListAddonEndpoint added in v2.16.3

func ListAddonEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID string) (interface{}, error)

func ListClusterRoleBindingEndpoint added in v2.16.3

func ListClusterRoleBindingEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID string) (interface{}, error)

func ListClusterRoleEndpoint added in v2.16.3

func ListClusterRoleEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string) (interface{}, error)

func ListClusterRoleNamesEndpoint added in v2.16.3

func ListClusterRoleNamesEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string) (interface{}, error)

func ListInstallableAddonEndpoint added in v2.16.3

func ListInstallableAddonEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, configGetter provider.KubermaticConfigurationGetter, projectID, clusterID string) (interface{}, error)

func ListMachineDeploymentMetrics added in v2.16.3

func ListMachineDeploymentMetrics(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, machineDeploymentID string) (interface{}, error)

func ListMachineDeploymentNodes added in v2.16.3

func ListMachineDeploymentNodes(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, machineDeploymentID string, hideInitialConditions bool) (interface{}, error)

func ListMachineDeploymentNodesEvents added in v2.16.3

func ListMachineDeploymentNodesEvents(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, machineDeploymentID, eventType string) (interface{}, error)

func ListMachineDeployments added in v2.16.3

func ListMachineDeployments(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID string) (interface{}, error)

func ListNamespaceEndpoint added in v2.16.3

func ListNamespaceEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func ListNodesForCluster added in v2.16.3

func ListNodesForCluster(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID string, hideInitialConditions bool) (interface{}, error)

func ListRoleBindingEndpoint added in v2.16.3

func ListRoleBindingEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID string) (interface{}, error)

func ListRoleEndpoint added in v2.16.3

func ListRoleEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string) (interface{}, error)

func ListRoleNamesEndpoint added in v2.16.3

func ListRoleNamesEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string) (interface{}, error)

func ListSSHKeysEndpoint added in v2.16.3

func ListSSHKeysEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, sshKeyProvider provider.SSHKeyProvider) (interface{}, error)

func MigrateEndpointToExternalCCM added in v2.18.0

func MigrateEndpointToExternalCCM(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID,
	clusterID string, projectProvider provider.ProjectProvider, seedsGetter provider.SeedsGetter,
	privilegedProjectProvider provider.PrivilegedProjectProvider, configGetter provider.KubermaticConfigurationGetter) (interface{}, error)

func PatchAddonEndpoint added in v2.16.3

func PatchAddonEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, addon apiv1.Addon, projectID, clusterID, addonID string) (interface{}, error)

func PatchEndpoint

func PatchEndpoint(
	ctx context.Context,
	userInfoGetter provider.UserInfoGetter,
	projectID string,
	clusterID string,
	patch json.RawMessage,
	seedsGetter provider.SeedsGetter,
	projectProvider provider.ProjectProvider,
	privilegedProjectProvider provider.PrivilegedProjectProvider,
	caBundle *x509.CertPool,
	configGetter provider.KubermaticConfigurationGetter,
	features features.FeatureGate,
) (interface{}, error)

func PatchMachineDeployment added in v2.16.3

func PatchMachineDeployment(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, sshKeyProvider provider.SSHKeyProvider, seedsGetter provider.SeedsGetter, projectID, clusterID, machineDeploymentID string, patch json.RawMessage) (interface{}, error)

func RestartMachineDeployment added in v2.18.0

func RestartMachineDeployment(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, projectID, clusterID, machineDeploymentID string) (interface{}, error)

func UnbindUserFromClusterRoleBindingEndpoint added in v2.16.3

func UnbindUserFromClusterRoleBindingEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, clusterRoleUser apiv1.ClusterRoleUser, projectID, clusterID, roleID string) (interface{}, error)

func UnbindUserFromRoleBindingEndpoint added in v2.16.3

func UnbindUserFromRoleBindingEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider, roleUser apiv1.RoleUser, projectID, clusterID, roleID, namespace string) (interface{}, error)

func UpdateClusterSSHKey

func UpdateClusterSSHKey(ctx context.Context, userInfoGetter provider.UserInfoGetter, sshKeyProvider provider.SSHKeyProvider, privilegedSSHKeyProvider provider.PrivilegedSSHKeyProvider, clusterSSHKey *kubermaticv1.UserSSHKey, projectID string) error

func UpgradeNodeDeploymentsEndpoint added in v2.16.3

func UpgradeNodeDeploymentsEndpoint(ctx context.Context, userInfoGetter provider.UserInfoGetter, projectID, clusterID string, version apiv1.MasterVersion, projectProvider provider.ProjectProvider, privilegedProjectProvider provider.PrivilegedProjectProvider) (interface{}, error)

func ValidateClusterSpec

func ValidateClusterSpec(clusterType kubermaticv1.ClusterType, updateManager common.UpdateManager, body apiv1.CreateClusterSpec) error

Types

type CreateOIDCKubeconfigReq added in v2.16.3

type CreateOIDCKubeconfigReq struct {
	// in: query
	ClusterID string `json:"cluster_id,omitempty"`
	ProjectID string `json:"project_id,omitempty"`
	UserID    string `json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

CreateOIDCKubeconfigReq represent a request for creating kubeconfig for a cluster with OIDC credentials swagger:parameters createOIDCKubeconfig

func (CreateOIDCKubeconfigReq) GetProjectID added in v2.16.3

func (r CreateOIDCKubeconfigReq) GetProjectID() string

GetProjectID implements ProjectGetter interface

func (CreateOIDCKubeconfigReq) GetSeedCluster added in v2.16.3

func (r CreateOIDCKubeconfigReq) GetSeedCluster() apiv1.SeedCluster

GetSeedCluster returns the SeedCluster object

func (CreateOIDCKubeconfigReq) GetUserID added in v2.16.3

func (r CreateOIDCKubeconfigReq) GetUserID() string

GetUserID implements UserGetter interface

type Filter added in v2.17.0

type Filter func(record, min, max int) bool

Filter is a CPU filter function applied to a single record.

type OIDCState added in v2.16.3

type OIDCState struct {
	// nonce a random string that binds requests / responses of API server and OIDC provider
	// see https://tools.ietf.org/html/rfc6749#section-10.12
	Nonce     string `json:"nonce"`
	ClusterID string `json:"cluster_id"`
	ProjectID string `json:"project_id"`
	// UserID holds the ID of the user on behalf of which the request is being handled.
	UserID string `json:"user_id"`
}

OIDCState holds data that are send and retrieved from OIDC provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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