Member-only story
Kubernetes: The Truth No One Wants To Tell About Secret
Do you really need Secret objects?
One may respond “OF COURSE YES, Akintola !!!”. But hold on for a minute friend.
A lot of people argue we should use Kubernetes Secrets for application needs. When I started working with Kubernetes I thought the need for Secret Objects was obvious.
But after a short time period and after working on multiple projects, I started doubting its actual need in a process of deploying applications on production. Let’s elaborate.
What is Secret Object?
I want us to start with a clear understanding of what a Secret object is on Kubernetes. I think the official documentation gives a clear definition.
A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Such information might otherwise be put in a Pod specification or in a container image. Using a Secret means that you don’t need to include confidential data in your application code. — Kubernetes Official documentation
Let’s have a look at an example of a Secret YAML file:
apiVersion: v1
kind: Secret
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: { ... }
creationTimestamp: 2020-01-22T18:41:56Z…