Creating, modifying, and deleting Secrets in Kubernetes
Previously, we focused on creating Secrets and displaying their usage. We will proceed further on administrating Secrets and identify the available commands and options for provisioning Kubernetes Secrets.
data and stringData
We applied plaintext Secrets either by using a YAML file or through the command line. Behind the scenes, the Secrets that we applied in plaintext were converted to a base64
format. We can either apply Secrets in plaintext or apply them using base64
; eventually, they will end up residing on Kubernetes in a base64
format. When we apply a secret using plaintext values, we use the stringData
field. Kubernetes will handle the encoding and decoding of the values we provided.
Take, for example, the following secret:
apiVersion: v1 kind: Secret metadata: name: plain-text type: Opaque stringData: value: non-base64
Once we create the secret, we will retrieve it. It should be in...