concept stringdata field in category kubernetes

appears as: stringData field, The stringData field
Kubernetes in Action

This is an excerpt from Manning's book Kubernetes in Action.

Introducing the stringData field

Because not all sensitive data is in binary form, Kubernetes also allows setting a Secret’s values through the stringData field. The following listing shows how it’s used.

Listing 7.23. Adding plain text entries to a Secret using the stringData field
kind: Secret
apiVersion: v1
stringData:                                    #1
  foo: plain text                              #2
data:
  https.cert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCekNDQ...
  https.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcE...

The stringData field is write-only (note: write-only, not read-only). It can only be used to set values. When you retrieve the Secret’s YAML with kubectl get -o yaml, the stringData field will not be shown. Instead, all entries you specified in the stringData field (such as the foo entry in the previous example) will be shown under data and will be Base64-encoded like all the other entries.

sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage