installation

package
v2.34.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstallCmd = &cobra.Command{
	Use:   "install",
	Short: "Install Aperture components",
	Long: `
Use this command to install Aperture Controller and Agent on your Kubernetes cluster.`,
	SilenceErrors: true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		var err error

		if version == "" {
			return fmt.Errorf("--version flag is required")
		}

		if !dryRun {
			kubeRestConfig, err = utils.GetKubeConfig(kubeConfig)
			if err != nil {
				return err
			}

			err = api.SchemeBuilder.AddToScheme(scheme.Scheme)
			if err != nil {
				return fmt.Errorf("failed to create Kubernetes client: %w", err)
			}

			kubeClient, err = client.New(kubeRestConfig, client.Options{
				Scheme: scheme.Scheme,
			})
			if err != nil {
				return fmt.Errorf("failed to create Kubernetes client: %w", err)
			}

			err = manageNamespace()
			if err != nil {
				return err
			}
		}

		return nil
	},
}

InstallCmd is the command to install Aperture Controller and Aperture Agent on Kubernetes.

View Source
var UnInstallCmd = &cobra.Command{
	Use:   "uninstall",
	Short: "Uninstall Aperture components",
	Long: `
Use this command to uninstall Aperture Controller and Agent from your Kubernetes cluster.`,
	SilenceErrors: true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		var err error

		if version == "" {
			return fmt.Errorf("--version flag is required")
		}

		kubeRestConfig, err = utils.GetKubeConfig(kubeConfig)
		if err != nil {
			return err
		}

		err = api.SchemeBuilder.AddToScheme(scheme.Scheme)
		if err != nil {
			return fmt.Errorf("failed to create Kubernetes client: %w", err)
		}
		kubeClient, err = client.New(kubeRestConfig, client.Options{
			Scheme: scheme.Scheme,
		})
		if err != nil {
			return fmt.Errorf("failed to create Kubernetes client: %w", err)
		}

		return nil
	},
}

UnInstallCmd is the command to uninstall Aperture Controller and Aperture Agent from Kubernetes.

Functions

func CheckCertificate

func CheckCertificate(secret *corev1.Secret, cm *corev1.ConfigMap, certFileName, keyFileName string) (bool, error)

CheckCertificate checks if the certificate in the secret is valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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