deploy

package
v0.0.0-...-0d7ecfb Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeYAMLManifestToObject

func DecodeYAMLManifestToObject(path string, resource interface{}) error

DecodeYAMLManifestToObject is a helper function that takes the path to a manifest file, e.g. the deployment YAML file, and opens that file using os.Open, which returns an io.Reader object that can be passed to the YAML/JSON decoder to build up the @resource parameter for usage in the clientsets.

Types

type CRD

type CRD struct {
	Name string
	Path string
	CRD  *apiextv1.CustomResourceDefinition
}

CRD is a structure that holds the information needed to install these resources, like the name of the CRD, the path to the CRD in the manifests directory, and a pointer to the apiextensions CRD type.

func InitMeteringCRDSlice

func InitMeteringCRDSlice(manifestDir string, pathToCRDMap map[string]string) []CRD

InitMeteringCRDSlice initializes a slice of CRD structures, where each structure contains information about an individual CRD that metering manages and returns this slice of CRD structures.

type Config

type Config struct {
	SkipMeteringDeployment   bool
	RunMeteringOperatorLocal bool
	DeleteCRDs               bool
	DeleteCRBs               bool
	DeleteNamespace          bool
	DeletePVCs               bool
	DeleteAll                bool
	Namespace                string
	Platform                 string
	Repo                     string
	Tag                      string
	Channel                  string
	PackageName              string
	CatalogSourceName        string
	CatalogSourceNamespace   string
	SubscriptionName         string
	ExtraNamespaceLabels     map[string]string
	OperatorResources        *OperatorResources
	MeteringConfig           *metering.MeteringConfig
}

Config contains all the information needed to handle different metering deployment configurations and internal states, e.g. what platform to deploy on, whether or not to delete the metering CRDs, or namespace during an install, the location to the manifests dir, etc.

type Deployer

Deployer holds all the information needed to handle the deployment process of the metering stack. This includes the clientsets needed to provision and remove all the metering resources, and a customized deployment configuration.

func NewDeployer

NewDeployer creates a new reference to a deploy structure, and then calls helper functions that initialize the structure fields based on the value of environment variables and function parameters, returning a reference to this initialized deploy structure

func (*Deployer) Install

func (deploy *Deployer) Install() error

Install is the driver function that manages the process of creating all the resources that metering needs to install: namespace, CRDs, etc.

func (*Deployer) InstallOLM

func (deploy *Deployer) InstallOLM() error

InstallOLM is the driver function that manages the process of creating all of the OLM-related resources that are needed to deploy a Metering installation.

func (*Deployer) Uninstall

func (deploy *Deployer) Uninstall() error

Uninstall is the driver function that manages deleting all the resources that metering had created. Depending on the configuration of the deploy structure, resources like the metering CRDs, PVCs, or cluster role/role binding may be skipped

func (*Deployer) UninstallOLM

func (deploy *Deployer) UninstallOLM() error

UninstallOLM is the driver function that manages deleting all of the OLM-related metering resources that get created: the OperatorGroup, Subscription, CSV, etc. Deleting the ClusterServiceVersion object will delete the resources that were provisioned from the CSV, so deleting the MeteringConfig custom resource is still needed to fully cleanup any non-CRD resources, e.g. the reporting-operator pod.

type OperatorResources

type OperatorResources struct {
	CRDs               []CRD
	Deployment         *appsv1.Deployment
	ServiceAccount     *corev1.ServiceAccount
	RoleBinding        *rbacv1.RoleBinding
	Role               *rbacv1.Role
	ClusterRoleBinding *rbacv1.ClusterRoleBinding
	ClusterRole        *rbacv1.ClusterRole
}

OperatorResources contains all the objects that make up the Metering Ansible Operator

func ReadMeteringAnsibleOperatorManifests

func ReadMeteringAnsibleOperatorManifests(manifestDir, platform string) (*OperatorResources, error)

Jump to

Keyboard shortcuts

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