-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathservice.yaml
129 lines (128 loc) · 3.24 KB
/
service.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
# Deployment of our locust-service
apiVersion: apps/v1
kind: Deployment
metadata:
name: locust-service
namespace: keptn
spec:
selector:
matchLabels:
run: locust-service
replicas: 1
template:
metadata:
labels:
run: locust-service
app.kubernetes.io/name: locust-service
app.kubernetes.io/version: 0.1.5
spec:
containers:
- name: locust-service
image: keptnsandbox/locust-service:0.1.5
ports:
- containerPort: 8080
env:
- name: CONFIGURATION_SERVICE
value: 'http://configuration-service:8080'
- name: distributor
image: keptn/distributor:0.8.7
livenessProbe:
httpGet:
path: /health
port: 10999
initialDelaySeconds: 5
periodSeconds: 5
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
resources:
requests:
memory: "16Mi"
cpu: "25m"
limits:
memory: "32Mi"
cpu: "250m"
env:
- name: PUBSUB_URL
value: 'nats://keptn-nats-cluster'
- name: PUBSUB_TOPIC
value: 'sh.keptn.event.test.triggered'
- name: PUBSUB_RECIPIENT
value: '127.0.0.1'
- name: VERSION
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/version'']'
- name: K8S_DEPLOYMENT_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: 'metadata.labels[''app.kubernetes.io/name'']'
- name: K8S_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
serviceAccountName: keptn-locust-service
---
# Expose locust-service via Port 8080 within the cluster
apiVersion: v1
kind: Service
metadata:
name: locust-service
namespace: keptn
labels:
run: locust-service
spec:
ports:
- port: 8080
protocol: TCP
selector:
run: locust-service
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: keptn-locust-service
namespace: keptn
---
# Role for accessing secrets in the namespace
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: keptn-locust-service-read-secrets
namespace: keptn
rules:
- apiGroups:
- ""
resources:
- "secrets"
verbs:
- "get"
---
# Bind role for accessing secrets onto the locust service account
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: keptn-locust-service-read-secrets
namespace: keptn
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: keptn-locust-service-read-secrets
subjects:
- kind: ServiceAccount
name: keptn-locust-service
namespace: keptn