[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fdeploying\u002Frelated-packages":3},"\u003Cp>Klass8s is one of four packages, each with one job, all under the MIT License:\u003C\u002Fp>\n\u003Cdiv class=\"table-wrap\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Package\u003C\u002Fth>\u003Cth>Job\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>\u003Ccode>klass8s\u002Fklass8s\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>the library and Symfony bundle: manifest classes, configurators, events, console commands\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ccode>klass8s\u002Fk8schema\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>the Kubernetes API as PHP classes, one release line per Kubernetes version\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ccode>klass8s\u002Fproximity\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>proxy objects: the mechanism under the event system\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ccode>klass8s\u002Fk8schema-generator\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>the application that generates k8schema from the Kubernetes API&#39;s schema\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>The sources are in the \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fklass8s\" rel=\"noopener\">klass8s organisation on GitHub\u003C\u002Fa>. A project needs the first; Composer brings the second and the third with it.\u003C\u002Fp>\n\u003Ch2 id=\"k8schema\">\u003Ca class=\"anchor\" href=\"#k8schema\" aria-label=\"Link to this section\">\u003C\u002Fa>k8schema\u003C\u002Fh2>\n\u003Cp>Every Kubernetes API object as a PHP class: \u003Ccode>K8Schema\\Api\\Apps\\V1\\Deployment\u003C\u002Fcode>, \u003Ccode>K8Schema\\Api\\Core\\V1\\ConfigMap\u003C\u002Fcode>, the \u003Ccode>ObjectMeta\u003C\u002Fcode> family, and collection types (\u003Ccode>StringMap\u003C\u002Fcode>, \u003Ccode>StringList\u003C\u002Fcode>, \u003Ccode>StringOrFloatMap\u003C\u002Fcode>) where YAML has loose maps. The classes have fluent setters, \u003Ccode>API_VERSION\u003C\u002Fcode> and \u003Ccode>KIND\u003C\u002Fcode> constants, and a \u003Ccode>&lt;Type&gt;List\u003C\u002Fcode> for every resource.\u003C\u002Fp>\n\u003Cp>The versions follow Kubernetes: one release line per Kubernetes minor version, tagged \u003Ccode>v&lt;minor&gt;.&lt;patch&gt;\u003C\u002Fcode> (\u003Ccode>v1.35.8\u003C\u002Fcode> is for Kubernetes 1.35). So the constraint in \u003Ccode>composer.json\u003C\u002Fcode> states the Kubernetes API a project targets:\u003C\u002Fp>\n\u003Cfigure class=\"plain\">\u003Cdiv class=\"block-pane\">\u003Cbutton type=\"button\" class=\"copy\" data-copy aria-label=\"Copy the code\">Copy\u003C\u002Fbutton>\u003Cpre class=\"shiki shiki-themes klass8s-light klass8s-dark\" style=\"--k8s-light:#191b2e;--k8s-dark:#e7e9f2;--k8s-light-bg:#fbfbf8;--k8s-dark-bg:#181b33\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\">{\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> \"\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#2C3FCC;--k8s-dark:#A3AEFF\">require\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\">\"\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\">:\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> {\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> \"\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#2C3FCC;--k8s-dark:#A3AEFF\">klass8s\u002Fk8schema\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\">\"\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\">:\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> \"~1.35.8\"\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> }\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> }\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cp>Upgrading the cluster is a constraint change followed by whatever the type checker reports. Use a tilde, never a caret: a caret would let a routine \u003Ccode>composer update\u003C\u002Fcode> move the project to another Kubernetes API. Klass8s accepts the lines for Kubernetes 1.34 to 1.37.\u003C\u002Fp>\n\u003Ch2 id=\"k8schema-generator\">\u003Ca class=\"anchor\" href=\"#k8schema-generator\" aria-label=\"Link to this section\">\u003C\u002Fa>k8schema-generator\u003C\u002Fh2>\n\u003Cp>The command-line application that writes k8schema: \u003Ccode>schema:fetch\u003C\u002Fcode> downloads the JSON schema of a Kubernetes release&#39;s API, \u003Ccode>generate\u003C\u002Fcode> writes one class per API object and nested type under a namespace prefix, and \u003Ccode>schema:versions\u003C\u002Fcode> lists the newest patch release upstream for each recent minor. You need it only to generate the classes yourself, for a Kubernetes version k8schema does not have yet or under another namespace.\u003C\u002Fp>\n\u003Ch2 id=\"proximity\">\u003Ca class=\"anchor\" href=\"#proximity\" aria-label=\"Link to this section\">\u003C\u002Fa>proximity\u003C\u002Fh2>\n\u003Cp>A proxy library: it generates a subclass of an object at run time and routes every method call through interceptors that run before the method (and may skip it) or after it (and may replace the result). Klass8s turns those interceptors into Symfony events, and the \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fevents\">event system\u003C\u002Fa> follows. Two consequences you will meet: manifest and container classes \u003Ca href=\"\u002Fdocs\u002Fguide\u002Fmanifests#manifest-classes-are-not-final\">must not be \u003Ccode>final\u003C\u002Fcode>\u003C\u002Fa>, since a proxy is a subclass; and the class of a manifest is read with \u003Ccode>$manifest::className()\u003C\u002Fcode>, since \u003Ccode>$manifest::class\u003C\u002Fcode> is the proxy&#39;s.\u003C\u002Fp>\n\u003Ch2 id=\"how-they-meet\">\u003Ca class=\"anchor\" href=\"#how-they-meet\" aria-label=\"Link to this section\">\u003C\u002Fa>How they meet\u003C\u002Fh2>\n\u003Cfigure class=\"plain\">\u003Cdiv class=\"block-pane\">\u003Cbutton type=\"button\" class=\"copy\" data-copy aria-label=\"Copy the code\">Copy\u003C\u002Fbutton>\u003Cpre class=\"shiki shiki-themes klass8s-light klass8s-dark\" style=\"--k8s-light:#191b2e;--k8s-dark:#e7e9f2;--k8s-light-bg:#fbfbf8;--k8s-dark-bg:#181b33\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--k8s-light:#676C7E;--k8s-light-font-style:italic;--k8s-dark:#9095AD;--k8s-dark-font-style:italic\"># a project, with Klass8s and the Kubernetes version you target\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--k8s-light:#1B5C96;--k8s-dark:#92CCFF\">composer\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> create-project\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> symfony\u002Fskeleton\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> k8s\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> &#x26;&#x26;\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#1B5C96;--k8s-dark:#92CCFF\"> cd\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> k8s\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--k8s-light:#1B5C96;--k8s-dark:#92CCFF\">composer\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> require\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> klass8s\u002Fklass8s\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> klass8s\u002Fk8schema:~1.35.8\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--k8s-light:#676C7E;--k8s-light-font-style:italic;--k8s-dark:#9095AD;--k8s-dark-font-style:italic\"># manifests as classes, then: what would change, and apply it\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--k8s-light:#1B5C96;--k8s-dark:#92CCFF\">bin\u002Fconsole\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> k8s:render:apps\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> |\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#1B5C96;--k8s-dark:#92CCFF\"> kubectl\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> diff\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#9A3D0C;--k8s-dark:#F3A978\"> -f\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> -\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--k8s-light:#1B5C96;--k8s-dark:#92CCFF\">bin\u002Fconsole\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> k8s:render:apps\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#5A5F73;--k8s-dark:#A7ABC0\"> |\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#1B5C96;--k8s-dark:#92CCFF\"> kubectl\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> apply\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#9A3D0C;--k8s-dark:#F3A978\"> -f\u003C\u002Fspan>\u003Cspan style=\"--k8s-light:#0B6B55;--k8s-dark:#86D9BF\"> -\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cp>k8schema knows Kubernetes, its generator keeps it current, Klass8s knows your resources, and your base classes and subscribers know your conventions.\u003C\u002Fp>\n",1794928319666]