Add secret examples

This commit is contained in:
Nico Schottelius 2022-07-28 16:30:36 +02:00
parent d2db1cc4f6
commit 4ebe411645
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,24 @@
apiVersion: v1
kind: Pod
metadata:
name: alpine-ssh-secret-individual
spec:
containers:
- name: alpine
image: alpine:3.15
args:
- sleep
- "1000000"
volumeMounts:
- mountPath: "/root/.ssh/id_rsa.pub"
name: ssh-key
subPath: ssh-publickey
- mountPath: "/root/.ssh/id_rsa"
name: ssh-key
subPath: ssh-privatekey
volumes:
- name: ssh-key
secret:
secretName: backup1-sshkey
defaultMode: 0400

View File

@ -0,0 +1,25 @@
apiVersion: v1
kind: Pod
metadata:
name: alpine-ssh-secret
spec:
containers:
- name: alpine
image: alpine:3.15
args:
- sleep
- "1000000"
volumeMounts:
- mountPath: "/root/.ssh/"
name: ssh-key
volumes:
- name: ssh-key
secret:
secretName: backup1-sshkey
defaultMode: 0400
items:
- key: ssh-publickey
path: id_rsa.pub
- key: ssh-privatekey
path: id_rsa