-
Notifications
You must be signed in to change notification settings - Fork 29
/
nv_exporter_secret.yaml
72 lines (69 loc) · 1.7 KB
/
nv_exporter_secret.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
# NV Exporter Conf File - Using Secrets/ConfigMap
# Use config map for not-secret configuration data
apiVersion: v1
kind: ConfigMap
metadata:
name: nv-exporter-cm
data:
CTRL_API_SERVICE: neuvector-svc-controller.neuvector:10443
EXPORTER_PORT: '8068'
---
# Use secrets for things which are actually secret like API keys, credentials, etc
# echo -n 'admin' | base64
apiVersion: v1
kind: Secret
metadata:
name: nv-exporter-secret
type: Opaque
data:
CTRL_USERNAME: YWRtaW4=
CTRL_PASSWORD: YWRtaW4=
---
apiVersion: v1
kind: Service
metadata:
name: neuvector-svc-prometheus-exporter
namespace: neuvector
spec:
ports:
- port: 8068
name: prometheus-exporter
protocol: TCP
selector:
app: neuvector-prometheus-exporter-pod
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: neuvector-prometheus-exporter-pod
namespace: neuvector
spec:
selector:
matchLabels:
app: neuvector-prometheus-exporter-pod
replicas: 1
template:
metadata:
labels:
app: neuvector-prometheus-exporter-pod
spec:
containers:
- name: neuvector-prometheus-exporter-pod
image: neuvector/prometheus-exporter
imagePullPolicy: Always
envFrom:
- configMapRef:
name: nv-exporter-cm
- secretRef:
name: nv-exporter-secret
# env vars - only for test cases
# env:
# - name: CTRL_API_SERVICE
# value: neuvector-svc-controller.neuvector:10443
# - name: CTRL_USERNAME
# value: admin
# - name: CTRL_PASSWORD
# value: admin
# - name: EXPORTER_PORT
# value: "8068"
restartPolicy: Always