Documentation ¶
Overview ¶
Package cluster contains types and methods for managing clusters connected to the control plane.
Index ¶
- Variables
- func AgentServiceAccountSecret(keyData []byte, name, namespace string) *corev1.Secret
- func ApplyAgentYAML(ctx context.Context, applier Applier, options ApplyAgentYAMLOptions) error
- func Delete(ctx context.Context, httpClient HTTPClient, organization, name string) error
- type Applier
- type ApplyAgentYAMLOptions
- type Cluster
- type HTTPClient
- type ServiceAccount
Constants ¶
This section is empty.
Variables ¶
var ErrNoCluster = errors.New("no cluster")
ErrNoCluster is the error given when trying to delete a cluster that does not exist in the organization.
Functions ¶
func AgentServiceAccountSecret ¶ added in v0.1.15
AgentServiceAccountSecret takes a service account json and formats it as a k8s secret.
func ApplyAgentYAML ¶
func ApplyAgentYAML(ctx context.Context, applier Applier, options ApplyAgentYAMLOptions) error
ApplyAgentYAML generates all Kubernetes YAML required for an agent installation and returns it within an io.Reader implementation.
Types ¶
type Applier ¶
The Applier interface describes types that can Apply a stream of YAML-encoded Kubernetes resources.
type ApplyAgentYAMLOptions ¶
type ApplyAgentYAMLOptions struct { Organization string // The user's organization Name string // The name of the cluster ServiceAccount *ServiceAccount // The authentication credentials for the agent to use ImageRegistry string // The image registry for the agent image }
ApplyAgentYAMLOptions contains options for creating a YAML bundle to install the Jetstack Secure agent
type Cluster ¶
type Cluster struct { Name string `json:"cluster"` CertInventoryLastUpdated *time.Time `json:"certInventoryLastUpdated,omitempty"` IsDemoData bool `json:"isDemoData,omitempty"` }
The Cluster type describes the current state of a cluster connected to the control plane.
type HTTPClient ¶
type HTTPClient interface {
Do(ctx context.Context, method, uri string, body, out interface{}) error
}
The HTTPClient interface describes types that perform HTTP requests.
type ServiceAccount ¶
type ServiceAccount struct { UserID string `json:"user_id"` UserSecret string `json:"user_secret"` }
The ServiceAccount type describes the service account used by agent installations to authenticate their requests against the control-plane API.
func CreateServiceAccount ¶
func CreateServiceAccount(ctx context.Context, httpClient HTTPClient, organization, name string) (*ServiceAccount, error)
CreateServiceAccount makes an API call that generates a new service account for a cluster. This service account is used to authenticate uploads used by an agent installation.