-
Notifications
You must be signed in to change notification settings - Fork 12
/
snykit.yaml
72 lines (70 loc) · 1.62 KB
/
snykit.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
#@ load("@ytt:data", "data")
#@ selectors = {
#@ "app.kubernetes.io/name": "{}".format(data.values.name),
#@ "app.kubernetes.io/instance": "{}".format(data.values.name),
#@ }
#@ labels = dict(selectors)
#@ labels.update({"app.kubernetes.io/version": "1.0"})
---
apiVersion: kbld.k14s.io/v1alpha1
kind: Sources
sources:
- image: #@ data.values.image
path: .
---
apiVersion: kbld.k14s.io/v1alpha1
kind: ImageDestinations
destinations:
- image: #@ data.values.image
newImage: #@ "docker.io/{}".format(data.values.image)
---
apiVersion: v1
kind: Service
metadata:
name: #@ data.values.name
labels: #@ labels
spec:
type: LoadBalancer
ports:
- port: #@ data.values.port
targetPort: http
protocol: TCP
name: http
selector: #@ selectors
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: snykit
labels: #@ labels
spec:
replicas: #@ data.values.replicas
selector:
matchLabels: #@ selectors
template:
metadata:
labels: #@ selectors
spec:
containers:
- name: #@ data.values.name
image: #@ data.values.image
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
ports:
- name: http
containerPort: #@ data.values.port
protocol: TCP
- name: metrics
containerPort: #@ data.values.metrics_port
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{}