CKAD Prep Part 7 – Kubernetes Secrets

Kubernetes Secrets A Secret is a Kubernetes object that encapsulates sensitive data such as a password or key. A Secret can be consumed by a container so that applications can access the sensitive data at runtime. Defining a Secret A sample Secret definition is shown below. apiVersion: v1 kind: Secret metadata: name: sample-secret #stringData: #databasePassword: password11 data: databasePassword: cGFzc3dvcmQxMQ== The Secret value can be set as either a plain string or a Base64 encoded string. The example above uses the data attribute with a Base64 encoded value for the key databasePassword. Base64 encoding is useful if you want to specify binary data such as a certificate. [...]