Add secret examples
This commit is contained in:
parent
d2db1cc4f6
commit
4ebe411645
2 changed files with 49 additions and 0 deletions
24
generic/alpine-sleep-secret-individual.yaml
Normal file
24
generic/alpine-sleep-secret-individual.yaml
Normal 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
|
25
generic/alpine-sleep-secret.yaml
Normal file
25
generic/alpine-sleep-secret.yaml
Normal 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
|
Loading…
Reference in a new issue