Which kubectl command creates a ConfigMap named 'app-config' from a file 'config.properties'?
This command is correct because `--from-file=config.properties` instructs kubectl to create a ConfigMap whose data contains a single key `config.properties` (the file basename) with the file's full contents as its value. This is the standard, documented way to import a file verbatim into a ConfigMap, and it does not require any extra flags or formatting assumptions about the file's internal structure.
Why this answer
`kubectl create configmap` with the `--from-file` flag creates a ConfigMap from a file, using the filename as the key and the file content as the value. This is the standard Kubernetes method to import configuration data from a local file into a ConfigMap resource.
Exam trap
The trap here is confusing `--from-file` (which stores the entire file as a single entry) with `--from-env-file` (which parses key-value pairs), leading candidates to choose option C when they need to preserve the file's original format.
How to eliminate wrong answers
Option B is wrong because `--file` is not a valid flag for `kubectl create configmap`; the correct flag is `--from-file`. Option C is wrong because `--from-env-file` imports the file as environment variables (key=value pairs per line), not as a single key-value entry, which changes the data structure. Option D is wrong because `--from-literal` is used to specify key-value pairs directly on the command line (e.g., `--from-literal=key=value`), not to reference a file.