How to: Lab 11.2. ConfigMaps as environment variables
1. Create a `file.env` file with the following content:
   ```sh
   MYSQL_ROOT_PASSWORD=pwd
   MYSQL_ALLOW_EMPTY_PASSWORD=true
   ```
2. Create a File ConfigMap `mycm-file` from the file using `--from-file` option
3. Create an Env-Var ConfigMap `mycm-env` from the file using `--from-env-file` option
4. Compare details of both ConfigMaps, what can you find?
5. Compare the YAML form of both ConfigMaps, what can you find?
6. Create manifest files for the two Deployments with `mysql` image using the ConfigMaps as env-vars:
   - a Deployment called `web-file` for ConfigMap `mycm-file`
   - a Deployment called `web-env` for ConfigMap `mycm-env`
7. Review both manifest files to confirm if env-vars configured correctly, what did you find?
   - any Deployment with correctly configured env-var?
   - which ConfigMap was used for the working Deployment?
   - Are you aware of the issue here?
8. Create a Deployment with two env-vars from the working ConfigMap
9. Connect a shell to a Pod from the Deployment and run `printenv` to confirm env-vars
10. Create a Pod with env-vars from the working ConfigMap
    - how will you set the env-vars for the Pod?
11. Confirm Pod running or troubleshoot/fix any issues
12. Connect a shell to the new Pod and run `printenv` to confirm env-vars
13. Delete all created resources
lab11.2 solution
```sh
echo "MYSQL_ROOT_PASSWORD=mypwd
MYSQL_ALLOW_EMPTY_PASSWORD=true" > file.env
kubectl create cm mycm-file --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from-file=file.env
kubectl create cm mycm-env --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from-env-file=file.env
kubectl describe cm mycm-file mycm-env |less # mycm-file has one filename key while mycm-env has two env-var keys
kubectl get cm mycm-file mycm-env -oyaml|less
kubectl create deploy web-file --image=mysql --dry-run=client -oyaml > webfile.yml
kubectl apply -f webfile.yml # need an existing deployment to generate yaml for env-vars
kubectl set env deploy web-file --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from=configmap/mycm-file --dry-run=client -oyaml
kubectl create deploy web-env --image=mysql --dry-run=client -oyaml | less # no output = keys not found in configmap
kubectl create deploy web-env --image=mysql --dry-run=client -oyaml > webenv.yml
kubectl apply -f webenv.yml # need an existing deployment to generate yaml for env-vars
kubectl set env deploy web-env --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from=configmap/mycm-env --dry-run=client -oyaml|less # output OK and two env-var keys set