Secrets - Kubernetes - 0 views
-
Putting this information in a secret is safer and more flexible than putting it verbatim in a PodThe smallest and simplest Kubernetes object. A Pod represents a set of running containers on your cluster. definition or in a container imageStored instance of a container that holds a set of software needed to run an application. .
-
A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key.
- ...63 more annotations...
-
A secret can be used with a pod in two ways: as files in a volumeA directory containing data, accessible to the containers in a pod. mounted on one or more of its containers, or used by kubelet when pulling images for the pod.
-
Kubernetes automatically creates secrets which contain credentials for accessing the API and it automatically modifies your pods to use this type of secret.
-
stringData field is provided for convenience, and allows you to provide secret data as unencoded strings.
-
where you are deploying an application that uses a Secret to store a configuration file, and you want to populate parts of that configuration file during your deployment process.
-
When using the base64 utility on Darwin/macOS users should avoid using the -b option to split long lines.
-
Secrets can be mounted as data volumes or be exposed as environment variablesContainer environment variables are name=value pairs that provide useful information into containers running in a Pod. to be used by a container in a pod.
-
If .spec.volumes[].secret.items is used, only keys specified in items are projected. To consume all keys from the secret, all of them must be listed in the items field.
-
You can also specify the permission mode bits files part of a secret will have. If you don’t specify any, 0644 is used by default.
-
Inside the container that mounts a secret volume, the secret keys appear as files and the secret values are base-64 decoded and stored inside these files.
-
Inside a container that consumes a secret in an environment variables, the secret keys appear as normal environment variables containing the base-64 decoded values of the secret data.
-
An imagePullSecret is a way to pass a secret that contains a Docker (or other) image registry password to the Kubelet so it can pull a private image on behalf of your Pod.
-
Secret API objects reside in a namespaceAn abstraction used by Kubernetes to support multiple virtual clusters on the same physical cluster. . They can only be referenced by pods in that same namespace.
-
Secrets must be created before they are consumed in pods as environment variables unless they are marked as optional.
-
References via secretKeyRef to keys that do not exist in a named Secret will prevent the pod from starting.
-
Think carefully before sending your own ssh keys: other users of the cluster may have access to the secret.
-
Special characters such as $, \*, and ! require escaping. If the password you are using has special characters, you need to escape them using the \\ character.
-
a frontend container which handles user interaction and business logic, but which cannot see the private key;
-
a signer container that can see the private key, and responds to simple signing requests from the frontend
-
When deploying applications that interact with the secrets API, access should be limited using authorization policies such as RBAC
-
watch and list requests for secrets within a namespace are extremely powerful capabilities and should be avoided
-
watch and list all secrets in a cluster should be reserved for only the most privileged, system-level components.
-
each container in a pod has to request the secret volume in its volumeMounts for it to be visible within the container.
-
In the API server secret data is stored in etcdConsistent and highly-available key value store used as Kubernetes’ backing store for all cluster data.