-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkube.yaml
109 lines (109 loc) · 2.59 KB
/
kube.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
kind: Service
apiVersion: v1
metadata:
name: sampleapp
namespace: sample
spec:
type: ClusterIP
selector:
app: sampleapp
ports:
- protocol: TCP
port: 8080
targetPort: 8080
name: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: sampleapp
name: sampleapp
namespace: sample
spec:
replicas: 1
selector:
matchLabels:
app: sampleapp
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
app: sampleapp
annotations:
sidecar.istio.io/inject: "true"
prometheus.io.scrape: "true"
prometheus.io.path: "/metrics"
prometheus.io.port: "9090"
pyroscope.io/application-name: sample.sampleapp
pyroscope.io/port: "9091"
pyroscope.io/profile-cpu-enabled: "true"
pyroscope.io/profile-mem-enabled: "true"
pyroscope.io/scrape: "true"
spec:
automountServiceAccountToken: false
containers:
- image: local/sample/sampleapp
imagePullPolicy: IfNotPresent
name: sampleapp
env:
- name: OTL_ENDPOINT
value: grafana-agent.monitoring.svc.cluster.local:4317
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
ports:
- name: metric
containerPort: 9090
- name: healthchecks
containerPort: 9091
resources:
limits:
cpu: 256m
memory: 128Mi
requests:
cpu: 128m
memory: 32Mi
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /healthz
port: healthchecks
initialDelaySeconds: 2
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /readyz
port: healthchecks
initialDelaySeconds: 2
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
restartPolicy: Always
securityContext:
fsGroup: 2000
runAsGroup: 3000
runAsNonRoot: true
runAsUser: 1000
serviceAccountName: sample
terminationGracePeriodSeconds: 60
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: sampleapp
namespace: sample
spec:
minAvailable: 1
selector:
matchLabels:
name: sampleapp