Open In App

Kubernetes – Secrets

Pre-requisite:- Kubernetes

Kubernetes is an open-source container orchestration system mainly used for automated software deployment, management, and scaling. Kubernetes is also known as K8s. Kubernetes was originally developed by Google but it is now being maintained by Cloud Native Computing Foundation. It was originally designed to be interfaced with only Docker runtime but it now works with containers and CRI-O also. The main purpose of Kubernetes is to automate the operational tasks of container management. It is included with built-in commands for the deployment of applications and rolling out the required changes in the application. It is currently being used by companies like Google, Spotify, and capital one.



Secrets:

A secret in Kubernetes can be defined as an object that contains a small quantity of sensitive data like a password, a token, or a key. It contains information that is otherwise stored in a container image or pod specification. The main advantage of a secret is that we will not have to include sensitive or confidential data in the application code. There is less risk of losing or exposing secrete during the workflow of creating viewing, and editing Pods because they can be and are created independently of the pods in which they are being used. Secretes can be considered similar to ConfigMaps but the main difference between them is that they are specially designed to store and hold confidential data.

Uses of Secretes:

  1. Secrets can be used as a container environment variable.
  2. As a file in a volume mounted on at least one of its containers.
  3. It can be used by Kubelet when pulling images from the pod.
  4. Secretes are also used by the Kubernetes control plane.

Using a Secret:

Alternatives to Secrets:

If there is a need to protect your data then Secrete is not the only option available. There are some other alternatives available.



There is no compulsion to use only services or one of these options. We can even combine two or more options based on our requirements. 

Article Tags :