Documentation
¶
Index ¶
- Constants
- Variables
- func Ingress(hosts []string) *networkingv1.Ingress
- type Client
- type Cluster
- type DefaultK8sClient
- func (d *DefaultK8sClient) DeploymentList(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
- func (d *DefaultK8sClient) DeploymentRestart(ctx context.Context, namespace, name string) error
- func (d *DefaultK8sClient) EventsWatch(ctx context.Context, namespace string) (watch.Interface, error)
- func (d *DefaultK8sClient) IngressCreate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
- func (d *DefaultK8sClient) IngressExists(ctx context.Context, namespace string, ingress string) bool
- func (d *DefaultK8sClient) IngressUpdate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
- func (d *DefaultK8sClient) LogsGet(ctx context.Context, namespace string, name string) (string, error)
- func (d *DefaultK8sClient) NamespaceCreate(ctx context.Context, namespace string) error
- func (d *DefaultK8sClient) NamespaceDelete(ctx context.Context, namespace string) error
- func (d *DefaultK8sClient) NamespaceExists(ctx context.Context, namespace string) bool
- func (d *DefaultK8sClient) PersistentVolumeClaimCreate(ctx context.Context, namespace, name, volumeName string) error
- func (d *DefaultK8sClient) PersistentVolumeClaimDelete(ctx context.Context, namespace, name, _ string) error
- func (d *DefaultK8sClient) PersistentVolumeClaimExists(ctx context.Context, namespace, name, _ string) bool
- func (d *DefaultK8sClient) PersistentVolumeCreate(ctx context.Context, namespace, name string) error
- func (d *DefaultK8sClient) PersistentVolumeDelete(ctx context.Context, _, name string) error
- func (d *DefaultK8sClient) PersistentVolumeExists(ctx context.Context, _, name string) bool
- func (d *DefaultK8sClient) PodList(ctx context.Context, namespace string) (*corev1.PodList, error)
- func (d *DefaultK8sClient) SecretCreateOrUpdate(ctx context.Context, secret corev1.Secret) error
- func (d *DefaultK8sClient) SecretDeleteCollection(ctx context.Context, namespace, _type string) error
- func (d *DefaultK8sClient) SecretGet(ctx context.Context, namespace, name string) (*corev1.Secret, error)
- func (d *DefaultK8sClient) ServerVersionGet() (string, error)
- func (d *DefaultK8sClient) ServiceGet(ctx context.Context, namespace string, name string) (*corev1.Service, error)
- func (d *DefaultK8sClient) StreamPodLogs(ctx context.Context, namespace string, podName string, since time.Time) (io.ReadCloser, error)
- type ExtraVolumeMount
- type Logger
- type Provider
Constants ¶
View Source
const ( Kind = "kind" Test = "test" )
Variables ¶
View Source
var ( // DefaultProvider represents the kind (https://kind.sigs.k8s.io/) provider. DefaultProvider = Provider{ Name: Kind, ClusterName: "airbyte-abctl", Context: "kind-airbyte-abctl", Kubeconfig: paths.Kubeconfig, } // TestProvider represents a test provider, for testing purposes TestProvider = Provider{ Name: Test, ClusterName: "test-airbyte-abctl", Context: "test-airbyte-abctl", Kubeconfig: filepath.Join(os.TempDir(), "abctl", paths.FileKubeconfig), } )
View Source
var DefaultPersistentVolumeSize = resource.MustParse("500Mi")
DefaultPersistentVolumeSize is the size of the disks created by the persistent-volumes and requested by the persistent-volume-claims.
Functions ¶
func Ingress ¶
func Ingress(hosts []string) *networkingv1.Ingress
Ingress creates an ingress type for defining the webapp ingress rules.
Types ¶
type Client ¶
type Client interface {
// DeploymentList returns a list of all the services within the namespace
DeploymentList(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
// DeploymentRestart will force a restart of the deployment name in the provided namespace.
// This is a blocking call, it should only return once the deployment has completed.
DeploymentRestart(ctx context.Context, namespace, name string) error
EventsWatch(ctx context.Context, namespace string) (watch.Interface, error)
IngressCreate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
IngressExists(ctx context.Context, namespace string, ingress string) bool
IngressUpdate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
LogsGet(ctx context.Context, namespace string, name string) (string, error)
NamespaceCreate(ctx context.Context, namespace string) error
NamespaceExists(ctx context.Context, namespace string) bool
NamespaceDelete(ctx context.Context, namespace string) error
PersistentVolumeCreate(ctx context.Context, namespace, name string) error
PersistentVolumeExists(ctx context.Context, namespace, name string) bool
PersistentVolumeDelete(ctx context.Context, namespace, name string) error
PersistentVolumeClaimCreate(ctx context.Context, namespace, name, volumeName string) error
PersistentVolumeClaimExists(ctx context.Context, namespace, name, volumeName string) bool
PersistentVolumeClaimDelete(ctx context.Context, namespace, name, volumeName string) error
PodList(ctx context.Context, namespace string) (*corev1.PodList, error)
SecretCreateOrUpdate(ctx context.Context, secret corev1.Secret) error
// SecretDeleteCollection deletes multiple secrets.
// Note this takes a `type` and not a `name`. All secrets matching this type will be removed.
SecretDeleteCollection(ctx context.Context, namespace, _type string) error
SecretGet(ctx context.Context, namespace, name string) (*corev1.Secret, error)
ServiceGet(ctx context.Context, namespace, name string) (*corev1.Service, error)
StreamPodLogs(ctx context.Context, namespace string, podName string, since time.Time) (io.ReadCloser, error)
// ServerVersionGet returns the kubernetes version.
ServerVersionGet() (string, error)
}
Client primarily for testing purposes
type Cluster ¶
type Cluster interface {
// Create a cluster with the provided name.
Create(ctx context.Context, portHTTP int, extraMounts []ExtraVolumeMount) error
// Delete a cluster with the provided name.
Delete(ctx context.Context) error
// Exists returns true if the cluster exists, false otherwise.
Exists(ctx context.Context) bool
LoadImages(ctx context.Context, dockerClient docker.Client, images []string)
}
Cluster is an interface representing all the actions taken at the cluster level.
type DefaultK8sClient ¶
type DefaultK8sClient struct {
ClientSet kubernetes.Interface
}
DefaultK8sClient converts the official kubernetes client to our more manageable (and testable) interface
func (*DefaultK8sClient) DeploymentList ¶
func (d *DefaultK8sClient) DeploymentList(ctx context.Context, namespace string) (*appsv1.DeploymentList, error)
func (*DefaultK8sClient) DeploymentRestart ¶
func (d *DefaultK8sClient) DeploymentRestart(ctx context.Context, namespace, name string) error
func (*DefaultK8sClient) EventsWatch ¶
func (*DefaultK8sClient) IngressCreate ¶
func (d *DefaultK8sClient) IngressCreate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
func (*DefaultK8sClient) IngressExists ¶
func (*DefaultK8sClient) IngressUpdate ¶
func (d *DefaultK8sClient) IngressUpdate(ctx context.Context, namespace string, ingress *networkingv1.Ingress) error
func (*DefaultK8sClient) NamespaceCreate ¶
func (d *DefaultK8sClient) NamespaceCreate(ctx context.Context, namespace string) error
func (*DefaultK8sClient) NamespaceDelete ¶
func (d *DefaultK8sClient) NamespaceDelete(ctx context.Context, namespace string) error
func (*DefaultK8sClient) NamespaceExists ¶
func (d *DefaultK8sClient) NamespaceExists(ctx context.Context, namespace string) bool
func (*DefaultK8sClient) PersistentVolumeClaimCreate ¶
func (d *DefaultK8sClient) PersistentVolumeClaimCreate(ctx context.Context, namespace, name, volumeName string) error
func (*DefaultK8sClient) PersistentVolumeClaimDelete ¶
func (d *DefaultK8sClient) PersistentVolumeClaimDelete(ctx context.Context, namespace, name, _ string) error
func (*DefaultK8sClient) PersistentVolumeClaimExists ¶
func (d *DefaultK8sClient) PersistentVolumeClaimExists(ctx context.Context, namespace, name, _ string) bool
func (*DefaultK8sClient) PersistentVolumeCreate ¶
func (d *DefaultK8sClient) PersistentVolumeCreate(ctx context.Context, namespace, name string) error
func (*DefaultK8sClient) PersistentVolumeDelete ¶
func (d *DefaultK8sClient) PersistentVolumeDelete(ctx context.Context, _, name string) error
func (*DefaultK8sClient) PersistentVolumeExists ¶
func (d *DefaultK8sClient) PersistentVolumeExists(ctx context.Context, _, name string) bool
func (*DefaultK8sClient) SecretCreateOrUpdate ¶
func (*DefaultK8sClient) SecretDeleteCollection ¶
func (d *DefaultK8sClient) SecretDeleteCollection(ctx context.Context, namespace, _type string) error
func (*DefaultK8sClient) ServerVersionGet ¶
func (d *DefaultK8sClient) ServerVersionGet() (string, error)
func (*DefaultK8sClient) ServiceGet ¶
func (*DefaultK8sClient) StreamPodLogs ¶
func (d *DefaultK8sClient) StreamPodLogs(ctx context.Context, namespace string, podName string, since time.Time) (io.ReadCloser, error)
type ExtraVolumeMount ¶
ExtraVolumeMount defines a host volume mount for the Kind cluster
type Logger ¶
type Logger struct {
}
Logger is an implementation of the WarningHandler that converts the k8s warning messages into abctl debug messages.
Click to show internal directories.
Click to hide internal directories.