sandwich-contexts-kubernetes
Safe HaskellNone
LanguageHaskell2010

Test.Sandwich.Contexts.Kubernetes.MinikubeCluster

Description

Create and manage Kubernetes clusters via Minikube.

Synopsis

Introducing a cluster via Minikube

introduceMinikubeClusterViaNix Source #

Arguments

:: forall context (m :: Type -> Type). (HasBaseContext context, MonadUnliftIO m, HasNixContext context) 
=> MinikubeClusterOptions

Options

-> SpecFree (MinikubeClusterContext context) m ()

Child spec

-> SpecFree context m ()

Parent spec

Introduce a Minikube cluster, deriving the minikube binary from the Nix context.

introduceMinikubeClusterViaEnvironment Source #

Arguments

:: forall context (m :: Type -> Type). (HasBaseContext context, MonadUnliftIO m) 
=> MinikubeClusterOptions

Options

-> SpecFree (MinikubeClusterContext context) m () 
-> SpecFree context m () 

Introduce a Minikube cluster, deriving the minikube binary from the PATH.

introduceMinikubeCluster' Source #

Arguments

:: forall context (m :: Type -> Type). (HasBaseContext context, MonadUnliftIO m) 
=> FilePath

Path to minikube binary

-> MinikubeClusterOptions 
-> SpecFree (MinikubeClusterContext context) m () 
-> SpecFree context m () 

Introduce a Minikube cluster, passing in the minikube binary path.

Bracket-style functions

withMinikubeCluster Source #

Arguments

:: (HasBaseContextMonad context m, HasFile context "minikube", MonadLoggerIO m, MonadUnliftIO m, MonadFail m) 
=> MinikubeClusterOptions

Options

-> (KubernetesClusterContext -> m a) 
-> m a 

Bracket-style variant for introducing a Minikube cluster, using a HasFile context "minikube" constraint.

withMinikubeCluster' Source #

Arguments

:: (HasBaseContextMonad context m, MonadLoggerIO m, MonadUnliftIO m, MonadFail m) 
=> FilePath

Path to minikube binary

-> MinikubeClusterOptions 
-> (KubernetesClusterContext -> m a) 
-> m a 

Same as withMinikubeCluster, but allows you to pass the path to the minikube binary.

withMinikubeCluster'' Source #

Arguments

:: (HasBaseContextMonad context m, MonadLoggerIO m, MonadUnliftIO m, MonadFail m) 
=> String

Cluster name

-> FilePath 
-> MinikubeClusterOptions 
-> (KubernetesClusterContext -> m a) 
-> m a 

Same as withMinikubeCluster', but allows you to pass the cluster name.

Image management

These are lower-level and Minikube-specific; prefer working with the functions in Test.Sandwich.Contexts.Kubernetes.Images.

clusterContainsImageMinikube Source #

Arguments

:: (MonadUnliftIO m, MonadLogger m) 
=> FilePath

Path to minikube binary

-> Text

Cluster name

-> [Text]

Extra flags to pass to minikube

-> Text

Image name

-> m Bool 

Test if the cluster contains a given image, by cluster name.

getLoadedImagesMinikube Source #

Arguments

:: (MonadUnliftIO m, MonadLogger m) 
=> FilePath

Path to minikube binary

-> Text

Cluster name

-> [Text]

Extra flags to pass to minikube

-> m (Set Text) 

Get the loaded images on a cluster, by cluster name.

loadImageMinikube Source #

Arguments

:: (HasCallStack, MonadUnliftIO m, MonadLoggerIO m, MonadFail m) 
=> FilePath

Path to minikube binary

-> Text

Cluster name

-> [Text]

Extra flags to pass to minikube

-> ImageLoadSpec

Image load spec

-> m Text

Returns transformed image name

Load an image onto a cluster. This image can come from a variety of sources, as specified by the ImageLoadSpec.

Re-exported cluster types

type HasKubernetesClusterContext context = HasLabel context "kubernetesCluster" KubernetesClusterContext Source #

Types