Member-only story

Kubernetes: The Truth No One Wants To Tell About Secret

Akintola L. F. ADJIBAO
4 min readJul 6, 2022

--

Do you really need Secret objects?

Photo by Caleb Oquendo: https://www.pexels.com/photo/man-wearing-black-blazer-3051576

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

--

--

Akintola L. F. ADJIBAO
Akintola L. F. ADJIBAO

Written by Akintola L. F. ADJIBAO

Senior DevOps Engineer (8+years), Speaker, CKA | AWS Certified DevOps Professional | Terraform Certified https://www.upwork.com/freelancers/~01d11b6c65945a1160

Responses (2)