[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fcomparisons\u002Fcdk8s-and-pulumi":3},"\u003Cp>\u003Ca href=\"https:\u002F\u002Fcdk8s.io\" rel=\"noopener\">cdk8s\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fwww.pulumi.com\u002Fregistry\u002Fpackages\u002Fkubernetes\u002F\" rel=\"noopener\">Pulumi&#39;s Kubernetes provider\u003C\u002Fa> share Klass8s&#39;s premise: manifests are a program, so write them in a typed language with an editor and tests. If you accept \u003Ca href=\"\u002Fdocs\u002Fintroduction\u002Fwhy-classes\">that premise\u003C\u002Fa>, this page is about which language and which tool.\u003C\u002Fp>\n\u003Cp>In short: typed construction of resources is common to all three. The differences are in what surrounds it (dependency injection, interception of the construction, environments, Helm) and in one structural fork: Pulumi deploys and keeps state, while cdk8s and Klass8s generate files and keep none.\u003C\u002Fp>\n\u003Ch2 id=\"what-they-share\">\u003Ca class=\"anchor\" href=\"#what-they-share\" aria-label=\"Link to this section\">\u003C\u002Fa>What they share\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Resource classes generated from the Kubernetes OpenAPI specification (cdk8s&#39;s imports, Pulumi&#39;s SDKs, \u003Ccode>klass8s\u002Fk8schema\u003C\u002Fcode>).\u003C\u002Fli>\n\u003Cli>Structure checked by the compiler or the editor: a misspelt field is an error.\u003C\u002Fli>\n\u003Cli>Reuse through the language: constructs in cdk8s, component resources in Pulumi, classes and traits in Klass8s.\u003C\u002Fli>\n\u003Cli>A way down to the raw API when the abstractions end.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"where-they-differ\">\u003Ca class=\"anchor\" href=\"#where-they-differ\" aria-label=\"Link to this section\">\u003C\u002Fa>Where they differ\u003C\u002Fh2>\n\u003Ch3 id=\"configuration-and-dependency-injection\">\u003Ca class=\"anchor\" href=\"#configuration-and-dependency-injection\" aria-label=\"Link to this section\">\u003C\u002Fa>Configuration and dependency injection\u003C\u002Fh3>\n\u003Cp>A cdk8s chart gets its configuration the way any hand-written program does: properties passed down the construct tree. Pulumi adds per-stack configuration and secrets. Klass8s hands the problem to Symfony&#39;s container: manifests are services, facts arrive as \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fconfiguration\">bindings\u003C\u002Fa>, shared logic as injected services, and data per manifest from \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fenvironments#configuration-files-per-environment\">configuration merged per environment\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch3 id=\"interception\">\u003Ca class=\"anchor\" href=\"#interception\" aria-label=\"Link to this section\">\u003C\u002Fa>Interception\u003C\u002Fh3>\n\u003Cp>The main structural difference. Every Klass8s manifest is wrapped in a proxy, and every method call and every generated resource is an \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fevents\">event\u003C\u002Fa>: &quot;every pod runs under a ServiceAccount unless its manifest names one&quot;, &quot;every workload restarts when its configuration changes&quot;, &quot;every production container declares limits&quot; are one subscriber each, which also applies to manifests written later.\u003C\u002Fp>\n\u003Cp>In cdk8s, a rule over all resources is code that walks the construct tree; in Pulumi, transforms rewrite resources as they are registered. Both see objects that are already built. A rule of the form &quot;supply a value only where the manifest chose none&quot; then has to infer the choice from the built object; in Klass8s the subscriber sees what the manifest&#39;s own method returned (\u003Ca href=\"\u002Fdocs\u002Fintroduction\u002Fwhy-classes#what-templating-cannot-reach\">the example\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch3 id=\"environments\">\u003Ca class=\"anchor\" href=\"#environments\" aria-label=\"Link to this section\">\u003C\u002Fa>Environments\u003C\u002Fh3>\n\u003Cp>cdk8s and Pulumi express differences between environments in general-purpose code or per-stack configuration, and each team settles on its convention. Klass8s has one: \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fenvironments\">environment methods, decorators and configuration files per environment\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch3 id=\"helm\">\u003Ca class=\"anchor\" href=\"#helm\" aria-label=\"Link to this section\">\u003C\u002Fa>Helm\u003C\u002Fh3>\n\u003Cp>cdk8s includes a chart&#39;s rendered output in a chart of its own; Pulumi deploys Helm charts and releases as resources. In Klass8s a \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fhelm\">release\u003C\u002Fa>&#39;s values merge per environment with the rest of the configuration, and releases are ordered with your Apps.\u003C\u002Fp>\n\u003Ch3 id=\"custom-resources\">\u003Ca class=\"anchor\" href=\"#custom-resources\" aria-label=\"Link to this section\">\u003C\u002Fa>Custom resources\u003C\u002Fh3>\n\u003Cp>cdk8s&#39;s \u003Ccode>import\u003C\u002Fcode> generates typed classes from a custom resource definition, and Pulumi can generate SDKs from CRDs. Klass8s describes instances of other operators&#39; kinds as a \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fcustom-resources\">class with a \u003Ccode>spec()\u003C\u002Fcode> array\u003C\u002Fa>: the identity, the naming and the events are typed, the specification is not. Here the others are ahead.\u003C\u002Fp>\n\u003Ch3 id=\"state-and-deployment\">\u003Ca class=\"anchor\" href=\"#state-and-deployment\" aria-label=\"Link to this section\">\u003C\u002Fa>State and deployment\u003C\u002Fh3>\n\u003Cp>Pulumi does more than render: it applies, records every resource in a state backend (Pulumi Cloud or one you host), previews changes and rolls back. If one tool should own cloud infrastructure (networks, clusters, DNS) and what runs in Kubernetes, Pulumi is the strongest offer on this page.\u003C\u002Fp>\n\u003Cp>Klass8s, like cdk8s, declines that job: the \u003Ca href=\"\u002Fdocs\u002Fintroduction\u002Fwhy-classes#the-opinions-behind-it\">output is inert YAML\u003C\u002Fa>, the state lives in the cluster and in Git, a preview is \u003Ccode>kubectl diff\u003C\u002Fcode>, and deploying is whatever you already trust. Declining gives you nothing to host and no state file to lock, corrupt or leak; it costs Pulumi&#39;s preview and rollback. Which side you want is an architectural decision, not a score.\u003C\u002Fp>\n\u003Ch3 id=\"languages\">\u003Ca class=\"anchor\" href=\"#languages\" aria-label=\"Link to this section\">\u003C\u002Fa>Languages\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>\u003Cstrong>cdk8s\u003C\u002Fstrong>: TypeScript first; Python, Java and Go through jsii.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Pulumi\u003C\u002Fstrong>: TypeScript and JavaScript, Python, Go, C#, Java and YAML.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Klass8s\u003C\u002Fstrong>: \u003Ca href=\"\u002Fdocs\u002Fgetting-started\u002Fphaenon-and-php\">PHP and Phaenon\u003C\u002Fa>, for teams whose product is written in them.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>cdk8s and Pulumi have larger communities, more examples and more answers to search for. Klass8s has a codebase small enough to read and types that answer many questions in the editor.\u003C\u002Fp>\n\u003Ch2 id=\"side-by-side\">\u003Ca class=\"anchor\" href=\"#side-by-side\" aria-label=\"Link to this section\">\u003C\u002Fa>Side by side\u003C\u002Fh2>\n\u003Cdiv class=\"table-wrap\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth>cdk8s\u003C\u002Fth>\u003Cth>Pulumi\u003C\u002Fth>\u003Cth>Klass8s\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>Typed resources\u003C\u002Ftd>\u003Ctd>yes\u003C\u002Ftd>\u003Ctd>yes\u003C\u002Ftd>\u003Ctd>yes\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Typed custom resources\u003C\u002Ftd>\u003Ctd>generated by \u003Ccode>import\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>generated SDKs\u003C\u002Ftd>\u003Ctd>arrays under typed identity\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Dependency injection\u003C\u002Ftd>\u003Ctd>properties passed by hand\u003C\u002Ftd>\u003Ctd>per-stack configuration\u003C\u002Ftd>\u003Ctd>Symfony&#39;s container\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Rules over every resource\u003C\u002Ftd>\u003Ctd>walking the construct tree\u003C\u002Ftd>\u003Ctd>transforms\u003C\u002Ftd>\u003Ctd>events during construction\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Environments\u003C\u002Ftd>\u003Ctd>your convention\u003C\u002Ftd>\u003Ctd>stacks\u003C\u002Ftd>\u003Ctd>built in\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Helm\u003C\u002Ftd>\u003Ctd>chart output included\u003C\u002Ftd>\u003Ctd>charts and releases deployed\u003C\u002Ftd>\u003Ctd>releases with merged values, ordered with Apps\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>State, preview, rollback\u003C\u002Ftd>\u003Ctd>no\u003C\u002Ftd>\u003Ctd>yes\u003C\u002Ftd>\u003Ctd>no, by design\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Languages\u003C\u002Ftd>\u003Ctd>TypeScript, Python, Java, Go\u003C\u002Ftd>\u003Ctd>TypeScript, Python, Go, C#, Java, YAML\u003C\u002Ftd>\u003Ctd>PHP, Phaenon\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Runs in the cluster or needs a backend\u003C\u002Ftd>\u003Ctd>no\u003C\u002Ftd>\u003Ctd>a state backend\u003C\u002Ftd>\u003Ctd>no\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Ch2 id=\"choosing\">\u003Ca class=\"anchor\" href=\"#choosing\" aria-label=\"Link to this section\">\u003C\u002Fa>Choosing\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>A TypeScript, Python or Go team that wants a generator:\u003C\u002Fstrong> cdk8s. Klass8s in a team without PHP would be a mistake.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>One tool for the cloud and the cluster, with state and previews:\u003C\u002Fstrong> Pulumi, with its backend.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>A PHP team:\u003C\u002Fstrong> Klass8s, and not only for the language: dependency injection, the events, environments and the Helm bridge are what you would otherwise build on top of a generator yourself.\u003C\u002Fli>\n\u003C\u002Ful>\n",1794928319712]