Documentation ¶
Overview ¶
Package operator contains functions for installing and managing the jetstack operator.
Index ¶
- Variables
- func ApplyInstallationYAML(ctx context.Context, applier Applier, options ApplyInstallationYAMLOptions) error
- func ApplyOperatorYAML(ctx context.Context, applier Applier, options ApplyOperatorYAMLOptions) error
- func ImagePullSecret(keyData string) (*corev1.Secret, error)
- func SuggestedActions(options ApplyInstallationYAMLOptions) []prompt.Suggestion
- func Versions() ([]string, error)
- type Applier
- type ApplyInstallationYAMLOptions
- type ApplyOperatorYAMLOptions
- type ComponentStatus
- type InstallationClient
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoInstallation is the error given when querying an Installation resource that does not exist. ErrNoInstallation = errors.New("no installation") )
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.
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 ¶
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.
Types ¶
type Applier ¶
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 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 ¶
func (ic *InstallationClient) Status(ctx context.Context) ([]ComponentStatus, error)
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.