Documentation
¶
Index ¶
- Constants
- Variables
- func FormatResourceName(parts ...string) string
- func GetCurrentContextNamespace() (string, error)
- type Client
- func (client *Client) CheckOperatorInstalled(ctx context.Context, namespace string) (bool, error)
- func (client *Client) CheckOperatorVersion(ctx context.Context) (string, error)
- func (client *Client) CreateClusterRole(ctx context.Context, agg cloud.CreatedCoreInstance, dryRun bool, ...) (*rbacv1.ClusterRole, error)
- func (client *Client) CreateClusterRoleBinding(ctx context.Context, agg cloud.CreatedCoreInstance, ...) (*rbacv1.ClusterRoleBinding, error)
- func (client *Client) CreateDeployment(ctx context.Context, image string, agg cloud.CreatedCoreInstance, ...) (*appsv1.Deployment, error)
- func (client *Client) CreateSecret(ctx context.Context, agg cloud.CreatedCoreInstance, dryRun bool) (*corev1.Secret, error)
- func (client *Client) CreateSecretOperatorRSAKey(ctx context.Context, agg cloud.CreatedCoreInstance, dryRun bool) (*corev1.Secret, error)
- func (client *Client) CreateServiceAccount(ctx context.Context, agg cloud.CreatedCoreInstance, dryRun bool) (*corev1.ServiceAccount, error)
- func (client *Client) DeleteClusterRoleByLabel(ctx context.Context, label string) error
- func (client *Client) DeleteConfigMapsByLabel(ctx context.Context, label, ns string) error
- func (client *Client) DeleteCoreInstance(ctx context.Context, name, environment string, shouldWait bool) error
- func (client *Client) DeleteDaemonSetByLabel(ctx context.Context, label, ns string) error
- func (client *Client) DeleteDeploymentByLabel(ctx context.Context, label, ns string) error
- func (client *Client) DeleteResources(ctx context.Context, resources []ResourceRollBack) ([]ResourceRollBack, error)
- func (client *Client) DeleteRoleBindingByLabel(ctx context.Context, label string) error
- func (client *Client) DeleteSecretByLabel(ctx context.Context, label, ns string) error
- func (client *Client) DeleteServiceAccountByLabel(ctx context.Context, label, ns string) error
- func (client *Client) DeleteServiceByName(ctx context.Context, name, ns string) error
- func (client *Client) DeployCoreOperatorSync(ctx context.Context, params DeployCoreOperatorSync) (*appsv1.Deployment, error)
- func (client *Client) EnsureOwnNamespace(ctx context.Context) error
- func (client *Client) FindDeploymentByLabel(ctx context.Context, label string) (*appsv1.DeploymentList, error)
- func (client *Client) FindDeploymentByName(ctx context.Context, name string) (*appsv1.Deployment, error)
- func (client *Client) FindServicesByLabel(ctx context.Context, label, ns string) (*corev1.ServiceList, error)
- func (client *Client) GetClusterInfo() (ClusterInfo, error)
- func (client *Client) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
- func (client *Client) IsOperatorInstalled(ctx context.Context) (bool, error)
- func (client *Client) PurgeLeftoverRBAC(ctx context.Context) error
- func (client *Client) SearchManagerAcrossAllNamespaces(ctx context.Context) (*appsv1.Deployment, error)
- func (client *Client) UpdateDeploymentByLabel(ctx context.Context, label, newImage, tlsVerify string) error
- func (client *Client) UpdateOperatorDeploymentByLabel(ctx context.Context, label string, newImage string, verbose bool, ...) error
- func (client *Client) UpdateSyncDeploymentByLabel(ctx context.Context, label string, params UpdateCoreOperatorSync, verbose bool, ...) error
- func (client *Client) WaitReady(ctx context.Context, namespace, name string, verbose bool, ...) error
- type ClusterInfo
- type ClusterRoleOpt
- type DeployCoreOperatorSync
- type OperatorIncompleteError
- type ResourceRollBack
- type UpdateCoreOperatorSync
Constants ¶
View Source
const ( LabelVersion = "app.kubernetes.io/version" LabelPartOf = "app.kubernetes.io/part-of" LabelManagedBy = "app.kubernetes.io/managed-by" LabelCreatedBy = "app.kubernetes.io/created-by" LabelComponent = "app.kubernetes.io/component" LabelInstance = "app.kubernetes.io/instance" )
https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
View Source
const ( LabelProjectID = "calyptia_project_id" LabelAggregatorID = "calyptia_aggregator_id" LabelAggregatorName = "calyptia_aggregator_name" LabelPipelineID = "calyptia_pipeline_id" LabelPipelineName = "calyptia_pipeline_name" )
Variables ¶
View Source
var ( ErrNoContext = fmt.Errorf("no context is currently set") ErrCoreOperatorNotFound = fmt.Errorf("could not find core operator across all namespaces") )
View Source
var GetOperatorManifest = func(version string) ([]byte, error) { url, err := getOperatorDownloadURL(version) if err != nil { return nil, err } response, err := http.Get(url) if err != nil { return nil, fmt.Errorf("error downloading operator manifest: %w", err) } defer func(Body io.ReadCloser) { err := Body.Close() if err != nil { fmt.Println("Error closing response body:", err) } }(response.Body) manifestBytes, err := io.ReadAll(response.Body) if err != nil { return nil, err } return manifestBytes, nil }
Functions ¶
func FormatResourceName ¶
FormatResourceName returns the resource name with a prepended calyptia prefix.
Types ¶
type Client ¶
type Client struct {
kubernetes.Interface
Namespace string
ProjectToken string
CloudBaseURL string
LabelsFunc func() map[string]string
Config *restclient.Config
}
func (*Client) CheckOperatorInstalled ¶
func (*Client) CheckOperatorVersion ¶
func (*Client) CreateClusterRole ¶
func (client *Client) CreateClusterRole(ctx context.Context, agg cloud.CreatedCoreInstance, dryRun bool, opts ...ClusterRoleOpt) (*rbacv1.ClusterRole, error)
func (*Client) CreateClusterRoleBinding ¶
func (client *Client) CreateClusterRoleBinding( ctx context.Context, agg cloud.CreatedCoreInstance, clusterRole *rbacv1.ClusterRole, serviceAccount *corev1.ServiceAccount, dryRun bool, ) (*rbacv1.ClusterRoleBinding, error)
func (*Client) CreateDeployment ¶
func (client *Client) CreateDeployment( ctx context.Context, image string, agg cloud.CreatedCoreInstance, coreCloudURL string, serviceAccount *corev1.ServiceAccount, tlsVerify bool, skipServiceCreation bool, dryRun bool, ) (*appsv1.Deployment, error)
func (*Client) CreateSecret ¶
func (client *Client) CreateSecret(ctx context.Context, agg cloud.CreatedCoreInstance, dryRun bool) (*corev1.Secret, error)
CreateSecret TODO: DELETE AFTER OPERATOR LAUNCHES and create by k8s become deprecated
func (*Client) CreateSecretOperatorRSAKey ¶
func (*Client) CreateServiceAccount ¶
func (client *Client) CreateServiceAccount(ctx context.Context, agg cloud.CreatedCoreInstance, dryRun bool) (*corev1.ServiceAccount, error)
func (*Client) DeleteClusterRoleByLabel ¶
func (*Client) DeleteConfigMapsByLabel ¶
func (*Client) DeleteCoreInstance ¶
func (*Client) DeleteDaemonSetByLabel ¶
func (*Client) DeleteDeploymentByLabel ¶
func (*Client) DeleteResources ¶
func (client *Client) DeleteResources(ctx context.Context, resources []ResourceRollBack) ([]ResourceRollBack, error)
func (*Client) DeleteRoleBindingByLabel ¶
func (*Client) DeleteSecretByLabel ¶
func (*Client) DeleteServiceAccountByLabel ¶
func (*Client) DeleteServiceByName ¶
func (*Client) DeployCoreOperatorSync ¶
func (client *Client) DeployCoreOperatorSync(ctx context.Context, params DeployCoreOperatorSync) (*appsv1.Deployment, error)
func (*Client) EnsureOwnNamespace ¶
func (*Client) FindDeploymentByLabel ¶
func (*Client) FindDeploymentByName ¶
func (*Client) FindServicesByLabel ¶
func (*Client) GetClusterInfo ¶
func (client *Client) GetClusterInfo() (ClusterInfo, error)
func (*Client) GetNamespace ¶
GetNamespace returns the namespace if it exists.
func (*Client) IsOperatorInstalled ¶
func (*Client) PurgeLeftoverRBAC ¶
func (*Client) SearchManagerAcrossAllNamespaces ¶
func (*Client) UpdateDeploymentByLabel ¶
func (*Client) UpdateOperatorDeploymentByLabel ¶
func (*Client) UpdateSyncDeploymentByLabel ¶
type ClusterInfo ¶
type ClusterInfo struct {
Namespace, Platform, Version string
}
ClusterInfo information that is retrieved from the running cluster.
type ClusterRoleOpt ¶
type ClusterRoleOpt struct {
EnableOpenShift bool
}
type DeployCoreOperatorSync ¶
type DeployCoreOperatorSync struct {
CoreCloudURL string
FromCloudImage string
ToCloudImage string
Metrics bool
MetricsPort string
MemoryLimit string
Annotations string
Tolerations string
SkipServiceCreation bool
NoTLSVerify bool
CloudProxy string
HttpProxy string
HttpsProxy string
NoProxy string
CoreInstance cloud.CreatedCoreInstance
ServiceAccount string
}
type OperatorIncompleteError ¶
type OperatorIncompleteError struct {
Errors []error
}
func (*OperatorIncompleteError) Error ¶
func (o *OperatorIncompleteError) Error() string
type ResourceRollBack ¶
type ResourceRollBack struct {
Name string
Namespace string
GVR schema.GroupVersionResource
}
type UpdateCoreOperatorSync ¶
type UpdateCoreOperatorSync struct {
Metrics bool
MetricsPort string
MemoryLimit string
Annotations string
Tolerations string
SkipServiceCreation bool
NoTLSVerify bool
CloudProxy string
HttpProxy string
HttpsProxy string
NoProxy string
CoreInstance cloud.CreatedCoreInstance
ServiceAccount string
Image string
}
Click to show internal directories.
Click to hide internal directories.