Documentation ¶
Index ¶
- Constants
- Variables
- func ContainerIDFromContainerStatus(status v1.ContainerStatus) (container.ID, error)
- func ContainerMatching(pod *v1.Pod, ref container.RefSelector) (v1.ContainerStatus, error)
- func ContainerNameFromContainerStatus(status v1.ContainerStatus) container.Name
- func ContainerSpecOf(pod *v1.Pod, status v1.ContainerStatus) v1.Container
- func ExtractPodTemplateSpec(obj interface{}) ([]*v1.PodTemplateSpec, error)
- func ExtractPods(obj interface{}) ([]*v1.PodSpec, error)
- func FakePodSpec(image reference.NamedTagged) v1.PodSpec
- func FakePodStatus(image reference.NamedTagged, phase string) v1.PodStatus
- func FindImageNamedTaggedMatching(pod v1.PodSpec, selector container.RefSelector) (reference.NamedTagged, error)
- func FindImageRefMatching(pod v1.PodSpec, selector container.RefSelector) (reference.Named, error)
- func FixContainerStatusImages(pod *v1.Pod)
- func IsContainerExited(pod v1.PodStatus, container v1.ContainerStatus) bool
- func IsUnschedulable(pod v1.PodStatus) (bool, string)
- func LabelPairsToSelector(lps []model.LabelPair) labels.Selector
- func NewK8sOnlyManifest(name model.ManifestName, entities []K8sEntity) (model.Manifest, error)
- func NewK8sOnlyManifestFromYAML(yaml string) (model.Manifest, error)
- func NewTarget(name model.TargetName, entities []K8sEntity, portForwards []model.PortForward, ...) (model.K8sTarget, error)
- func NormalizeContainerID(id string) (container.ID, error)
- func PodContainsRef(pod v1.PodSpec, selector container.RefSelector) (bool, error)
- func ProvideClientConfig() clientcmd.ClientConfig
- func ProvideClientSet(cfg *rest.Config) (*kubernetes.Clientset, error)
- func ProvideContainerRegistry(ctx context.Context, kCli Client) container.Registry
- func ProvideContainerRuntime(ctx context.Context, kCli Client) container.Runtime
- func ProvideKubeConfig(clientLoader clientcmd.ClientConfig) (*api.Config, error)
- func ProvideKubectlRunner(kubeContext KubeContext, logLevel KubectlLogLevel) kubectlRunner
- func ProvideRESTConfig(clientLoader clientcmd.ClientConfig) (*rest.Config, error)
- func ProvideServerVersion(clientSet *kubernetes.Clientset) (*version.Info, error)
- func SelectorEqual(a, b labels.Selector) bool
- func SerializeSpecYAML(decoded []K8sEntity) (string, error)
- func ServiceURL(service *v1.Service, ip NodeIP) (*url.URL, error)
- func SetUIDForTest(t *testing.T, e *K8sEntity, UID string)
- func TiltDeployLabel(dID model.DeployID) model.LabelPair
- func TiltRunLabel() model.LabelPair
- func TiltRunSelector() labels.Selector
- func UniqueNames(es []K8sEntity, minComponents int) []string
- func WaitForContainerReady(ctx context.Context, client Client, pod *v1.Pod, ref container.RefSelector) (v1.ContainerStatus, error)
- type BufferCloser
- type Client
- type Env
- type EventWithEntity
- type ExecCall
- type FakeK8sClient
- func (c *FakeK8sClient) ConnectedToCluster(ctx context.Context) error
- func (c *FakeK8sClient) ContainerLogs(ctx context.Context, pID PodID, cName container.Name, n Namespace, ...) (io.ReadCloser, error)
- func (c *FakeK8sClient) ContainerRuntime(ctx context.Context) container.Runtime
- func (c *FakeK8sClient) Delete(ctx context.Context, entities []K8sEntity) error
- func (c *FakeK8sClient) EmitEvent(ctx context.Context, evt *v1.Event)
- func (c *FakeK8sClient) EmitPod(ls labels.Selector, p *v1.Pod)
- func (c *FakeK8sClient) EmitService(ls labels.Selector, s *v1.Service)
- func (c *FakeK8sClient) Exec(ctx context.Context, podID PodID, cName container.Name, n Namespace, ...) error
- func (c *FakeK8sClient) ForwardPort(ctx context.Context, namespace Namespace, podID PodID, ...) (int, func(), error)
- func (c *FakeK8sClient) Get(group, version, kind, namespace, name, resourceVersion string) (*unstructured.Unstructured, error)
- func (c *FakeK8sClient) PodByID(ctx context.Context, pID PodID, n Namespace) (*v1.Pod, error)
- func (c *FakeK8sClient) PrivateRegistry(ctx context.Context) container.Registry
- func (c *FakeK8sClient) SetLogsForPodContainer(pID PodID, cName container.Name, logs string)
- func (c *FakeK8sClient) TearDown()
- func (c *FakeK8sClient) Upsert(ctx context.Context, entities []K8sEntity) error
- func (c *FakeK8sClient) WatchEvents(ctx context.Context) (<-chan *v1.Event, error)
- func (c *FakeK8sClient) WatchPod(ctx context.Context, pod *v1.Pod) (watch.Interface, error)
- func (c *FakeK8sClient) WatchPods(ctx context.Context, ls labels.Selector) (<-chan *v1.Pod, error)
- func (c *FakeK8sClient) WatchServices(ctx context.Context, lps []model.LabelPair) (<-chan *v1.Service, error)
- func (c *FakeK8sClient) WatchedSelectors() []labels.Selector
- type GetKey
- type JSONPath
- type K8sClient
- func (k K8sClient) ConnectedToCluster(ctx context.Context) error
- func (k K8sClient) ContainerLogs(ctx context.Context, pID PodID, cName container.Name, n Namespace, ...) (io.ReadCloser, error)
- func (c K8sClient) ContainerRuntime(ctx context.Context) container.Runtime
- func (k K8sClient) Delete(ctx context.Context, entities []K8sEntity) error
- func (k K8sClient) Exec(ctx context.Context, podID PodID, cName container.Name, n Namespace, ...) error
- func (k K8sClient) ForwardPort(ctx context.Context, namespace Namespace, podID PodID, ...) (localPort int, closer func(), err error)
- func (k K8sClient) Get(group, version, kind, namespace, name, resourceVersion string) (*unstructured.Unstructured, error)
- func (k K8sClient) PodByID(ctx context.Context, pID PodID, n Namespace) (*v1.Pod, error)
- func (c K8sClient) PrivateRegistry(ctx context.Context) container.Registry
- func (k K8sClient) Upsert(ctx context.Context, entities []K8sEntity) error
- func (kCli K8sClient) WatchEvents(ctx context.Context) (<-chan *v1.Event, error)
- func (k K8sClient) WatchPod(ctx context.Context, pod *v1.Pod) (watch.Interface, error)
- func (kCli K8sClient) WatchPods(ctx context.Context, ls labels.Selector) (<-chan *v1.Pod, error)
- func (kCli K8sClient) WatchServices(ctx context.Context, lps []model.LabelPair) (<-chan *v1.Service, error)
- type K8sEntity
- func EntitiesWithDependentsAndRest(entities []K8sEntity) (withDependents, rest []K8sEntity)
- func Filter(entities []K8sEntity, test func(e K8sEntity) (bool, error)) (passing, rest []K8sEntity, err error)
- func FilterByHasPodTemplateSpec(entities []K8sEntity) (passing, rest []K8sEntity, err error)
- func FilterByImage(entities []K8sEntity, img container.RefSelector, ...) (passing, rest []K8sEntity, err error)
- func FilterByMatchesPodTemplateSpec(withPodSpec K8sEntity, entities []K8sEntity) (passing, rest []K8sEntity, err error)
- func FilterByMetadataLabels(entities []K8sEntity, labels map[string]string) (passing, rest []K8sEntity, err error)
- func FilterBySelectorMatchesLabels(entities []K8sEntity, labels map[string]string) (passing, rest []K8sEntity, err error)
- func ImmutableEntities(entities []K8sEntity) []K8sEntity
- func InjectCommand(entity K8sEntity, ref reference.Named, cmd model.Cmd) (K8sEntity, error)
- func InjectImageDigest(entity K8sEntity, selector container.RefSelector, injectRef reference.Named, ...) (K8sEntity, bool, error)
- func InjectImagePullPolicy(entity K8sEntity, policy v1.PullPolicy) (K8sEntity, error)
- func InjectLabels(entity K8sEntity, labels []model.LabelPair) (K8sEntity, error)
- func MutableEntities(entities []K8sEntity) []K8sEntity
- func OverwriteLabels(entity K8sEntity, labels []model.LabelPair) (K8sEntity, error)
- func ParseYAML(k8sYaml io.Reader) ([]K8sEntity, error)
- func ParseYAMLFromString(yaml string) ([]K8sEntity, error)
- func (e K8sEntity) DeepCopy() K8sEntity
- func (e K8sEntity) FindImages(imageJSONPaths []JSONPath, envVarImages []container.RefSelector) ([]reference.Named, error)
- func (e K8sEntity) HasImage(image container.RefSelector, imageJSONPaths []JSONPath, inEnvVars bool) (bool, error)
- func (e K8sEntity) HasKind(kind string) bool
- func (e K8sEntity) HasName(name string) bool
- func (e K8sEntity) HasNamespace(ns string) bool
- func (e K8sEntity) ImmutableOnceCreated() bool
- func (e K8sEntity) Labels() map[string]string
- func (e K8sEntity) MatchesMetadataLabels(labels map[string]string) (bool, error)
- func (e K8sEntity) Name() string
- func (e K8sEntity) Namespace() Namespace
- func (e K8sEntity) SelectorMatchesLabels(labels map[string]string) bool
- func (e K8sEntity) UID() UID
- type KubeContext
- type KubectlLogLevel
- type LoadBalancer
- type LoadBalancerSpec
- type NaiveRuntimeSource
- type Namespace
- type NodeID
- type NodeIP
- type PodAndCName
- type PodID
- type PortForwarder
- type RuntimeSource
- type ServiceName
- type TypeIndex
- type UID
Constants ¶
const ContainerIDPrefix = "docker://"
const DefaultNamespace = Namespace("default")
const MagicTestContainerID = "tilt-testcontainer"
A magic constant. If the docker client returns this constant, we always match even if the container doesn't have the correct image name.
const ManifestNameLabel = "tilt-manifest"
const TiltDeployIDLabel = "tilt-deployid"
const TiltRunIDLabel = "tilt-runid"
Variables ¶
var ForbiddenFieldsRe = regexp.MustCompile(`updates to .* are forbidden`)
var NoFilter = func(v reflect.Value) bool { return true }
var TiltRunID = uuid.New().String()
Functions ¶
func ContainerIDFromContainerStatus ¶
func ContainerIDFromContainerStatus(status v1.ContainerStatus) (container.ID, error)
func ContainerMatching ¶
func ContainerMatching(pod *v1.Pod, ref container.RefSelector) (v1.ContainerStatus, error)
func ContainerNameFromContainerStatus ¶
func ContainerNameFromContainerStatus(status v1.ContainerStatus) container.Name
func ContainerSpecOf ¶
func ExtractPodTemplateSpec ¶ added in v0.1.0
func ExtractPodTemplateSpec(obj interface{}) ([]*v1.PodTemplateSpec, error)
func ExtractPods ¶
func FakePodSpec ¶
func FakePodSpec(image reference.NamedTagged) v1.PodSpec
func FakePodStatus ¶
func FakePodStatus(image reference.NamedTagged, phase string) v1.PodStatus
func FindImageNamedTaggedMatching ¶ added in v0.2.0
func FindImageNamedTaggedMatching(pod v1.PodSpec, selector container.RefSelector) (reference.NamedTagged, error)
func FindImageRefMatching ¶ added in v0.2.0
func FixContainerStatusImages ¶ added in v0.8.2
Kubernetes has a bug where the image ref in the container status can be wrong (though this does not mean the container is running unexpected code)
Repro steps: 1) Create an image and give it two different tags (A and B) 2) Deploy Pods with both A and B in the pod spec 3) The PodStatus will choose A or B for both pods.
More details here: https://github.com/kubernetes/kubernetes/issues/51017
For Tilt, it's pretty important that the image tag is correct (for matching purposes). To work around this bug, we change the image reference in ContainerStatus to match the ContainerSpec.
func IsContainerExited ¶
func IsContainerExited(pod v1.PodStatus, container v1.ContainerStatus) bool
If true, this means the container is gone and will never recover.
func IsUnschedulable ¶
Returns the error message if the pod is unschedulable
func LabelPairsToSelector ¶ added in v0.8.7
func NewK8sOnlyManifest ¶ added in v0.6.0
func NewK8sOnlyManifestFromYAML ¶ added in v0.9.3
func NormalizeContainerID ¶ added in v0.9.6
func PodContainsRef ¶
func ProvideClientConfig ¶ added in v0.7.11
func ProvideClientConfig() clientcmd.ClientConfig
func ProvideClientSet ¶ added in v0.7.11
func ProvideClientSet(cfg *rest.Config) (*kubernetes.Clientset, error)
func ProvideContainerRegistry ¶ added in v0.8.9
func ProvideContainerRuntime ¶ added in v0.7.11
func ProvideKubeConfig ¶ added in v0.7.11
func ProvideKubeConfig(clientLoader clientcmd.ClientConfig) (*api.Config, error)
func ProvideKubectlRunner ¶ added in v0.7.11
func ProvideKubectlRunner(kubeContext KubeContext, logLevel KubectlLogLevel) kubectlRunner
func ProvideRESTConfig ¶
func ProvideRESTConfig(clientLoader clientcmd.ClientConfig) (*rest.Config, error)
func ProvideServerVersion ¶ added in v0.7.11
func ProvideServerVersion(clientSet *kubernetes.Clientset) (*version.Info, error)
func SelectorEqual ¶ added in v0.7.1
func SerializeSpecYAML ¶ added in v0.8.8
Serializes the provided K8s objects as YAML.
By convention, all K8s objects contain ObjectMetadata, Spec, and Status. This only serializes the metadata and spec, skipping the status.
func TiltRunLabel ¶ added in v0.7.11
func TiltRunSelector ¶ added in v0.7.11
func UniqueNames ¶ added in v0.9.3
Calculates names for workloads by using the shortest uniquely matching identifiers
func WaitForContainerReady ¶
func WaitForContainerReady(ctx context.Context, client Client, pod *v1.Pod, ref container.RefSelector) (v1.ContainerStatus, error)
Types ¶
type BufferCloser ¶
func (BufferCloser) Close ¶
func (b BufferCloser) Close() error
type Client ¶
type Client interface { // Updates the entities, creating them if necessary. // // Tries to update them in-place if possible. But for certain resource types, // we might need to fallback to deleting and re-creating them. Upsert(ctx context.Context, entities []K8sEntity) error // Deletes all given entities. // // Currently ignores any "not found" errors, because that seems like the correct // behavior for our use cases. Delete(ctx context.Context, entities []K8sEntity) error Get(group, version, kind, namespace, name, resourceVersion string) (*unstructured.Unstructured, error) PodByID(ctx context.Context, podID PodID, n Namespace) (*v1.Pod, error) // Creates a channel where all changes to the pod are brodcast. // Takes a pod as input, to indicate the version of the pod where we start watching. WatchPod(ctx context.Context, pod *v1.Pod) (watch.Interface, error) // Streams the container logs ContainerLogs(ctx context.Context, podID PodID, cName container.Name, n Namespace, startTime time.Time) (io.ReadCloser, error) // Opens a tunnel to the specified pod+port. Returns the tunnel's local port and a function that closes the tunnel ForwardPort(ctx context.Context, namespace Namespace, podID PodID, optionalLocalPort, remotePort int) (localPort int, closer func(), err error) WatchPods(ctx context.Context, lps labels.Selector) (<-chan *v1.Pod, error) WatchServices(ctx context.Context, lps []model.LabelPair) (<-chan *v1.Service, error) WatchEvents(ctx context.Context) (<-chan *v1.Event, error) ConnectedToCluster(ctx context.Context) error ContainerRuntime(ctx context.Context) container.Runtime // Some clusters support a private image registry that we can push to. PrivateRegistry(ctx context.Context) container.Registry Exec(ctx context.Context, podID PodID, cName container.Name, n Namespace, cmd []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error }
func ProvideK8sClient ¶ added in v0.7.1
func ProvideK8sClient( ctx context.Context, env Env, pf PortForwarder, configNamespace Namespace, runner kubectlRunner, clientLoader clientcmd.ClientConfig) Client
type Env ¶
type Env string
func EnvFromConfig ¶ added in v0.7.11
func EnvFromString ¶
func ProvideEnv ¶ added in v0.7.11
func (Env) IsLocalCluster ¶
type EventWithEntity ¶ added in v0.8.9
A Kubernetes event and the entity to which it applies
func NewEventWithEntity ¶ added in v0.8.9
func NewEventWithEntity(evt *v1.Event, entity K8sEntity) EventWithEntity
type FakeK8sClient ¶
type FakeK8sClient struct { Yaml string Lb LoadBalancerSpec DeletedYaml string DeleteError error LastPodQueryNamespace Namespace LastPodQueryImage reference.NamedTagged PodLogsByPodAndContainer map[PodAndCName]BufferCloser ContainerLogsError error LastForwardPortPodID PodID LastForwardPortRemotePort int EventsWatchErr error UpsertError error Runtime container.Runtime Registry container.Registry GetResources map[GetKey]*unstructured.Unstructured ExecCalls []ExecCall // contains filtered or unexported fields }
func NewFakeK8sClient ¶
func NewFakeK8sClient() *FakeK8sClient
func (*FakeK8sClient) ConnectedToCluster ¶ added in v0.2.0
func (c *FakeK8sClient) ConnectedToCluster(ctx context.Context) error
func (*FakeK8sClient) ContainerLogs ¶
func (*FakeK8sClient) ContainerRuntime ¶ added in v0.7.11
func (c *FakeK8sClient) ContainerRuntime(ctx context.Context) container.Runtime
func (*FakeK8sClient) Delete ¶
func (c *FakeK8sClient) Delete(ctx context.Context, entities []K8sEntity) error
func (*FakeK8sClient) EmitEvent ¶ added in v0.8.9
func (c *FakeK8sClient) EmitEvent(ctx context.Context, evt *v1.Event)
func (*FakeK8sClient) EmitPod ¶ added in v0.7.1
func (c *FakeK8sClient) EmitPod(ls labels.Selector, p *v1.Pod)
func (*FakeK8sClient) EmitService ¶ added in v0.8.7
func (c *FakeK8sClient) EmitService(ls labels.Selector, s *v1.Service)
func (*FakeK8sClient) ForwardPort ¶
func (*FakeK8sClient) Get ¶ added in v0.9.2
func (c *FakeK8sClient) Get(group, version, kind, namespace, name, resourceVersion string) (*unstructured.Unstructured, error)
func (*FakeK8sClient) PrivateRegistry ¶ added in v0.8.9
func (c *FakeK8sClient) PrivateRegistry(ctx context.Context) container.Registry
func (*FakeK8sClient) SetLogsForPodContainer ¶ added in v0.7.11
func (c *FakeK8sClient) SetLogsForPodContainer(pID PodID, cName container.Name, logs string)
func (*FakeK8sClient) TearDown ¶ added in v0.8.9
func (c *FakeK8sClient) TearDown()
func (*FakeK8sClient) Upsert ¶
func (c *FakeK8sClient) Upsert(ctx context.Context, entities []K8sEntity) error
func (*FakeK8sClient) WatchEvents ¶ added in v0.8.4
func (*FakeK8sClient) WatchServices ¶
func (*FakeK8sClient) WatchedSelectors ¶ added in v0.7.1
func (c *FakeK8sClient) WatchedSelectors() []labels.Selector
type JSONPath ¶ added in v0.7.11
type JSONPath struct {
// contains filtered or unexported fields
}
This is just a wrapper around k8s jsonpath, mostly because k8s jsonpath doesn't produce errors containing the problematic path (and as long as we're here, deal with some of its other annoyances, like taking a "name" that doesn't do anything, and having a separate "Parse" step to make an instance actually useful, and making you use an io.Writer, and wrapping string results in quotes)
func NewJSONPath ¶ added in v0.7.11
func (JSONPath) Execute ¶ added in v0.7.11
Gets the value at the specified path NB: currently strips away surrounding quotes, which the underlying parser includes in its return value If, at some point, we want to distinguish between, e.g., ints and strings by the presence of quotes, this will need to be revisited.
type K8sClient ¶
type K8sClient struct {
// contains filtered or unexported fields
}
func (K8sClient) ConnectedToCluster ¶ added in v0.2.0
func (K8sClient) ContainerLogs ¶
func (K8sClient) ContainerRuntime ¶ added in v0.7.11
func (K8sClient) Delete ¶
Deletes all given entities.
Currently ignores any "not found" errors, because that seems like the correct behavior for our use cases.
func (K8sClient) ForwardPort ¶
func (K8sClient) Get ¶ added in v0.9.2
func (k K8sClient) Get(group, version, kind, namespace, name, resourceVersion string) (*unstructured.Unstructured, error)
func (K8sClient) PrivateRegistry ¶ added in v0.8.9
func (K8sClient) WatchEvents ¶ added in v0.8.9
type K8sEntity ¶
type K8sEntity struct { Obj runtime.Object Kind *schema.GroupVersionKind }
func EntitiesWithDependentsAndRest ¶ added in v0.9.5
EntitiesWithDependentsAndRest returns two lists of k8s entities: those that may have dependencies, which we will therefore want to apply first (i.e. namespaces and CRDs -- e.g. trying to create a pod in a nonexistent namespace causes an error); and the rest of the entities.
func Filter ¶ added in v0.1.0
func Filter(entities []K8sEntity, test func(e K8sEntity) (bool, error)) (passing, rest []K8sEntity, err error)
Filter returns two slices of entities: those passing the given test, and the remainder of the input.
func FilterByHasPodTemplateSpec ¶ added in v0.7.11
func FilterByImage ¶ added in v0.1.0
func FilterByMatchesPodTemplateSpec ¶ added in v0.7.11
func FilterByMetadataLabels ¶ added in v0.7.11
func FilterBySelectorMatchesLabels ¶ added in v0.7.11
func ImmutableEntities ¶
func InjectCommand ¶ added in v0.9.3
func InjectImageDigest ¶
func InjectImageDigest(entity K8sEntity, selector container.RefSelector, injectRef reference.Named, matchInEnvVars bool, policy v1.PullPolicy) (K8sEntity, bool, error)
Iterate through the fields of a k8s entity and replace a image name with its digest.
policy: The pull policy to set on the replaced image.
When working with a local k8s cluster, we want to set this to Never, to ensure that k8s fails hard if the image is missing from docker.
Returns: the new entity, whether the image was replaced, and an error.
func InjectImagePullPolicy ¶
func InjectImagePullPolicy(entity K8sEntity, policy v1.PullPolicy) (K8sEntity, error)
Iterate through the fields of a k8s entity and replace the image pull policy on all images.
func InjectLabels ¶
func MutableEntities ¶
func OverwriteLabels ¶ added in v0.7.11
func ParseYAML ¶
Parse the YAML into entities. Loosely based on https://github.com/kubernetes/cli-runtime/blob/d6a36215b15f83b94578f2ffce5d00447972e8ae/pkg/genericclioptions/resource/visitor.go#L583
func ParseYAMLFromString ¶
func (K8sEntity) FindImages ¶ added in v0.4.1
func (K8sEntity) HasImage ¶ added in v0.1.0
func (e K8sEntity) HasImage(image container.RefSelector, imageJSONPaths []JSONPath, inEnvVars bool) (bool, error)
HasImage indicates whether the given entity is tagged with the given image.
func (K8sEntity) HasNamespace ¶ added in v0.7.11
func (K8sEntity) ImmutableOnceCreated ¶
Most entities can be updated once running, but a few cannot.
func (K8sEntity) MatchesMetadataLabels ¶ added in v0.7.11
MatchesMetadataLabels indicates whether the given label(s) are a subset of metadata labels for the given entity.
func (K8sEntity) SelectorMatchesLabels ¶ added in v0.7.11
SelectorMatchesLabels indicates whether the pod selector of the given entity matches the given label(s). Currently only supports Services, but may be expanded to support other types that match pods via selectors.
type KubeContext ¶ added in v0.6.0
type KubeContext string
func ProvideKubeContext ¶ added in v0.7.11
func ProvideKubeContext(config *api.Config) (KubeContext, error)
type KubectlLogLevel ¶ added in v0.8.7
type KubectlLogLevel = int
type LoadBalancer ¶
type LoadBalancer struct { Spec LoadBalancerSpec URL *url.URL }
type LoadBalancerSpec ¶
func ToLoadBalancerSpec ¶
func ToLoadBalancerSpec(entity K8sEntity) (LoadBalancerSpec, bool)
Try to convert the current entity to a LoadBalancerSpec service
func ToLoadBalancerSpecs ¶
func ToLoadBalancerSpecs(entities []K8sEntity) []LoadBalancerSpec
type NaiveRuntimeSource ¶ added in v0.8.10
type NaiveRuntimeSource struct {
// contains filtered or unexported fields
}
func NewNaiveRuntimeSource ¶ added in v0.8.10
func NewNaiveRuntimeSource(r container.Runtime) NaiveRuntimeSource
type Namespace ¶
type Namespace string
func NamespaceFromPod ¶
func ProvideConfigNamespace ¶ added in v0.7.11
func ProvideConfigNamespace(clientLoader clientcmd.ClientConfig) Namespace
The namespace in the kubeconfig. Used as a default namespace in some (but not all) client commands. https://godoc.org/k8s.io/client-go/tools/clientcmd/api/v1#Context
type NodeIP ¶ added in v0.1.0
type NodeIP string
Some K8s environments expose a single IP for the whole cluster.
type PodAndCName ¶ added in v0.7.11
For keying PodLogsByPodAndContainer
type PortForwarder ¶
type PortForwarder func(ctx context.Context, restConfig *rest.Config, core apiv1.CoreV1Interface, namespace string, podID PodID, localPort int, remotePort int) (closer func(), err error)
func ProvidePortForwarder ¶
func ProvidePortForwarder() PortForwarder
type RuntimeSource ¶ added in v0.8.10
type ServiceName ¶
type ServiceName string
Source Files ¶
- client.go
- container.go
- encoder.go
- entity.go
- env.go
- errors.go
- events.go
- exec.go
- exploding_client.go
- extract.go
- fake_client.go
- image.go
- ip.go
- json_path.go
- kubectl_runner.go
- label.go
- label_selector.go
- labels.go
- logging_kubectl_runner.go
- names.go
- pod.go
- portforward.go
- registry.go
- runtime.go
- serialize.go
- target.go
- watch.go