concept Secrets in category kubernetes

This is an excerpt from Manning's book GitOps and Kuberentes.
In the worst case, an attacker with full access to the git repository would be able to push a new commit to the git repo containing a Deployment with a malicious container in the cluster. This might be complemented with a Role and RoleBinding that could grant the Deployment enough privileges to read Secrets and exfiltrate sensitive information.
Using Secrets is optional in Kubernetes, but more convenient, flexible, and secure than other techniques, such as placing the sensitive values directly in the pod specification, or baking the values into the container image during build time.

This is an excerpt from Manning's book Kubernetes in Action.
Deleting everything with the all keyword doesn’t delete absolutely everything. Certain resources (like Secrets, which we’ll introduce in chapter 7) are preserved and need to be deleted explicitly.
Kubernetes helps keep your Secrets safe by making sure each Secret is only distributed to the nodes that run the pods that need access to the Secret. Also, on the nodes themselves, Secrets are always stored in memory and never written to physical storage, which would require wiping the disks after deleting the Secrets from them.
On the master node itself (more specifically in etcd), Secrets used to be stored in unencrypted form, which meant the master node needs to be secured to keep the sensitive data stored in Secrets secure. This didn’t only include keeping the etcd storage secure, but also preventing unauthorized users from using the API server, because anyone who can create pods can mount the Secret into the pod and gain access to the sensitive data through it. From Kubernetes version 1.7, etcd stores Secrets in encrypted form, making the system much more secure. Because of this, it’s imperative you properly choose when to use a Secret or a ConfigMap. Choosing between them is simple: