Last active
October 15, 2022 23:58
-
-
Save tyzbit/669331868fea29eb49437dff95d69051 to your computer and use it in GitHub Desktop.
How to mount configmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: file | |
namespace: default | |
data: | |
mycoolfile.txt: | | |
hey check out my cool file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: file-reader | |
namespace: default | |
labels: | |
app: file-reader | |
spec: | |
selector: | |
matchLabels: | |
app: file-reader | |
template: | |
metadata: | |
labels: | |
app: file-reader | |
spec: | |
containers: | |
- name: file-reader | |
image: ubuntu | |
command: ["sh","-c","cat /home/mycoolfile.txt && sleep 600"] | |
volumeMounts: | |
- mountPath: "/home/mycoolfile.txt" | |
subPath: "mycoolfile.txt" | |
name: file-configmap | |
volumes: | |
- name: file-configmap | |
configMap: | |
name: file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment