config_map#
State module for managing Kubernetes ConfigMap.
- async idem_k8s.states.k8s.core.v1.config_map.present(hub, ctx, name: str, metadata: Dict, immutable: bool = False, data: Dict = None, binary_data: Dict = None, resource_id: str = None) Dict[str, Any] [source]#
Create a ConfigMap
- Parameters:
name (str) – An Idem name of the resource.
metadata (dict) – Standard object’s metadata. More info: Kubernetes reference
resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.
binary_data (dict, Optional) – BinaryData contains the binary data. Each key must consist of alphanumeric characters, ‘-’, ‘_’ or ‘.’. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.
data (dict, Optional) – Data contains the configuration data. Each key must consist of alphanumeric characters, ‘-’, ‘_’ or ‘.’. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.
immutable (bool, Optional) – Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.
- Returns:
Dict[str, Any]
Examples
resource_is_present: k8s.core.v1.config_map.present: - name: idem-config-map-test - data: adminRoles: test-admin clientType: test-clientType viewerRoles: test-viewerRoles - metadata: annotations: meta.helm.sh/release-name: test-release meta.helm.sh/release-namespace: test-release-default labels: app: test-app environment: test-environment product: test-product name: idem-config-map-test namespace: default
- async idem_k8s.states.k8s.core.v1.config_map.absent(hub, ctx, name: str, metadata: Dict = {'namespace': 'default'}, resource_id: str = None) Dict[str, Any] [source]#
Delete a ConfigMap
- Parameters:
name (str) – An Idem name of the resource.
resource_id (str, Optional) – An identifier of the resource in the provider. Defaults to None.
metadata (dict, Optional) –
Standard object’s metadata. Defaults to metadata with ‘default’ namespace, in case of value not provided in absent state. More info: Kubernetes reference
- Returns:
Dict[str, Any]
Examples
resource_is_absent: k8s.core.v1.config_map.absent: - name: value - metadata: value
- async idem_k8s.states.k8s.core.v1.config_map.describe(hub, ctx) Dict[str, Dict[str, Any]] [source]#
Describe the resource in a way that can be recreated/managed with the corresponding “present” function.
List or watch objects of kind ConfigMap
- Returns:
Dict[str, Dict[str, Any]]
Examples
$ idem describe k8s.core.v1.config_map