Documentation ¶
Overview ¶
Package apps contains helpers to interact with various Kubernetes workloads.
Index ¶
- func CreateSimpleApplication(c clientset.Interface, namespace string, name, image string, ...) (*appsv1.Deployment, *corev1.Service)
- func GetLogs(c clientset.Interface, namespace, deploymentName string) io.ReadCloser
- func WaitForCompletion(c clientset.Interface, j *batchv1.Job)
- func WaitUntilAvailable(c clientset.Interface, d *appsv1.Deployment)
- type DeploymentOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSimpleApplication ¶
func CreateSimpleApplication(c clientset.Interface, namespace string, name, image string, internalPort, exposedPort uint16, deplOpts ...DeploymentOption) (*appsv1.Deployment, *corev1.Service)
CreateSimpleApplication is a helper which creates a simple Deployment exposed by a matching Service. `internalPort` is the TCP port number of the container managed by the Deployment. `exposedPort` is the TCP port number exposed by the Service.
func GetLogs ¶
func GetLogs(c clientset.Interface, namespace, deploymentName string) io.ReadCloser
GetLogs returns a stream of the logs of the first container in one of the randomly-chosen Pods managed by the Deployment with the given name. Meant to be used with Deployments that have a single replica and a single container.
func WaitForCompletion ¶
WaitForCompletion waits until the given Job completes.
func WaitUntilAvailable ¶
func WaitUntilAvailable(c clientset.Interface, d *appsv1.Deployment)
WaitUntilAvailable waits until the given Deployment becomes available.
Types ¶
type DeploymentOption ¶
type DeploymentOption func(*appsv1.Deployment)
DeploymentOption is a functional option for building a Deployment object.
func WithStartupProbe ¶
func WithStartupProbe(path string) DeploymentOption
WithStartupProbe sets the HTTP startup probe of a Deployment's first container, targetting this container's first TCP port.