k8s

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildManager

func BuildManager(initCfg *Config) (manager.Manager, error)

func CreateCertificateX509

func CreateCertificateX509(ctx context.Context, k8sClient client.Client, name, ns string) error

func CreateDefaultSecret

func CreateDefaultSecret(ctx context.Context, k8sClient client.Client, name, ns string)

func CreateNamespace

func CreateNamespace(ctx context.Context, k8sClient client.Client, ns string) error

func CreateNewClient

func CreateNewClient() (client.Client, error)

func CreateRandomNamespace added in v2.3.1

func CreateRandomNamespace(ctx context.Context, k8sClient client.Client, generateName string) (*corev1.Namespace, error)

func CreateRandomUserSecret

func CreateRandomUserSecret(ctx context.Context, k8sClient client.Client, name, ns string) error

func CreateSecret

func CreateSecret(ctx context.Context, k8sClient client.Client, publicKey, privateKey, name, ns string) error

func CreateUserSecret

func CreateUserSecret(ctx context.Context, k8sClient client.Client, secret, name, ns string) error

func DeleteDeployment

func DeleteDeployment(ctx context.Context, k8sClient client.Client, ns, name string) error

func DeleteKey

func DeleteKey(ctx context.Context, k8sClient client.Client, keyName, ns string) error

func DeleteNamespace

func DeleteNamespace(ctx context.Context, k8sClient client.Client, ns string) error

func DeploymentListYml

func DeploymentListYml(ctx context.Context, k8sClient client.Client, ns string) ([]byte, error)

func GetAllDeploymentPods

func GetAllDeploymentPods(deploymentName, deploymentNS string) ([]corev1.Pod, error)

func GetDBUserStatusCondition

func GetDBUserStatusCondition(ctx context.Context, k8sClient client.Client, statusType api.ConditionType, ns string, name string) (string, error)

func GetDeployment

func GetDeployment(deploymentName, deploymentNS string) (*appsv1.Deployment, error)

func GetDeploymentObservedGeneration

func GetDeploymentObservedGeneration(ctx context.Context, k8sClient client.Client, ns, resourceName string) (int, error)

func GetDeploymentResource

func GetDeploymentResource(ctx context.Context, k8sClient client.Client, namespace, rName string) (*akov2.AtlasDeployment, error)

func GetDeploymentStatusCondition

func GetDeploymentStatusCondition(ctx context.Context, k8sClient client.Client, statusType api.ConditionType, ns string, name string) (string, error)

func GetK8sDeploymentStateName

func GetK8sDeploymentStateName(ctx context.Context, k8sClient client.Client, ns, rName string) (string, error)

func GetPodLogs

func GetPodLogs(options corev1.PodLogOptions, ns string, podName string) ([]byte, error)

func GetPodLogsByDeployment

func GetPodLogsByDeployment(deploymentName, deploymentNS string, options corev1.PodLogOptions) ([]byte, error)

func GetPodStatus

func GetPodStatus(ctx context.Context, k8sClient client.Client, ns string) (string, error)

GetPodStatus status.phase

func GetPodStatusPhaseByLabel

func GetPodStatusPhaseByLabel(ctx context.Context, k8sClient client.Client, ns, labelKey, labelValue string) (string, error)

func GetProjectObservedGeneration

func GetProjectObservedGeneration(ctx context.Context, k8sClient client.Client, ns, resourceName string) (int, error)

func GetProjectStatusCondition

func GetProjectStatusCondition(ctx context.Context, k8sClient client.Client, statusType api.ConditionType, ns string, name string) (string, error)

func ProjectListYaml

func ProjectListYaml(ctx context.Context, k8sClient client.Client, ns string) ([]byte, error)

func TeamListYaml

func TeamListYaml(ctx context.Context, k8sClient client.Client, ns string) ([]byte, error)

func UserListYaml

func UserListYaml(ctx context.Context, k8sClient client.Client, ns string) ([]byte, error)

Types

type Config

type Config struct {
	AtlasDomain                 string
	EnableLeaderElection        bool
	MetricsAddr                 string
	WatchedNamespaces           map[string]bool
	ProbeAddr                   string
	GlobalAPISecret             client.ObjectKey
	ObjectDeletionProtection    bool
	SubObjectDeletionProtection bool
	FeatureFlags                *featureflags.FeatureFlags
}

type ManagerConfig

type ManagerConfig func(config *Config)

func WithAtlasDomain

func WithAtlasDomain(domain string) ManagerConfig

func WithGlobalKey

func WithGlobalKey(key client.ObjectKey) ManagerConfig

func WithNamespaces

func WithNamespaces(namespaces ...string) ManagerConfig

func WithObjectDeletionProtection

func WithObjectDeletionProtection(flag bool) ManagerConfig

func WithSubObjectDeletionProtection

func WithSubObjectDeletionProtection(flag bool) ManagerConfig

type ManagerStart

type ManagerStart func(ctx context.Context) error

func RunManager

func RunManager(withConfigs ...ManagerConfig) (ManagerStart, error)

Jump to

Keyboard shortcuts

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