{
  "author": {
    "name": "Amazon Web Services",
    "roles": [
      "author"
    ],
    "url": "https://aws.amazon.com"
  },
  "bin": {
    "cdk8s-server": "lib/cli/cdk8s-server.js"
  },
  "bundled": {
    "yaml": "^1.10.3"
  },
  "dependencies": {
    "cdk8s": "^2.68.91",
    "constructs": "^10"
  },
  "dependencyClosure": {
    "cdk8s": {
      "targets": {
        "dotnet": {
          "namespace": "Org.Cdk8s",
          "packageId": "Org.Cdk8s"
        },
        "go": {
          "moduleName": "github.com/cdk8s-team/cdk8s-core-go"
        },
        "java": {
          "maven": {
            "artifactId": "cdk8s",
            "groupId": "org.cdk8s"
          },
          "package": "org.cdk8s"
        },
        "js": {
          "npm": "cdk8s"
        },
        "python": {
          "distName": "cdk8s",
          "module": "cdk8s"
        }
      }
    },
    "constructs": {
      "targets": {
        "dotnet": {
          "namespace": "Constructs",
          "packageId": "Constructs"
        },
        "go": {
          "moduleName": "github.com/aws/constructs-go"
        },
        "java": {
          "maven": {
            "artifactId": "constructs",
            "groupId": "software.constructs"
          },
          "package": "software.constructs"
        },
        "js": {
          "npm": "constructs"
        },
        "python": {
          "distName": "constructs",
          "module": "constructs"
        }
      }
    }
  },
  "description": "Create Kubernetes CRD Operators using CDK8s Constructs",
  "docs": {
    "stability": "stable"
  },
  "homepage": "https://github.com/cdk8s-team/cdk8s-operator.git",
  "jsiiVersion": "5.9.43 (build 00271a8)",
  "keywords": [
    "cdk8s",
    "crd",
    "kubernetes",
    "operator"
  ],
  "license": "Apache-2.0",
  "metadata": {
    "jsii": {
      "pacmak": {
        "hasDefaultInterfaces": true
      }
    },
    "tscRootDir": "src"
  },
  "name": "cdk8s-operator",
  "readme": {
    "markdown": "# cdk8s-operator\n\n> Create Kubernetes CRD Operators using CDK8s Constructs\n\nThis is a multi-language (jsii) library and a command-line tool that allows you\nto create Kubernetes operators for CRDs (Custom Resource Definitions) using\nCDK8s.\n\n## Getting Started\n\nLet's create our first CRD served by a CDK8s construct using TypeScript.\n\n### Install CDK8s\n\nMake sure your system has the required CDK8s [prerequisites](https://cdk8s.io/docs/latest/getting-started/#prerequisites).\n\nInstall the CDK8s CLI globally through npm:\n\n```shell\n$ npm i -g cdk8s-cli\nInstalling...\n\n# Verify installation\n$ cdk8s --version\n1.0.0-beta.3\n```\n\n### Create a new CDK8s app\n\nNow, let's create a new CDK8s typescript app:\n\n```shell\nmkdir hello-operator && cd hello-operator\ngit init\ncdk8s init typescript-app\n```\n\n### Install cdk8s-operator\n\nNext, let's install this module as a dependency of our TypeScript project:\n\n```shell\nnpm install cdk8s-operator\n```\n\n### Construct\n\nWe will start by creating the construct that implements the abstraction. This is\nis just a normal CDK8s custom construct:\n\nLet's create a construct called `PodCollection` which represents a collection of\npods:\n\n`pod-collection.ts`:\n\n```ts\nimport { Pod } from 'cdk8s-plus-17';\nimport { Construct } from 'constructs';\n\nexport interface PodCollectionProps {\n  /** Number of pods */\n  readonly count: number;\n  /** The docker image to deploy */\n  readonly image: string;\n}\n\nexport class PodCollection extends Construct {\n  constructor(scope: Construct, id: string, props: PodCollectionProps) {\n    super(scope, id);\n\n    for (let i = 0; i < props.count; ++i) {\n      new Pod(this, `pod-${i}`, {\n        containers: [ { image: props.image } ]\n      });\n    }\n  }\n}\n```\n\n### Operator App\n\nNow, we will need to replace out `main.ts` file with an \"operator app\", which is\na special kind of CDK8s app designed to be executed by the `cdk8s-server` CLI\nwhich is included in this module.\n\nThe `Operator` app construct can be used to create \"CDK8s Operators\" which are\nCDK8s apps that accept input from a file (or STDIN) with a Kubernetes manifest,\ninstantiates a construct with the `spec` as its input and emits the resulting\nmanifest to STDOUT.\n\nReplace the contents of `main.ts` with the following. We initialize an\n`Operator` app and then register a provider which handles resources of API\nversion `samples.cdk8s.org/v1alpha1` and kind `PodCollection`.\n\n`main.ts`:\n\n```ts\nimport { Operator } from 'cdk8s-operator';\nimport { PodCollection } from './pod-collection';\n\nconst app = new Operator();\n\napp.addProvider({\n  apiVersion: 'samples.cdk8s.org/v1alpha1',\n  kind: 'PodCollection',\n  handler: {\n    apply: (scope, id, props) => new PodCollection(scope, id, props)\n  }\n})\n\napp.synth();\n```\n\n> A single operator can handle any number of resource kinds. Simply call\n> `addProvider()` for each apiVersion/kind.\n\n## Using Operators\n\nTo use this operator, create an `input.json` file, e.g:\n\n`input.json`:\n\n```json\n{\n  \"apiVersion\": \"samples.cdk8s.org/v1alpha1\",\n  \"kind\": \"PodCollection\",\n  \"metadata\": {\n    \"name\": \"my-collection\"\n  },\n  \"spec\": {\n    \"image\": \"paulbouwer/hello-kubernetes\",\n    \"count\": 5\n  }\n}\n```\n\nCompile your code:\n\n```shell\n# delete `main.test.ts` since it has some code that won't compile\n$ rm -f main.test.*\n\n# compile\n$ npm run compile\n```\n\nAnd run:\n\n```shell\n$ node main.js input.json\n```\n\n<details>\n  <summary>STDOUT</summary>\n\n```yaml\napiVersion: \"v1\"\nkind: \"Pod\"\nmetadata:\n  name: \"my-collection-pod-0-c8735c52\"\nspec:\n  containers:\n    - env: []\n      image: \"paulbouwer/hello-kubernetes\"\n      imagePullPolicy: \"Always\"\n      name: \"main\"\n      ports: []\n      volumeMounts: []\n  volumes: []\n---\napiVersion: \"v1\"\nkind: \"Pod\"\nmetadata:\n  name: \"my-collection-pod-1-c89f58d7\"\nspec:\n  containers:\n    - env: []\n      image: \"paulbouwer/hello-kubernetes\"\n      imagePullPolicy: \"Always\"\n      name: \"main\"\n      ports: []\n      volumeMounts: []\n  volumes: []\n---\napiVersion: \"v1\"\nkind: \"Pod\"\nmetadata:\n  name: \"my-collection-pod-2-c88d4268\"\nspec:\n  containers:\n    - env: []\n      image: \"paulbouwer/hello-kubernetes\"\n      imagePullPolicy: \"Always\"\n      name: \"main\"\n      ports: []\n      volumeMounts: []\n  volumes: []\n---\napiVersion: \"v1\"\nkind: \"Pod\"\nmetadata:\n  name: \"my-collection-pod-3-c86866b1\"\nspec:\n  containers:\n    - env: []\n      image: \"paulbouwer/hello-kubernetes\"\n      imagePullPolicy: \"Always\"\n      name: \"main\"\n      ports: []\n      volumeMounts: []\n  volumes: []\n---\napiVersion: \"v1\"\nkind: \"Pod\"\nmetadata:\n  name: \"my-collection-pod-4-c8b74b1d\"\nspec:\n  containers:\n    - env: []\n      image: \"paulbouwer/hello-kubernetes\"\n      imagePullPolicy: \"Always\"\n      name: \"main\"\n      ports: []\n      volumeMounts: []\n  volumes: []\n```\n\n</details>\n\n## `cdk8s-server`\n\nThis library is shipped with a program called `cdk8s-server` which can be used\nto host your operator inside an HTTP server. This server can be used as a\nsidecar container with a generic CRD operator (TBD).\n\n```shell\n$ PORT=8080 npx cdk8s-server\nListening on 8080\n- App command: node main.js\n- Request body should include a single k8s resource in JSON format\n- Request will be piped through STDIN to \"node main.js\"\n- Response is the STDOUT and expected to be a multi-resource yaml manifest\n```\n\nNow, you can send `input.json` over HTTP:\n\n```shell\n$ curl -d @input.json http://localhost:8080\nMANIFEST...\n```\n\n## License\n\nApache 2.0\n\n"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/cdk8s-team/cdk8s-operator.git"
  },
  "schema": "jsii/0.10.0",
  "targets": {
    "dotnet": {
      "namespace": "Org.Cdk8s.Operator",
      "packageId": "Org.Cdk8s.Operator"
    },
    "go": {
      "moduleName": "github.com/cdk8s-team/cdk8s-operator-go"
    },
    "java": {
      "maven": {
        "artifactId": "cdk8s-operator",
        "groupId": "org.cdk8s"
      },
      "package": "org.cdk8s.operator"
    },
    "js": {
      "npm": "cdk8s-operator"
    },
    "python": {
      "distName": "cdk8s-operator",
      "module": "cdk8s_operator"
    }
  },
  "types": {
    "cdk8s-operator.CustomResourceProvider": {
      "assembly": "cdk8s-operator",
      "datatype": true,
      "docs": {
        "stability": "stable"
      },
      "fqn": "cdk8s-operator.CustomResourceProvider",
      "kind": "interface",
      "locationInModule": {
        "filename": "src/operator.ts",
        "line": 17
      },
      "name": "CustomResourceProvider",
      "properties": [
        {
          "abstract": true,
          "docs": {
            "default": "\"v1\"",
            "stability": "stable",
            "summary": "API version of the custom resource."
          },
          "immutable": true,
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 28
          },
          "name": "apiVersion",
          "type": {
            "primitive": "string"
          }
        },
        {
          "abstract": true,
          "docs": {
            "stability": "stable",
            "summary": "The construct handler."
          },
          "immutable": true,
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 33
          },
          "name": "handler",
          "type": {
            "fqn": "cdk8s-operator.ICustomResourceProviderHandler"
          }
        },
        {
          "abstract": true,
          "docs": {
            "stability": "stable",
            "summary": "Kind of this custom resource."
          },
          "immutable": true,
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 21
          },
          "name": "kind",
          "type": {
            "primitive": "string"
          }
        }
      ],
      "symbolId": "src/operator:CustomResourceProvider"
    },
    "cdk8s-operator.ICustomResourceProviderHandler": {
      "assembly": "cdk8s-operator",
      "docs": {
        "stability": "stable",
        "summary": "The handler for this custom resource provider."
      },
      "fqn": "cdk8s-operator.ICustomResourceProviderHandler",
      "kind": "interface",
      "locationInModule": {
        "filename": "src/operator.ts",
        "line": 11
      },
      "methods": [
        {
          "abstract": true,
          "docs": {
            "stability": "stable"
          },
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 14
          },
          "name": "apply",
          "parameters": [
            {
              "name": "scope",
              "type": {
                "fqn": "constructs.Construct"
              }
            },
            {
              "name": "id",
              "type": {
                "primitive": "string"
              }
            },
            {
              "name": "spec",
              "type": {
                "primitive": "any"
              }
            }
          ],
          "returns": {
            "type": {
              "fqn": "constructs.Construct"
            }
          }
        }
      ],
      "name": "ICustomResourceProviderHandler",
      "symbolId": "src/operator:ICustomResourceProviderHandler"
    },
    "cdk8s-operator.Operator": {
      "assembly": "cdk8s-operator",
      "base": "cdk8s.App",
      "docs": {
        "stability": "stable",
        "summary": "A CDK8s app which allows implementing Kubernetes operators using CDK8s constructs."
      },
      "fqn": "cdk8s-operator.Operator",
      "initializer": {
        "docs": {
          "stability": "stable"
        },
        "locationInModule": {
          "filename": "src/operator.ts",
          "line": 63
        },
        "parameters": [
          {
            "name": "props",
            "optional": true,
            "type": {
              "fqn": "cdk8s-operator.OperatorProps"
            }
          }
        ]
      },
      "kind": "class",
      "locationInModule": {
        "filename": "src/operator.ts",
        "line": 56
      },
      "methods": [
        {
          "docs": {
            "stability": "stable",
            "summary": "Adds a custom resource provider to this operator."
          },
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 77
          },
          "name": "addProvider",
          "parameters": [
            {
              "docs": {
                "summary": "The provider to add."
              },
              "name": "provider",
              "type": {
                "fqn": "cdk8s-operator.CustomResourceProvider"
              }
            }
          ]
        },
        {
          "docs": {
            "remarks": "This manifest is expected to\ninclude a single Kubernetes resource. Then, we match `apiVersion` and\n`kind` to one of the registered providers and if we do, we invoke\n`apply()`, passing it the `spec` of the input manifest and a chart as a\nscope. The chart is then synthesized and the output manifest is written to\nSTDOUT.",
            "stability": "stable",
            "summary": "Reads a Kubernetes manifest in JSON format from STDIN or the file specified as the first positional command-line argument."
          },
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 90
          },
          "name": "synth",
          "overrides": "cdk8s.App"
        }
      ],
      "name": "Operator",
      "symbolId": "src/operator:Operator"
    },
    "cdk8s-operator.OperatorProps": {
      "assembly": "cdk8s-operator",
      "datatype": true,
      "docs": {
        "stability": "stable"
      },
      "fqn": "cdk8s-operator.OperatorProps",
      "kind": "interface",
      "locationInModule": {
        "filename": "src/operator.ts",
        "line": 36
      },
      "name": "OperatorProps",
      "properties": [
        {
          "abstract": true,
          "docs": {
            "default": "- first position command-line argument or \"/dev/stdin\"",
            "stability": "stable",
            "summary": "A Kubernetes JSON manifest with a single resource that is matched against one of the providers within this operator."
          },
          "immutable": true,
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 43
          },
          "name": "inputFile",
          "optional": true,
          "type": {
            "primitive": "string"
          }
        },
        {
          "abstract": true,
          "docs": {
            "default": "\"/dev/stdout\"",
            "stability": "stable",
            "summary": "Where to write the synthesized output."
          },
          "immutable": true,
          "locationInModule": {
            "filename": "src/operator.ts",
            "line": 50
          },
          "name": "outputFile",
          "optional": true,
          "type": {
            "primitive": "string"
          }
        }
      ],
      "symbolId": "src/operator:OperatorProps"
    },
    "cdk8s-operator.Server": {
      "assembly": "cdk8s-operator",
      "docs": {
        "stability": "stable"
      },
      "fqn": "cdk8s-operator.Server",
      "initializer": {
        "docs": {
          "stability": "stable"
        },
        "locationInModule": {
          "filename": "src/server.ts",
          "line": 19
        },
        "parameters": [
          {
            "name": "props",
            "type": {
              "fqn": "cdk8s-operator.ServerProps"
            }
          }
        ]
      },
      "kind": "class",
      "locationInModule": {
        "filename": "src/server.ts",
        "line": 14
      },
      "methods": [
        {
          "docs": {
            "stability": "stable",
            "summary": "Stop server."
          },
          "locationInModule": {
            "filename": "src/server.ts",
            "line": 57
          },
          "name": "close"
        },
        {
          "async": true,
          "docs": {
            "stability": "stable",
            "summary": "Starts HTTP server."
          },
          "locationInModule": {
            "filename": "src/server.ts",
            "line": 38
          },
          "name": "listen",
          "parameters": [
            {
              "docs": {
                "remarks": "If not specified, the `PORT` environment\nvariable will be used. If that's not specified an available port will be\nauto-selected.",
                "summary": "The port to listen to."
              },
              "name": "port",
              "optional": true,
              "type": {
                "primitive": "number"
              }
            }
          ],
          "returns": {
            "type": {
              "primitive": "number"
            }
          }
        }
      ],
      "name": "Server",
      "symbolId": "src/server:Server"
    },
    "cdk8s-operator.ServerProps": {
      "assembly": "cdk8s-operator",
      "datatype": true,
      "docs": {
        "stability": "stable"
      },
      "fqn": "cdk8s-operator.ServerProps",
      "kind": "interface",
      "locationInModule": {
        "filename": "src/server.ts",
        "line": 7
      },
      "name": "ServerProps",
      "properties": [
        {
          "abstract": true,
          "docs": {
            "stability": "stable",
            "summary": "The command to execute in order to synthesize the CDK app."
          },
          "immutable": true,
          "locationInModule": {
            "filename": "src/server.ts",
            "line": 11
          },
          "name": "appCommand",
          "type": {
            "primitive": "string"
          }
        }
      ],
      "symbolId": "src/server:ServerProps"
    }
  },
  "version": "0.1.429",
  "fingerprint": "AkUJD03goTUbtToJ4Sq7c8LHePUIH6+P3Sx/nTdntA0="
}