operator

package
v0.1.10 Latest Latest
Warning

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

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

Documentation

Overview

Package operator contains functions for installing and managing the jetstack operator.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoInstallation is the error given when querying an Installation resource that does not exist.
	ErrNoInstallation = errors.New("no installation")

	// ErrNoInstallationCRD is the error given when the Installation CRD does not exist in the cluster.
	ErrNoInstallationCRD = errors.New("no installation CRD")
)
View Source
var ErrNoKeyFile = errors.New("no key file")

ErrNoKeyFile is the error given when generating an image pull secret for a key that does not exist.

View Source
var ErrNoManifest = errors.New("no manifest")

ErrNoManifest is the error given when querying a kubernetes manifest that doesn't exit.

Functions

func ApplyInstallationYAML

func ApplyInstallationYAML(ctx context.Context, applier Applier, options ApplyInstallationYAMLOptions) error

ApplyInstallationYAML generates a YAML bundle that describes the kubernetes manifest for the operator's Installation custom resource. The ApplyInstallationYAMLOptions specify additional options used to configure the installation.

func ApplyOperatorYAML

func ApplyOperatorYAML(ctx context.Context, applier Applier, options ApplyOperatorYAMLOptions) error

ApplyOperatorYAML generates a YAML bundle that contains all Kubernetes resources required to run the Jetstack Secure operator which is then applied via the Applier implementation. It can be customised via the provided ApplyOperatorYAMLOptions type.

func ImagePullSecret

func ImagePullSecret(keyData string) (*corev1.Secret, error)

ImagePullSecret returns an io.Reader implementation that contains the byte representation of the Kubernetes secret YAML that can be used as an image pull secret for the jetstack operator. The keyData parameter should contain the JSON Google Service account to use in the secret.

func SuggestedActions

func SuggestedActions(options ApplyInstallationYAMLOptions) []prompt.Suggestion

SuggestedActions generates a slice of prompt.Suggestion types based on the ApplyInstallationYAMLOptions. These are actions the user should perform to ensure that their installation works as expected.

func Versions

func Versions() ([]string, error)

Versions returns all available versions of the jetstack operator ordered semantically.

Types

type Applier

type Applier interface {
	Apply(ctx context.Context, r io.Reader) error
}

The Applier interface describes types that can Apply a stream of YAML-encoded Kubernetes resources.

type ApplyInstallationYAMLOptions

type ApplyInstallationYAMLOptions struct {
	InstallCSIDriver       bool // If true, the Installation manifest will have the cert-manager CSI driver.
	InstallSpiffeCSIDriver bool // If true, the Installation manifest will have the cert-manager spiffe CSI driver.
	InstallIstioCSR        bool // If true, the Installation manifest will have the Istio CSR.
	// InstallApproverPolicyEnterprise, if true, will swap the default open
	// source policy approver for the enterprise one
	InstallApproverPolicyEnterprise bool
	CertDiscoveryVenafi             *venafi.VenafiConnection // If not nil, cert-discovery-venafi resources will be added to manifests
	InstallVenafiOauthHelper        bool                     // If true, the Installation manifest will have the venafi-oauth-helper.
	VenafiIssuers                   []*venafi.VenafiIssuer
	IstioCSRIssuer                  string // The issuer name to use for the Istio CSR installation.
	ImageRegistry                   string // A custom image registry to use for operator components.
	RegistryCredentialsPath         string // Path to a credentials file containing registry credentials for image pull secrets
	// RegistryCredentials is a string containing a GCP service account key to access the Jetstack Secure image registry.
	RegistryCredentials     string
	CertManagerReplicas     int    // The replica count for cert-manager and its components.
	CertManagerVersion      string // The version of cert-manager to deploy
	IstioCSRReplicas        int    // The replica count for the istio-csr component.
	SpiffeCSIDriverReplicas int    // The replica count for the csi-driver-spiffe component.
}

The ApplyInstallationYAMLOptions type describes additional configuration options for the operator's Installation custom resource.

type ApplyOperatorYAMLOptions

type ApplyOperatorYAMLOptions struct {
	Version       string // The version of the operator to use
	ImageRegistry string // A custom image registry for the operator image
	// RegistryCredentials is a string containing a GCP service account key to access the Jetstack Secure image registry.
	RegistryCredentials string
}

The ApplyOperatorYAMLOptions type contains fields used to configure the installation of the Jetstack Secure operator.

type CRDClient added in v0.1.8

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

CRDClient is used to query information on CRDs within a Kubernetes cluster.

func NewCRDClient added in v0.1.8

func NewCRDClient(config *rest.Config) (*CRDClient, error)

NewCRDClient returns a new instance of the CRDClient that can be used to query information on CRDs within a cluster

func (*CRDClient) Status added in v0.1.8

func (c *CRDClient) Status(ctx context.Context) error

type ComponentStatus

type ComponentStatus struct {
	Name    string `json:"name"`
	Ready   bool   `json:"ready"`
	Message string `json:"message,omitempty"`
}

ComponentStatus describes the status of an individual operator component.

type InstallationClient

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

The InstallationClient is used to query information on an Installation resource within a Kubernetes cluster.

func NewInstallationClient

func NewInstallationClient(config *rest.Config) (*InstallationClient, error)

NewInstallationClient returns a new instance of the InstallationClient that will interact with the Kubernetes cluster specified in the rest.Config.

func (*InstallationClient) Status

Status returns a slice of ComponentStatus types that describe the state of individual components installed by the operator. Returns ErrNoInstallation if an Installation resource cannot be found in the cluster. It uses the status conditions on an Installation resource and maps those to a ComponentStatus, the ComponentStatus.Name field is chosen based on the content of the componentNames map. Add friendly names to that map to include additional component statuses to return.

Jump to

Keyboard shortcuts

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