kubernetes¶
Per-resource state apply.
Added in version 2.1.0.
Forwards a manifest through kubernetes.apply while leaving the
resource identity available to the manifest’s Jinja templates via
template_context (so a single manifest can be customised per
resource at dispatch time).
Dormant on stock Salt — see saltext.kubernetes.resources.kubernetes.
- saltext.kubernetes.modules.kuberesource_state.apply_(source=None, manifest=None, namespace=None, field_manager='salt', force_conflicts=False, template=None, template_context=None)[source]¶
Apply a manifest, with the active resource’s identity exposed to the template context.
The active resource’s
kind,namespaceandnameare merged into template_context under theresourcekey, so Jinja-templated manifests can interpolate them:# salt://manifests/per-pod-cm.yaml apiVersion: v1 kind: ConfigMap metadata: name: cm-{{ resource.name }} namespace: {{ resource.namespace }} data: owner: {{ resource.name }}
CLI Example:
salt '*' kuberesource_state.apply_