From 4ebe411645e6e66ee431393e8a52f8d8b83ea155 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 28 Jul 2022 16:30:36 +0200 Subject: [PATCH] Add secret examples --- generic/alpine-sleep-secret-individual.yaml | 24 ++++++++++++++++++++ generic/alpine-sleep-secret.yaml | 25 +++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 generic/alpine-sleep-secret-individual.yaml create mode 100644 generic/alpine-sleep-secret.yaml diff --git a/generic/alpine-sleep-secret-individual.yaml b/generic/alpine-sleep-secret-individual.yaml new file mode 100644 index 0000000..3c674fe --- /dev/null +++ b/generic/alpine-sleep-secret-individual.yaml @@ -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 diff --git a/generic/alpine-sleep-secret.yaml b/generic/alpine-sleep-secret.yaml new file mode 100644 index 0000000..68f3673 --- /dev/null +++ b/generic/alpine-sleep-secret.yaml @@ -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