Skip to content

Commit 0c74af5

Browse files
volume and liveness-readiness probes
1 parent 06e352c commit 0c74af5

11 files changed

+215
-2
lines changed

labelselector/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Labels ve Selectors
2-
**labels ve selector** konusuyla ilgili dosyalara buradan erişebilirsiniz.
1+
# Service
2+
**Service** konusuyla ilgili dosyalara buradan erişebilirsiniz.

liveready/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Liveness ve Readiness Probes
2+
**liveness ve readiness probes** konusuyla ilgili dosyalara buradan erişebilirsiniz.

liveready/liveness.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
labels:
5+
test: liveness
6+
name: liveness-http
7+
spec:
8+
containers:
9+
- name: liveness
10+
image: k8s.gcr.io/liveness
11+
args:
12+
- /server
13+
livenessProbe:
14+
httpGet:
15+
path: /healthz
16+
port: 8080
17+
httpHeaders:
18+
- name: Custom-Header
19+
value: Awesome
20+
initialDelaySeconds: 3
21+
periodSeconds: 3
22+
---
23+
apiVersion: v1
24+
kind: Pod
25+
metadata:
26+
labels:
27+
test: liveness
28+
name: liveness-exec
29+
spec:
30+
containers:
31+
- name: liveness
32+
image: k8s.gcr.io/busybox
33+
args:
34+
- /bin/sh
35+
- -c
36+
- touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600
37+
livenessProbe:
38+
exec:
39+
command:
40+
- cat
41+
- /tmp/healthy
42+
initialDelaySeconds: 5
43+
periodSeconds: 5
44+
---
45+
apiVersion: v1
46+
kind: Pod
47+
metadata:
48+
name: goproxy
49+
labels:
50+
app: goproxy
51+
spec:
52+
containers:
53+
- name: goproxy
54+
image: k8s.gcr.io/goproxy:0.1
55+
ports:
56+
- containerPort: 8080
57+
livenessProbe:
58+
tcpSocket:
59+
port: 8080
60+
initialDelaySeconds: 15
61+
periodSeconds: 20

liveready/readiness.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: frontend
5+
labels:
6+
team: development
7+
spec:
8+
replicas: 3
9+
selector:
10+
matchLabels:
11+
app: frontend
12+
template:
13+
metadata:
14+
labels:
15+
app: frontend
16+
spec:
17+
containers:
18+
- name: frontend
19+
image: ozgurozturknet/k8s:blue
20+
ports:
21+
- containerPort: 80
22+
livenessProbe:
23+
httpGet:
24+
path: /healthcheck
25+
port: 80
26+
initialDelaySeconds: 5
27+
periodSeconds: 5
28+
readinessProbe:
29+
httpGet:
30+
path: /ready
31+
port: 80
32+
initialDelaySeconds: 20
33+
periodSeconds: 3
34+
---
35+
apiVersion: v1
36+
kind: Service
37+
metadata:
38+
name: frontend
39+
spec:
40+
selector:
41+
app: frontend
42+
ports:
43+
- protocol: TCP
44+
port: 80
45+
targetPort: 80

pod/podenv.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: envpod
5+
labels:
6+
app: frontend
7+
spec:
8+
containers:
9+
- name: envpod
10+
image: ozgurozturknet/env:latest
11+
ports:
12+
- containerPort: 80
13+
env:
14+
- name: USER
15+
value: "Ozgur"
16+
- name: database
17+
value: "testdb.example.com"

requestlimit/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Request ve limit
2+
**request ve limit** konusuyla ilgili dosyalara buradan erişebilirsiniz.

requestlimit/requestlimit.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
labels:
5+
test: requestlimit
6+
name: requestlimit
7+
spec:
8+
containers:
9+
- name: requestlimit
10+
image: ozgurozturknet/stress
11+
resources:
12+
requests:
13+
memory: "64M"
14+
cpu: "250m"
15+
limits:
16+
memory: "256M"
17+
cpu: "0.5"

service/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Labels ve Selectors
2+
**labels ve selector** konusuyla ilgili dosyalara buradan erişebilirsiniz.

volume/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Volume
2+
**volume** konusuyla ilgili dosyalara buradan erişebilirsiniz.

volume/podvolumeemptydir.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: emptydir
5+
spec:
6+
containers:
7+
- name: frontend
8+
image: ozgurozturknet/k8s:blue
9+
ports:
10+
- containerPort: 80
11+
livenessProbe:
12+
httpGet:
13+
path: /healthcheck
14+
port: 80
15+
initialDelaySeconds: 5
16+
periodSeconds: 5
17+
volumeMounts:
18+
- name: cache-vol
19+
mountPath: /cache
20+
- name: sidecar
21+
image: busybox
22+
command: ["/bin/sh"]
23+
args: ["-c", "sleep 3600"]
24+
volumeMounts:
25+
- name: cache-vol
26+
mountPath: /tmp/log
27+
volumes:
28+
- name: cache-vol
29+
emptyDir: {}

volume/podvolumehostpath.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: hostpath
5+
spec:
6+
containers:
7+
- name: hostpathcontainer
8+
image: ozgurozturknet/k8s:blue
9+
ports:
10+
- containerPort: 80
11+
livenessProbe:
12+
httpGet:
13+
path: /healthcheck
14+
port: 80
15+
initialDelaySeconds: 5
16+
periodSeconds: 5
17+
volumeMounts:
18+
- name: directory-vol
19+
mountPath: /dir1
20+
- name: dircreate-vol
21+
mountPath: /cache
22+
- name: file-vol
23+
mountPath: /cache/config.json
24+
volumes:
25+
- name: directory-vol
26+
hostPath:
27+
path: /tmp
28+
type: Directory
29+
- name: dircreate-vol
30+
hostPath:
31+
path: /cache
32+
type: DirectoryOrCreate
33+
- name: file-vol
34+
hostPath:
35+
path: /cache/config.json
36+
type: FileOrCreate

0 commit comments

Comments
 (0)