kube

package
v0.19.786 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

README

template-go-library

This is a template for creating a new go library.

Usage

When you create a new repository in infra-github set the template field to template-go-library:

module "my-go-library" {
  source = "./modules/repository"

  name          = "my-go-library"
  description   = "Go library"
  topics        = ["go-lib", ]
  from_template = "template-go-library"
}

Once you have created your repository, be sure to make an initial release and tag, named v0.0.1. This is required because each release of a library will look up the previous tag and use it to create the next tag.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigForCluster

func ConfigForCluster(ctx context.Context, cInfo *ClusterInfo) (*rest.Config, error)

func GetKubeConfig

func GetKubeConfig() (*rest.Config, error)

func NewNamespaceClient

func NewNamespaceClient(ns string, client kubernetes.Interface) *namespaceClient

Types

type ClusterInfo

type ClusterInfo struct {
	// ID is the ID of the EKS cluster
	ID string `json:"id" hcl:"id" features:"template"`
	// Endpoint is the URL of the k8s api server
	Endpoint string `json:"endpoint" hcl:"endpoint" features:"template"`
	// CAData is the base64 encoded public certificate
	CAData string `json:"ca_data" hcl:"ca_data" features:"template"`

	EnvVars map[string]string `json:"env_vars" hcl:"env_vars" features:"template"`

	// KubeConfig will override the kube config, and be parsed instead of generating a new one
	KubeConfig string `json:"kube_config" faker:"-" hcl:"kube_config"`

	// If either an AWS auth or Azure auth is passed in, we will automatically use it to resolve credentials and set
	// them in the environment.
	AWSAuth   *awscredentials.Config   `json:"aws_auth" hcl:"aws_auth,block"`
	AzureAuth *azurecredentials.Config `json:"azure_auth" hcl:"azure_auth,block"`

	// If this is set, we will _not_ use aws-iam-authenticator, but rather inline create the token
	Inline bool `json:"inline"`

	// TrustedRoleARN is the arn of the role that should be assumed to interact with the cluster
	// NOTE(JM): we are deprecating this
	TrustedRoleARN string `json:"trusted_role_arn" hcl:"trusted_role_arn"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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