-
Notifications
You must be signed in to change notification settings - Fork 4
/
Kubernetes.yaml
98 lines (98 loc) · 2.54 KB
/
Kubernetes.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
apiVersion: v1
kind: ConfigMap
metadata:
name: sim-sensor-settings
namespace: default
data:
APPINSIGHTS_INSTRUMENTATIONKEY: insert_yours_here
ReadingsDelay: "30"
ImageDelay: "3600"
---
apiVersion: v1
kind: Service
metadata:
name: simulated-sensors-service
labels:
app: simulated-sensors-service
spec:
clusterIP: None
selector:
app: simulated-sensors-service
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: simulated-sensors
spec:
replicas: 5
serviceName: "simulated-sensors-service"
selector:
matchLabels:
app: sim-sensor
template:
metadata:
labels:
app: sim-sensor
spec:
volumes:
- name: secrets
secret:
secretName: sim-sensor-credentials
containers:
- name: test-container
image: clumsypilot/iotsimulator
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "64Mi"
cpu: "250m"
envFrom:
- configMapRef:
name: sim-sensor-settings
volumeMounts:
- name: secrets
mountPath: /secrets
readOnly: true
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_SERVICE_ACCOUNT
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: CPU_REQUEST
valueFrom:
resourceFieldRef:
containerName: test-container
resource: requests.cpu
- name: CPU_LIMIT
valueFrom:
resourceFieldRef:
containerName: test-container
resource: limits.cpu
- name: MEM_REQUEST
valueFrom:
resourceFieldRef:
containerName: test-container
resource: requests.memory
- name: MEM_LIMIT
valueFrom:
resourceFieldRef:
containerName: test-container
resource: limits.memory