forked from kiwigrid/k8s-sidecar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.yaml
100 lines (99 loc) · 2.13 KB
/
example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-deployment
labels:
app: sample
spec:
replicas: 1
selector:
matchLabels:
app: sample
template:
metadata:
labels:
app: sample
spec:
serviceAccountName: sample-acc
containers:
- name: bash
image: bash:5.2.15
volumeMounts:
- name: shared-volume
mountPath: /tmp/
command: ["watch"]
args: ["ls", "/tmp/"]
- name: sidecar
image: kiwigrid/k8s-sidecar:latest
volumeMounts:
- name: shared-volume
mountPath: /tmp/
env:
- name: LABEL
value: "findme"
- name: FOLDER
value: /tmp/
- name: RESOURCE
value: both
volumes:
- name: shared-volume
emptyDir: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: sample-configmap
labels:
findme: "yea"
data:
hello.world: |-
Hello World!
---
apiVersion: v1
kind: ConfigMap
metadata:
name: sample-configmap-from-url
labels:
findme: "yea"
data:
# fetch https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/grafana/dashboards/nginx.json with the grafana sidecar
# .url will be stripped and the file will be called nginx-ingress.json
nginx-ingress.json.url: https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/grafana/dashboards/nginx.json
---
apiVersion: v1
kind: Secret
metadata:
name: sample-secret
labels:
findme: "yea"
type: Opaque
data:
# base64 encoded: my super cool \n multiline \ secret
secret.world: bXkgc3VwZXIgY29vbAptdWx0aWxpbmUKc2VjcmV0
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: sample-role
rules:
- apiGroups: [""]
resources: ["configmaps", "secrets"]
verbs: ["get", "watch", "list"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: sample-acc
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: sample-rolebind
roleRef:
kind: ClusterRole
name: sample-role
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: sample-acc
namespace: default