Documentation ¶
Overview ¶
Package kindenv manages Kind (github.com/kubernetes-sigs/kind) environments.
Index ¶
- func SkopeoCommand(ctx context.Context, args ...string) *exec.Cmd
- type Cluster
- func (c *Cluster) AllocatePort(ctx context.Context, namespace, service string) (string, error)
- func (c *Cluster) Close() error
- func (c *Cluster) ConfigurePachctl(ctx context.Context, namespace string, activate bool) error
- func (c *Cluster) Create(ctx context.Context, opts *CreateOpts) (retErr error)
- func (c *Cluster) Delete(ctx context.Context) error
- func (c *Cluster) GetConfig(ctx context.Context, namespace string) (*ClusterConfig, error)
- func (c *Cluster) GetKubeconfig(ctx context.Context) (Kubeconfig, error)
- func (c *Cluster) InstallPachyderm(ctx context.Context, install *HelmConfig) error
- func (c *Cluster) PachdAddress(ctx context.Context, namespace string) (string, error)
- func (c *Cluster) PushImage(ctx context.Context, src string, name string) error
- func (c *Cluster) PushPachyderm(ctx context.Context) error
- func (c *Cluster) WaitForPachd(ctx context.Context, namespace string) error
- type ClusterConfig
- type CreateOpts
- type HelmConfig
- type Kubeconfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents a Kind cluster. It may not exist yet.
func New ¶
New creates a new Cluster object, suitable for manipulating the named cluster. If name is empty, the cluster in the current kubernetes context will be used, if it's a pachdev cluster.
func (*Cluster) AllocatePort ¶
Allocate port returns a port number for the named service. If multiple ports are allocated to the named service, they are all returned separated by commas.
func (*Cluster) ConfigurePachctl ¶
func (*Cluster) Create ¶
func (c *Cluster) Create(ctx context.Context, opts *CreateOpts) (retErr error)
Create creates a new cluster.
func (*Cluster) GetKubeconfig ¶
func (c *Cluster) GetKubeconfig(ctx context.Context) (Kubeconfig, error)
GetKubeconfig returns a Kubeconfig object for the cluster. Call `Close()` when you're done to avoid filling up /tmp with junk.
func (*Cluster) InstallPachyderm ¶
func (c *Cluster) InstallPachyderm(ctx context.Context, install *HelmConfig) error
InstallPachyderm installs or upgrades Pachyderm.
func (*Cluster) PachdAddress ¶
func (*Cluster) PushPachyderm ¶
PushPachyderm pushes the images necessary to run Pachyderm.
type ClusterConfig ¶
type ClusterConfig struct { // Version of kindenv that deployed the cluster. Version int // A skopeo url that pushes images to this cluster. ImagePushPath string // A docker prefix that pulls images pushed to this cluster; use in // pod.spec.containers.image to refer to images pushed to this cluster. ImagePullPath string // A hostname that serves the exposed ports of the cluster. Hostname string // If true, use https/grpcs. TLS bool // If set, override the version of console. ConsoleTag string }
ClusterConfig is the configuration of the attached cluster.
type CreateOpts ¶
type CreateOpts struct { // TestNamespaceCount controls how many K8s tests can run concurrently. TestNamespaceCount int32 // ExternalHostname is the hostname for the cluster. ExternalHostname string // ImagePushPath is the Skopeo path of the local container registry from the host machine, // usually something like `oci:/path/to/pach-registry`. If empty, a new registry will be // started and a correct push path automatically configured. ImagePushPath string // BindHTTPPorts, if true, binds <externalHost>:80 and <externalHost>:443 to 30080 and 30443 // in the cluster; used for the install of Pachyderm in the "default" namespace. BindHTTPPorts bool // StartingPort is the port number that begins the exposed ports for this cluster. Each // TestNamespace gets 10. If -1, then no ports will be created. If unset (0), then ports // start at 30500. StartingPort int32 // TLS is true if external communications to pachd/console should use tls (grpcs, https). TLS bool // contains filtered or unexported fields }
CreateOpts specifies a Kind environment.
Note: kind treats port numbers as int32, so we do too.
type HelmConfig ¶
type HelmConfig struct { Namespace string // Must be set; "" does not mean "default". Diff bool // If true, print diff instead of performing upgrade. NoSwitchContext bool // If true, don't switch the active Pachyderm context to this. ConsoleTag string // If set, use a different image tag of console. }
type Kubeconfig ¶
type Kubeconfig string
Kubeconfig is the path to a kubeconfig file. It has methods on it for working on the cluster that is configured by that file.
func (Kubeconfig) Client ¶
func (k Kubeconfig) Client() (kubernetes.Interface, error)
Client returns a kubernetes.Interface connected to the cluster referenced by k.
func (Kubeconfig) HelmCommand ¶
HelmCommand returns an exec.Cmd that will run helm.
func (Kubeconfig) KubectlCommand ¶
KubectlCommand returns an exec.Cmd that will run kubectl.