Safe Haskell | None |
---|---|
Language | Haskell2010 |
OM.Kubernetes
Contents
Description
This module provides functions that access and operate on the Kubernetes API. It is designed to be used from pods running within the K8s cluster itself and it won't work otherwise.
Synopsis
- newK8s :: MonadIO m => m K8s
- data K8s
- listPods :: MonadIO m => K8s -> Namespace -> m [PodName]
- postPod :: MonadIO m => K8s -> Namespace -> PodSpec -> m ()
- deletePod :: MonadIO m => K8s -> Namespace -> PodName -> m ()
- getPodSpec :: MonadIO m => K8s -> Namespace -> PodName -> m PodSpec
- patchService :: MonadIO m => K8s -> Namespace -> ServiceName -> JsonPatch -> m ()
- getServiceSpec :: MonadIO m => K8s -> Namespace -> ServiceName -> m ServiceSpec
- postService :: MonadIO m => K8s -> Namespace -> ServiceSpec -> m ()
- postRoleBinding :: MonadIO m => K8s -> Namespace -> RoleBindingSpec -> m ()
- postRole :: MonadIO m => K8s -> Namespace -> RoleSpec -> m ()
- postServiceAccount :: MonadIO m => K8s -> Namespace -> ServiceAccountSpec -> m ()
- postNamespace :: MonadIO m => K8s -> NamespaceSpec -> m ()
- getPodTemplate :: MonadIO m => K8s -> Namespace -> PodTemplateName -> m PodTemplateSpec
- queryPods :: MonadIO m => K8s -> Namespace -> [(Text, Text)] -> m [Pod]
- newtype JsonPatch = JsonPatch {
- unJsonPatch :: Value
- newtype PodName = PodName {}
- newtype PodSpec = PodSpec {}
- newtype ServiceName = ServiceName {}
- newtype ServiceSpec = ServiceSpec {}
- newtype RoleBindingSpec = RoleBindingSpec {}
- newtype RoleSpec = RoleSpec {
- unRoleSpec :: Value
- newtype ServiceAccountSpec = ServiceAccountSpec {}
- newtype NamespaceSpec = NamespaceSpec {}
- newtype Namespace = Namespace {
- unNamespace :: Text
- newtype PodTemplateName = PodTemplateName {}
- newtype PodTemplateSpec = PodTempalteSpec {}
- newtype Pod = Pod {}
Creating a handle
Operations
listPods :: MonadIO m => K8s -> Namespace -> m [PodName] Source #
List the pods, returning a list of names.
getPodSpec :: MonadIO m => K8s -> Namespace -> PodName -> m PodSpec Source #
Get the spec of a specific pod.
patchService :: MonadIO m => K8s -> Namespace -> ServiceName -> JsonPatch -> m () Source #
Patch a service.
getServiceSpec :: MonadIO m => K8s -> Namespace -> ServiceName -> m ServiceSpec Source #
Get the service spec.
postService :: MonadIO m => K8s -> Namespace -> ServiceSpec -> m () Source #
Post a new service.
postRoleBinding :: MonadIO m => K8s -> Namespace -> RoleBindingSpec -> m () Source #
Post a role binding.
postServiceAccount :: MonadIO m => K8s -> Namespace -> ServiceAccountSpec -> m () Source #
Post a service account.
postNamespace :: MonadIO m => K8s -> NamespaceSpec -> m () Source #
Post a Namespace.
getPodTemplate :: MonadIO m => K8s -> Namespace -> PodTemplateName -> m PodTemplateSpec Source #
Get the pod template.
queryPods :: MonadIO m => K8s -> Namespace -> [(Text, Text)] -> m [Pod] Source #
Query the pods, returning the full JSON for each.
Types
Specify how to patch the pod template spec.
Constructors
JsonPatch | |
Fields
|
Instances
ToJSON JsonPatch Source # | |
Accept JsonPatch Source # | |
Defined in OM.Kubernetes | |
MimeRender JsonPatch JsonPatch Source # | |
Defined in OM.Kubernetes Methods mimeRender :: Proxy JsonPatch -> JsonPatch -> ByteString # |
The name of a pod.
Instances
FromJSON PodName Source # | |
Defined in OM.Kubernetes | |
FromJSONKey PodName Source # | |
Defined in OM.Kubernetes Methods | |
ToJSON PodName Source # | |
ToJSONKey PodName Source # | |
Defined in OM.Kubernetes | |
IsString PodName Source # | |
Defined in OM.Kubernetes Methods fromString :: String -> PodName # | |
Show PodName Source # | |
Eq PodName Source # | |
Ord PodName Source # | |
FromHttpApiData PodName Source # | |
Defined in OM.Kubernetes Methods parseUrlPiece :: Text -> Either Text PodName # parseHeader :: ByteString -> Either Text PodName # | |
ToHttpApiData PodName Source # | |
Defined in OM.Kubernetes Methods toUrlPiece :: PodName -> Text # toEncodedUrlPiece :: PodName -> Builder # toHeader :: PodName -> ByteString # toQueryParam :: PodName -> Text # toEncodedQueryParam :: PodName -> Builder # |
A pod specification.
newtype ServiceName Source #
The name of a service.
Constructors
ServiceName | |
Fields |
Instances
ToHttpApiData ServiceName Source # | |
Defined in OM.Kubernetes Methods toUrlPiece :: ServiceName -> Text # toEncodedUrlPiece :: ServiceName -> Builder # toHeader :: ServiceName -> ByteString # toQueryParam :: ServiceName -> Text # |
newtype ServiceSpec Source #
The specification of a service.
Constructors
ServiceSpec | |
Fields |
Instances
FromJSON ServiceSpec Source # | |
Defined in OM.Kubernetes | |
ToJSON ServiceSpec Source # | |
Defined in OM.Kubernetes Methods toJSON :: ServiceSpec -> Value # toEncoding :: ServiceSpec -> Encoding # toJSONList :: [ServiceSpec] -> Value # toEncodingList :: [ServiceSpec] -> Encoding # omitField :: ServiceSpec -> Bool # |
newtype RoleBindingSpec Source #
The representation of Role Binding.
Constructors
RoleBindingSpec | |
Fields |
Instances
FromJSON RoleBindingSpec Source # | |
Defined in OM.Kubernetes Methods parseJSON :: Value -> Parser RoleBindingSpec # parseJSONList :: Value -> Parser [RoleBindingSpec] # | |
ToJSON RoleBindingSpec Source # | |
Defined in OM.Kubernetes Methods toJSON :: RoleBindingSpec -> Value # toEncoding :: RoleBindingSpec -> Encoding # toJSONList :: [RoleBindingSpec] -> Value # toEncodingList :: [RoleBindingSpec] -> Encoding # omitField :: RoleBindingSpec -> Bool # |
The representation of a Role.
Constructors
RoleSpec | |
Fields
|
newtype ServiceAccountSpec Source #
The representation of a service account.
Constructors
ServiceAccountSpec | |
Fields |
Instances
FromJSON ServiceAccountSpec Source # | |
Defined in OM.Kubernetes Methods parseJSON :: Value -> Parser ServiceAccountSpec # parseJSONList :: Value -> Parser [ServiceAccountSpec] # | |
ToJSON ServiceAccountSpec Source # | |
Defined in OM.Kubernetes Methods toJSON :: ServiceAccountSpec -> Value # toEncoding :: ServiceAccountSpec -> Encoding # toJSONList :: [ServiceAccountSpec] -> Value # toEncodingList :: [ServiceAccountSpec] -> Encoding # omitField :: ServiceAccountSpec -> Bool # |
newtype NamespaceSpec Source #
The representation of a Namespace specification.
Constructors
NamespaceSpec | |
Fields |
Instances
FromJSON NamespaceSpec Source # | |
Defined in OM.Kubernetes Methods parseJSON :: Value -> Parser NamespaceSpec # parseJSONList :: Value -> Parser [NamespaceSpec] # | |
ToJSON NamespaceSpec Source # | |
Defined in OM.Kubernetes Methods toJSON :: NamespaceSpec -> Value # toEncoding :: NamespaceSpec -> Encoding # toJSONList :: [NamespaceSpec] -> Value # toEncodingList :: [NamespaceSpec] -> Encoding # omitField :: NamespaceSpec -> Bool # |
A Kubernetes namespace.
Constructors
Namespace | |
Fields
|
Instances
FromJSON Namespace Source # | |
Defined in OM.Kubernetes | |
FromJSONKey Namespace Source # | |
Defined in OM.Kubernetes Methods | |
ToJSON Namespace Source # | |
ToJSONKey Namespace Source # | |
Defined in OM.Kubernetes | |
IsString Namespace Source # | |
Defined in OM.Kubernetes Methods fromString :: String -> Namespace # | |
Show Namespace Source # | |
Eq Namespace Source # | |
Ord Namespace Source # | |
FromHttpApiData Namespace Source # | |
Defined in OM.Kubernetes Methods parseUrlPiece :: Text -> Either Text Namespace # parseHeader :: ByteString -> Either Text Namespace # | |
ToHttpApiData Namespace Source # | |
Defined in OM.Kubernetes Methods toUrlPiece :: Namespace -> Text # toEncodedUrlPiece :: Namespace -> Builder # toHeader :: Namespace -> ByteString # toQueryParam :: Namespace -> Text # toEncodedQueryParam :: Namespace -> Builder # |
newtype PodTemplateName Source #
The name of a pod template.
Constructors
PodTemplateName | |
Fields |
Instances
newtype PodTemplateSpec Source #
The specification of a pod template.
Constructors
PodTempalteSpec | |
Fields |
Instances
FromJSON PodTemplateSpec Source # | |
Defined in OM.Kubernetes Methods parseJSON :: Value -> Parser PodTemplateSpec # parseJSONList :: Value -> Parser [PodTemplateSpec] # | |
ToJSON PodTemplateSpec Source # | |
Defined in OM.Kubernetes Methods toJSON :: PodTemplateSpec -> Value # toEncoding :: PodTemplateSpec -> Encoding # toJSONList :: [PodTemplateSpec] -> Value # toEncodingList :: [PodTemplateSpec] -> Encoding # omitField :: PodTemplateSpec -> Bool # |