Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
Instances
ToJSON JsonPatch Source # | |
Accept JsonPatch Source # | |
Defined in OM.Kubernetes | |
MimeRender JsonPatch JsonPatch Source # | |
Defined in OM.Kubernetes 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 | |
ToJSON PodName Source # | |
ToJSONKey PodName Source # | |
Defined in OM.Kubernetes | |
IsString PodName Source # | |
Defined in OM.Kubernetes fromString :: String -> PodName # | |
Show PodName Source # | |
Eq PodName Source # | |
Ord PodName Source # | |
FromHttpApiData PodName Source # | |
Defined in OM.Kubernetes parseUrlPiece :: Text -> Either Text PodName # parseHeader :: ByteString -> Either Text PodName # | |
ToHttpApiData PodName Source # | |
Defined in OM.Kubernetes 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.
Instances
ToHttpApiData ServiceName Source # | |
Defined in OM.Kubernetes toUrlPiece :: ServiceName -> Text # toEncodedUrlPiece :: ServiceName -> Builder # toHeader :: ServiceName -> ByteString # toQueryParam :: ServiceName -> Text # |
newtype ServiceSpec Source #
The specification of a service.
Instances
FromJSON ServiceSpec Source # | |
Defined in OM.Kubernetes parseJSON :: Value -> Parser ServiceSpec # parseJSONList :: Value -> Parser [ServiceSpec] # | |
ToJSON ServiceSpec Source # | |
Defined in OM.Kubernetes toJSON :: ServiceSpec -> Value # toEncoding :: ServiceSpec -> Encoding # toJSONList :: [ServiceSpec] -> Value # toEncodingList :: [ServiceSpec] -> Encoding # omitField :: ServiceSpec -> Bool # |
newtype RoleBindingSpec Source #
The representation of Role Binding.
Instances
FromJSON RoleBindingSpec Source # | |
Defined in OM.Kubernetes parseJSON :: Value -> Parser RoleBindingSpec # parseJSONList :: Value -> Parser [RoleBindingSpec] # | |
ToJSON RoleBindingSpec Source # | |
Defined in OM.Kubernetes toJSON :: RoleBindingSpec -> Value # toEncoding :: RoleBindingSpec -> Encoding # toJSONList :: [RoleBindingSpec] -> Value # toEncodingList :: [RoleBindingSpec] -> Encoding # omitField :: RoleBindingSpec -> Bool # |
The representation of a Role.
newtype ServiceAccountSpec Source #
The representation of a service account.
Instances
FromJSON ServiceAccountSpec Source # | |
Defined in OM.Kubernetes | |
ToJSON ServiceAccountSpec Source # | |
Defined in OM.Kubernetes toJSON :: ServiceAccountSpec -> Value # toEncoding :: ServiceAccountSpec -> Encoding # toJSONList :: [ServiceAccountSpec] -> Value # toEncodingList :: [ServiceAccountSpec] -> Encoding # omitField :: ServiceAccountSpec -> Bool # |
newtype NamespaceSpec Source #
The representation of a Namespace specification.
Instances
FromJSON NamespaceSpec Source # | |
Defined in OM.Kubernetes parseJSON :: Value -> Parser NamespaceSpec # parseJSONList :: Value -> Parser [NamespaceSpec] # | |
ToJSON NamespaceSpec Source # | |
Defined in OM.Kubernetes toJSON :: NamespaceSpec -> Value # toEncoding :: NamespaceSpec -> Encoding # toJSONList :: [NamespaceSpec] -> Value # toEncodingList :: [NamespaceSpec] -> Encoding # omitField :: NamespaceSpec -> Bool # |
A Kubernetes namespace.
Instances
FromJSON Namespace Source # | |
Defined in OM.Kubernetes | |
FromJSONKey Namespace Source # | |
Defined in OM.Kubernetes | |
ToJSON Namespace Source # | |
ToJSONKey Namespace Source # | |
Defined in OM.Kubernetes | |
IsString Namespace Source # | |
Defined in OM.Kubernetes fromString :: String -> Namespace # | |
Show Namespace Source # | |
Eq Namespace Source # | |
Ord Namespace Source # | |
Defined in OM.Kubernetes | |
FromHttpApiData Namespace Source # | |
Defined in OM.Kubernetes parseUrlPiece :: Text -> Either Text Namespace # parseHeader :: ByteString -> Either Text Namespace # | |
ToHttpApiData Namespace Source # | |
Defined in OM.Kubernetes toUrlPiece :: Namespace -> Text # toEncodedUrlPiece :: Namespace -> Builder # toHeader :: Namespace -> ByteString # toQueryParam :: Namespace -> Text # toEncodedQueryParam :: Namespace -> Builder # |
newtype PodTemplateName Source #
The name of a pod template.
Instances
newtype PodTemplateSpec Source #
The specification of a pod template.
Instances
FromJSON PodTemplateSpec Source # | |
Defined in OM.Kubernetes parseJSON :: Value -> Parser PodTemplateSpec # parseJSONList :: Value -> Parser [PodTemplateSpec] # | |
ToJSON PodTemplateSpec Source # | |
Defined in OM.Kubernetes toJSON :: PodTemplateSpec -> Value # toEncoding :: PodTemplateSpec -> Encoding # toJSONList :: [PodTemplateSpec] -> Value # toEncodingList :: [PodTemplateSpec] -> Encoding # omitField :: PodTemplateSpec -> Bool # |