curatedpackages

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CustomName = "generated-"
)
View Source
const (
	ImageRepositoryName = "eks-anywhere-packages-bundles"
)

Variables

This section is empty.

Functions

func CreateBundleManager

func CreateBundleManager() bundle.RegistryClient

func GenerateAllValidConfigurations added in v0.9.2

func GenerateAllValidConfigurations(configs map[string]string) (string, error)

func GetPackageBundleRef

func GetPackageBundleRef(vb releasev1.VersionsBundle) (string, error)

func GetRegistry added in v0.9.2

func GetRegistry(uri string) string

func GetVersionBundle

func GetVersionBundle(reader Reader, eksaVersion string, spec *v1alpha1.Cluster) (*releasev1.VersionsBundle, error)

func NewKubeClientFromFilename added in v0.12.0

func NewKubeClientFromFilename(kubeConfigFilename string) (client.Client, error)

NewKubeClientFromFilename creates a controller-runtime k8s client for use by CLI commands.

func ParseConfigurations added in v0.9.2

func ParseConfigurations(configs []string) (map[string]string, error)

func PrintCertManagerDoesNotExistMsg added in v0.11.0

func PrintCertManagerDoesNotExistMsg()

func PrintLicense

func PrintLicense()

func PullLatestBundle added in v0.11.2

func PullLatestBundle(ctx context.Context, art string) ([]byte, error)

func PushBundle added in v0.11.2

func PushBundle(ctx context.Context, ref, fileName string, fileContent []byte) error

func ValidateKubeVersion

func ValidateKubeVersion(kubeVersion string, clusterName string) error

func WithActiveBundleTimeout added in v0.12.0

func WithActiveBundleTimeout(timeout time.Duration) func(client *PackageControllerClient)

func WithBundle added in v0.9.2

func WithBundle(bundle *packagesv1.PackageBundle) func(*PackageClient)

func WithCustomConfigs added in v0.9.2

func WithCustomConfigs(customConfigs []string) func(*PackageClient)

func WithCustomPackages added in v0.9.2

func WithCustomPackages(customPackages []string) func(*PackageClient)

func WithEksaAccessKeyId added in v0.11.0

func WithEksaAccessKeyId(eksaAccessKeyId string) func(client *PackageControllerClient)

func WithEksaRegion added in v0.11.0

func WithEksaRegion(eksaRegion string) func(client *PackageControllerClient)

func WithEksaSecretAccessKey added in v0.11.0

func WithEksaSecretAccessKey(eksaSecretAccessKey string) func(client *PackageControllerClient)

func WithHTTPProxy added in v0.12.0

func WithHTTPProxy(httpProxy string) func(client *PackageControllerClient)

func WithHTTPSProxy added in v0.12.0

func WithHTTPSProxy(httpsProxy string) func(client *PackageControllerClient)

func WithManagementClusterName added in v0.12.0

func WithManagementClusterName(managementClusterName string) func(client *PackageControllerClient)

func WithNoProxy added in v0.12.0

func WithNoProxy(noProxy []string) func(client *PackageControllerClient)

Types

type BundleReader

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

func NewBundleReader

func NewBundleReader(kubeConfig string, clusterName string, k KubectlRunner, bm Manager, reg BundleRegistry) *BundleReader

func (*BundleReader) GetActiveController

func (b *BundleReader) GetActiveController(ctx context.Context) (*packagesv1.PackageBundleController, error)

func (*BundleReader) GetLatestBundle

func (b *BundleReader) GetLatestBundle(ctx context.Context, kubeVersion string) (*packagesv1.PackageBundle, error)

func (*BundleReader) UpgradeBundle

func (b *BundleReader) UpgradeBundle(ctx context.Context, controller *packagesv1.PackageBundleController, newBundleVersion string) error

type BundleRegistry

type BundleRegistry interface {
	GetRegistryBaseRef(ctx context.Context) (string, error)
}

type ChartInstaller

type ChartInstaller interface {
	InstallChart(ctx context.Context, chart, ociURI, version, kubeconfigFilePath, namespace string, values []string) error
}

type CustomRegistry

type CustomRegistry struct {
	*executables.Helm
	// contains filtered or unexported fields
}

func NewCustomRegistry

func NewCustomRegistry(helm *executables.Helm, registry string) *CustomRegistry

func (*CustomRegistry) GetRegistryBaseRef

func (cm *CustomRegistry) GetRegistryBaseRef(ctx context.Context) (string, error)

type DefaultRegistry

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

func NewDefaultRegistry

func NewDefaultRegistry(rmr Reader, kv string, cv version.Info) *DefaultRegistry

func (*DefaultRegistry) GetRegistryBaseRef

func (dr *DefaultRegistry) GetRegistryBaseRef(ctx context.Context) (string, error)

type Discovery

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

Discovery * Implements ServerVersionInterface to provide the Kubernetes client version to be used.

func NewDiscovery

func NewDiscovery(kubeVersion *KubeVersion) *Discovery

func (*Discovery) ServerVersion

func (d *Discovery) ServerVersion() (*version.Info, error)

type DisplayablePackage

type DisplayablePackage struct {
	*api.Package
	Status *interface{} `json:"status,omitempty"`
}

DisplayablePackage wraps Package to omit undesired members (like Status).

This is necessary in part because of https://github.com/golang/go/issues/11939 but also because we just don't want to generate a Status section when we're emitting templates for a user to modify.

func NewDisplayablePackage

func NewDisplayablePackage(p *api.Package) *DisplayablePackage

type Installer added in v0.9.2

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

func NewInstaller added in v0.9.2

func NewInstaller(runner KubectlRunner, pc PackageHandler, pcc PackageController, spec *cluster.Spec, packagesLocation, mgmtKubeconfig string) *Installer

NewInstaller installs packageController and packages during cluster creation.

func (*Installer) InstallCuratedPackages added in v0.9.2

func (pi *Installer) InstallCuratedPackages(ctx context.Context) error

type KubeVersion

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

func NewKubeVersion

func NewKubeVersion(major string, minor string) *KubeVersion

type KubectlRunner

type KubectlRunner interface {
	ExecuteCommand(ctx context.Context, opts ...string) (bytes.Buffer, error)
	ExecuteFromYaml(ctx context.Context, yaml []byte, opts ...string) (bytes.Buffer, error)
	// GetObject performs a GET call to the kube API server authenticating with a kubeconfig file
	// and unmarshalls the response into the provdied Object
	// If the object is not found, it returns an error implementing apimachinery errors.APIStatus
	GetObject(ctx context.Context, resourceType, name, namespece, kubeconfig string, obj runtime.Object) error
	// HasResource is true if the resource can be retrieved from the API and has length > 0.
	HasResource(ctx context.Context, resourceType string, name string, kubeconfig string, namespace string) (bool, error)
}

type Manager

type Manager interface {
	LatestBundle(ctx context.Context, baseRef string, kubeVersion string) (
		*packagesv1.PackageBundle, error)
}

type ManifestReader added in v0.11.2

type ManifestReader interface {
	ReadBundlesForVersion(eksaVersion string) (*releasev1.Bundles, error)
	ReadImagesFromBundles(ctx context.Context, bundles *releasev1.Bundles) ([]releasev1.Image, error)
	ReadChartsFromBundles(ctx context.Context, bundles *releasev1.Bundles) []releasev1.Image
}

type PackageClient

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

func NewPackageClient

func NewPackageClient(kubectl KubectlRunner, options ...PackageClientOpt) *PackageClient

func (*PackageClient) ApplyPackages

func (pc *PackageClient) ApplyPackages(ctx context.Context, fileName string, kubeConfig string) error

func (*PackageClient) CreatePackages

func (pc *PackageClient) CreatePackages(ctx context.Context, fileName string, kubeConfig string) error

func (*PackageClient) DeletePackages

func (pc *PackageClient) DeletePackages(ctx context.Context, packages []string, kubeConfig string, clusterName string) error

func (*PackageClient) DescribePackages

func (pc *PackageClient) DescribePackages(ctx context.Context, packages []string, kubeConfig string, clusterName string) error

func (*PackageClient) DisplayPackages

func (pc *PackageClient) DisplayPackages(w io.Writer) error

DisplayPackages pretty-prints a table of available packages.

func (*PackageClient) GeneratePackages

func (pc *PackageClient) GeneratePackages(clusterName string) ([]packagesv1.Package, error)

func (*PackageClient) GetPackageFromBundle

func (pc *PackageClient) GetPackageFromBundle(packageName string) (*packagesv1.BundlePackage, error)

func (*PackageClient) InstallPackage

func (pc *PackageClient) InstallPackage(ctx context.Context, bp *packagesv1.BundlePackage, customName string, clusterName string, kubeConfig string) error

func (*PackageClient) WritePackagesToStdOut

func (pc *PackageClient) WritePackagesToStdOut(packages []packagesv1.Package) error

type PackageClientOpt added in v0.9.2

type PackageClientOpt func(*PackageClient)

type PackageController added in v0.9.2

type PackageController interface {
	EnableCuratedPackages(ctx context.Context) error
	IsInstalled(ctx context.Context) bool
}

type PackageControllerClient

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

func NewPackageControllerClient

func NewPackageControllerClient(chartInstaller ChartInstaller, kubectl KubectlRunner, clusterName, kubeConfig, uri, chartName, chartVersion string, options ...PackageControllerClientOpt) *PackageControllerClient

func (*PackageControllerClient) ApplySecret added in v0.11.0

func (pc *PackageControllerClient) ApplySecret(ctx context.Context) error

func (*PackageControllerClient) CreateCronJob added in v0.11.0

func (pc *PackageControllerClient) CreateCronJob(ctx context.Context) error

func (*PackageControllerClient) EnableCuratedPackages added in v0.12.0

func (pc *PackageControllerClient) EnableCuratedPackages(ctx context.Context) error

EnableCuratedPackages enables curated packages in a cluster In case the cluster is management cluster, it performs the following actions:

  • Installation of Package Controller through helm chart installation
  • Creation of secret credentials
  • Creation of a single run of a cron job refresher
  • Activation of a curated packages bundle

In case the cluster is a workload cluster, it performs the following actions:

  • Creation of package bundle controller (PBC) custom resource in management cluster

func (*PackageControllerClient) InstallPBCResources added in v0.12.0

func (pc *PackageControllerClient) InstallPBCResources(ctx context.Context) error

InstallPBCResources installs Curated Packages Bundle Controller Custom Resource This method is used only for Workload clusters Please refer to this documentation: https://github.com/aws/eks-anywhere-packages/blob/main/docs/design/remote-management.md

func (*PackageControllerClient) IsInstalled added in v0.12.0

func (pc *PackageControllerClient) IsInstalled(ctx context.Context) bool

IsInstalled checks if a package controller custom resource exists.

type PackageControllerClientOpt added in v0.11.0

type PackageControllerClientOpt func(client *PackageControllerClient)

type PackageHandler added in v0.9.2

type PackageHandler interface {
	CreatePackages(ctx context.Context, fileName string, kubeConfig string) error
}

type PackageReader

type PackageReader struct {
	ManifestReader
}

func NewPackageReader

func NewPackageReader(mr ManifestReader) *PackageReader

func (*PackageReader) ReadChartsFromBundles

func (r *PackageReader) ReadChartsFromBundles(ctx context.Context, b *releasev1.Bundles) []releasev1.Image

func (*PackageReader) ReadImagesFromBundles

func (r *PackageReader) ReadImagesFromBundles(ctx context.Context, b *releasev1.Bundles) ([]releasev1.Image, error)

type Reader

type Reader interface {
	ReadBundlesForVersion(eksaVersion string) (*releasev1.Bundles, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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