Replies: 2 comments
-
To answer the question, we'll focus on one particular SLS file: This is not a 'standard' Jinja/YAML SLS template, but more alike a standard Kubernetes manifest file, listing objects in their serialized YAML form (in this case, only a single object). The shebang at the top,
This is a state definition which uses a custom state, Unlike the Salt These state in turn rely on some generic functions defined in salt/_modules/metalk8s_kubernetes.py. These use runtime introspection of type information provided by the official Kubernetes Python client to validate objects (as defined in your original SLS), and to apply operations through the Kubernetes API. In essence, the renderer is unrelated to the Hope this clarifies things a bit 😄 |
Beta Was this translation helpful? Give feedback.
-
The implementation changed a bit in a recent PR (#3510). Because of the This new rework makes the Salt execution module really simpler and flexible compare to the old approach, as we manage all kinds of Kubernetes objects by design. The usage of this execution module did not change we have the exact same functions as before it's only the way to interact with Kubernetes that changed. The renderer and salt states work the same way as @NicolasT described above. Feel free to take a look at the Salt execution module implementation and post a question, if any 😃 |
Beta Was this translation helpful? Give feedback.
-
(Based on a question sent to the Salt mailing-list by @Baitanik here)
In MetalK8s there are several SLS files starting with a
#! metalk8s_kubernetes
line. There's asalt/_renderers/metalk8s_kubernetes.py
module, andsalt/_modules/metalk8s_kubernetes.py
. How do these relate, and how are Kubernetes objects defined in SLS files applied in the MetalK8s cluster?Beta Was this translation helpful? Give feedback.
All reactions