Skip to Content
Kubernetes Cookbook - Second Edition
book

Kubernetes Cookbook - Second Edition

by Hideto Saito, Hui-Chuan Chloe Lee, Ke-Jou Carol Hsu
May 2018
Intermediate to advanced
554 pages
13h 51m
English
Packt Publishing
Content preview from Kubernetes Cookbook - Second Edition

By volumes

A Secret can be also mounted as volume by using the Secret type of the volume. The following is an example of how to use it:

// example of using Secret volume# cat 2-7-3_volumes.yamlapiVersion: v1kind: Podmetadata:  name: secret-example-volumespec:  containers:  - name: ubuntu    image: ubuntu    command: ["/bin/sh", "-c", "while : ;do cat /secret/token; sleep 10; done"]    volumeMounts:      - name: secret-volume        mountPath: /secret        readOnly: true  volumes:    - name: secret-volume      secret:        secretName: access-token        items:        - key: 2-7-1_access-token          path: token// create the Podkubectl create -f 2-7-3_volumes.yamlpod "secret-example-volume" created

The preceding example will mount secret-volume into the /secret mount point inside the Pod. /secret will ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes Cookbook

Kubernetes Cookbook

Sébastien Goasguen, Michael Hausenblas
DevOps with Kubernetes - Second Edition

DevOps with Kubernetes - Second Edition

Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu

Publisher Resources

ISBN: 9781788837606Supplemental Content