Kubernetes Secrets
Wrapping up this chapter, and the overall book, you’ll learn about Kubernetes Secrets.
Secrets, in short, are anything that you don’t want to be in plain text. Typically, they are things such as passwords and API keys. However, they could even be usernames. Any type of data that you don’t want to be in plain text, at rest, or in transit can be considered a Secret.
At this point in your engineering journey, it’s assumed that you don’t need to be taught about Secrets, so we’re going to skip that part and dive right into the hands-on part.
Creating Kubernetes Secrets
To create a Kubernetes Secret, you’ll use the secret
resource from the v1
core API group.
For example, the following is a Secret called testsecret
with a username and password:
apiVersion: v1 kind: Secret metadata: name: testsecret type: Opaque data: username: YWRtaW4= password: MWYyZDFlMmU2N2Rm
Confirm...