Documentation
¶
Index ¶
- Constants
- Variables
- type Builder
- func (b *Builder) Build(ctx context.Context) (clusters.Cluster, error)
- func (b *Builder) WithClusterMinorVersion(major, minor uint64) *Builder
- func (b *Builder) WithClusterVersion(version semver.Version) *Builder
- func (b *Builder) WithCreateSubnet(create bool) *Builder
- func (b *Builder) WithLabels(labels map[string]string) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithNodeMachineType(machineType string) *Builder
- func (b *Builder) WithReleaseChannel(ch ReleaseChannel) *Builder
- func (b *Builder) WithWaitForTeardown(wait bool) *Builder
- type Cluster
- func (c *Cluster) Cleanup(ctx context.Context) error
- func (c *Cluster) Client() *kubernetes.Clientset
- func (c *Cluster) Config() *rest.Config
- func (c *Cluster) DeleteAddon(ctx context.Context, addon clusters.Addon) error
- func (c *Cluster) DeployAddon(ctx context.Context, addon clusters.Addon) error
- func (c *Cluster) DumpDiagnostics(ctx context.Context, meta string) (string, error)
- func (c *Cluster) GetAddon(name clusters.AddonName) (clusters.Addon, error)
- func (c *Cluster) IPFamily() clusters.IPFamily
- func (c *Cluster) ListAddons() []clusters.Addon
- func (c *Cluster) Name() string
- func (c *Cluster) Type() clusters.Type
- func (c *Cluster) Version() (semver.Version, error)
- type ReleaseChannel
Constants ¶
const ( // GKECreateLabel is the name of the label which be added to any cluster created with KTF and // indicates which Google Cloud IAM Service Account created the cluster. GKECreateLabel = "ktf_created_by" // GKEClusterType indicates that the Kubernetes cluster was provisioned by Google Kubernetes Engine (GKE) GKEClusterType clusters.Type = "gke" // GKECredsVar indicates the environment variable used to provide auth credentials for GKE GKECredsVar = "GOOGLE_APPLICATION_CREDENTIALS" //nolint:gosec // GKEProjectVar indicates the environment variable used to provide a default gcloud project GKEProjectVar = "GOOGLE_PROJECT" // GKELocationVar indicates the environment variable used to provide a default gcloud region GKELocationVar = "GOOGLE_LOCATION" )
Variables ¶
var ( // EnvKeepCluster indicates whether the caller wants the cluster to remain after tests for manual inspection. EnvKeepCluster = os.Getenv("GKE_KEEP_CLUSTER") )
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { Name string // contains filtered or unexported fields }
Builder generates clusters.Cluster objects backed by GKE given provided configuration options.
func NewBuilder ¶
NewBuilder provides a new *Builder object.
func (*Builder) Build ¶
Build creates and configures clients for a GKE-based Kubernetes clusters.Cluster.
func (*Builder) WithClusterMinorVersion ¶
WithClusterMinorVersion configures the Kubernetes cluster version according to a provided Major and Minor version, but will automatically select the latest patch version of that minor release (for convenience over the caller having to know the entire version tag).
func (*Builder) WithClusterVersion ¶
WithClusterVersion configures the Kubernetes cluster version for the Builder to use when building the GKE cluster.
func (*Builder) WithCreateSubnet ¶ added in v0.25.0
WithCreateSubnet sets a flag telling whether the builder should create a subnet for the cluster. If set to `true`, it will create a subnetwork in a default VPC with a uniquely generated name. The subnetwork will be removed once the cluster gets removed. https://cloud.google.com/sdk/gcloud/reference/container/clusters/create#--create-subnetwork
Default: `false`.
func (*Builder) WithLabels ¶ added in v0.26.0
WithLabels adds labels that the created cluster is going to be labeled with.
func (*Builder) WithNodeMachineType ¶ added in v0.30.0
func (*Builder) WithReleaseChannel ¶ added in v0.43.0
func (b *Builder) WithReleaseChannel(ch ReleaseChannel) *Builder
WithReleaseChannel sets the release channel of the cluster.
func (*Builder) WithWaitForTeardown ¶ added in v0.25.0
WithWaitForTeardown sets a flag telling whether the cluster should wait for a cleanup operation synchronously.
Default: `false`.
type Cluster ¶ added in v0.11.0
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is a clusters.Cluster implementation backed by Google Kubernetes Engine (GKE)
func NewFromExisting ¶ added in v0.3.2
func NewFromExisting(ctx context.Context, name, project, location string, jsonCreds []byte) (*Cluster, error)
NewFromExisting provides a new clusters.Cluster backed by an existing GKE cluster.
func NewFromExistingWithEnv ¶ added in v0.3.2
NewFromExistingWithEnv provides a new clusters.Cluster backed by an existing GKE cluster, but allows some of the configuration to be filled in from the ENV instead of arguments.
func (*Cluster) Client ¶ added in v0.11.0
func (c *Cluster) Client() *kubernetes.Clientset
func (*Cluster) DeleteAddon ¶ added in v0.11.0
func (*Cluster) DeployAddon ¶ added in v0.11.0
func (*Cluster) DumpDiagnostics ¶ added in v0.24.0
DumpDiagnostics produces diagnostics data for the cluster at a given time. It uses the provided meta string to write to meta.txt file which will allow for diagnostics identification. It returns the path to directory containing all the diagnostic files and an error.
func (*Cluster) ListAddons ¶ added in v0.11.0
type ReleaseChannel ¶ added in v0.43.0
type ReleaseChannel string
ReleaseChannel is a type for specifying the release channel of the cluster. See https://cloud.google.com/kubernetes-engine/docs/release-notes for more details.
const ( ReleaseChannelRapid ReleaseChannel = "rapid" ReleaseChannelRegular ReleaseChannel = "regular" ReleaseChannelStable ReleaseChannel = "stable" )