You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library lets you create [Kubernetes Admission Webhooks](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/) in Haskell.
16
+
17
+
Using webhooks in Kubernetes requires some configuration, in the [dhall](./dhall) directory you can find some useful templates that you can reuse to deploy your webhooks. [cert-manager](https://cert-manager.io/docs/) is required to be installed in the cluster to use the templates.
18
+
19
+
Example webhook using Servant:
20
+
```hs
21
+
module Kubernetes.Example
22
+
( startApp,
23
+
app,
24
+
)
25
+
where
26
+
27
+
import Control.Monad.IO.Class
28
+
import qualified Data.Aeson as A
29
+
import qualified Data.ByteString as BS
30
+
import qualified Data.HashMap.Strict as HM
31
+
import Data.Text
32
+
import GHC.Generics
33
+
import qualified Kubernetes.Webhook as W
34
+
import Network.Wai
35
+
import Network.Wai.Handler.Warp
36
+
import Network.Wai.Handler.WarpTLS
37
+
import Servant
38
+
import System.Environment
39
+
40
+
type API =
41
+
"mutate" :> ReqBody '[JSON] W.AdmissionReviewRequest :> Post '[JSON] W.AdmissionReviewResponse
0 commit comments