cmd

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Version: "0.0.33",
	Use:     "thermite",
	Short:   "Remove old and undeployed Amazon Elastic Container Registry images",
	Long: `Thermite removes old Amazon Elastic Container Registry images that are not
deployed in a Kubernetes cluster.

Thermite checks for a resource tag (thermite:prune-period by default) on each
repository in an Elastic Container Registry. This tag specifies the number of
days that must pass after an image in the repository has been pushed before
is pruned.

Thermite surveys the image names of the containers associated with every
CronJob, DaemonSet, Deployment, Job, and StatefulSet in a Kubernetes
cluster, and excludes these images from removal.

Thermite expects shared environment configuration and credentials to exist for
the AWS account whose default Elastic Container Registry is to be pruned, as
described by the "Configuration and credentials" subsection of the "Configuring
the AWS CLI" section of the AWS Command Line Interface User Guide.

If Thermite is not running inside the Kubernetes cluster that is to be surveyed,
Thermite expects a Kubernetes configuration to exist as described in the
"Organizing Cluster Access Using kubeconfig Files" subsection of the
"Configuration" section of the Kubernetes Concepts documentation.

Thermite will submit DogStatsD metrics to the address specified by the
DD_AGENT_HOST and DD_DOGSTATSD_PORT environment variables if they are set.
Thermite will submit Datadog APM spans and profiles to the address specified by
the DD_AGENT_HOST and DD_TRACE_AGENT_PORT environment variables if they are set.`,
	Run: func(cmd *cobra.Command, args []string) {
		logger := log.Default()
		pruned, err := run(logger)
		for _, imageRef := range pruned {
			fmt.Println(imageRef)
		}
		if err != nil {
			logger.Fatalf("error running Thermite: %v", err)
		}
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

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