Skip to content

Commit 3a238c9

Browse files
eliotthaianmiell
authored andcommitted
Add PodPreset Example
1 parent fdf3521 commit 3a238c9

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

PodPreset/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## PodPreset Example
2+
---
3+
4+
1. Change the metadata `name` tag to the name you want
5+
2. Set the `role`. The preset will act on all Pods with the same role.
6+
3. Set the environment variables and values you need for the Pods.
7+
4. Mount a volume if wanted.
8+
9+
Reference: https://kubernetes.io/docs/tasks/inject-data-application/podpreset/

PodPreset/pod-preset.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: settings.k8s.io/v1alpha1
2+
kind: PodPreset
3+
metadata:
4+
name: setup-database
5+
spec:
6+
selector:
7+
matchLabels:
8+
role: frontend
9+
env:
10+
- name: DB_PORT
11+
value: "6379"
12+
volumeMounts:
13+
- mountPath: /cache
14+
name: cache-volume
15+
volumes:
16+
- name: cache-volume
17+
emptyDir: {}
18+
19+

0 commit comments

Comments
 (0)