Skip to content

Commit 85c6a4a

Browse files
committed
chore: add k8s yaml sample
1 parent 332fe3c commit 85c6a4a

File tree

9 files changed

+113
-5
lines changed

9 files changed

+113
-5
lines changed

manifests/template/command-demo.yaml renamed to manifests/sample/k8s/busybox-deployment.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@
44
# this file is https://github.com/superproj/onex.
55
#
66

7+
# 有:wget, telnet, ping
78
apiVersion: apps/v1
89
kind: Deployment
910
metadata:
10-
name: command-demo
11+
name: busybox
1112
spec:
1213
replicas: 1
1314
selector:
1415
matchLabels:
15-
app: command-demo
16+
app: busybox
1617
template:
1718
metadata:
1819
labels:
19-
app: command-demo
20+
app: busybox
2021
spec:
2122
restartPolicy: Always
2223
containers:
23-
- name: my-container
24+
- name: busybox
2425
image: busybox
25-
command: ["sh", "-c", "sleep 3000"]
26+
command: ["sleep", "infinity"]
2627
readinessProbe:
2728
exec:
2829
command: ["false"]
File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2022 Lingfei Kong <[email protected]>. All rights reserved.
2+
# Use of this source code is governed by a MIT style
3+
# license that can be found in the LICENSE file. The original repo for
4+
# this file is https://github.com/superproj/onex.
5+
#
6+
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
metadata:
10+
name: debian12-deployment
11+
labels:
12+
app: debian12
13+
spec:
14+
replicas: 1
15+
selector:
16+
matchLabels:
17+
app: debian12
18+
template:
19+
metadata:
20+
labels:
21+
app: debian12
22+
spec:
23+
containers:
24+
- name: debian12
25+
image: debian:12
26+
command: ["sleep", "infinity"]
27+
args: ["while true; do sleep 30; done;"]
28+
resources:
29+
limits:
30+
memory: "256Mi"
31+
cpu: "500m"
32+
requests:
33+
memory: "128Mi"
34+
cpu: "250m"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: dnsutils-ds
5+
labels:
6+
app: dnsutils-ds
7+
spec:
8+
type: NodePort
9+
selector:
10+
app: dnsutils-ds
11+
ports:
12+
- name: http
13+
port: 80
14+
targetPort: 80
15+
---
16+
apiVersion: apps/v1
17+
kind: DaemonSet
18+
metadata:
19+
name: dnsutils-ds
20+
labels:
21+
addonmanager.kubernetes.io/mode: Reconcile
22+
spec:
23+
selector:
24+
matchLabels:
25+
app: dnsutils-ds
26+
template:
27+
metadata:
28+
labels:
29+
app: dnsutils-ds
30+
spec:
31+
containers:
32+
- name: my-dnsutils
33+
image: tutum/dnsutils:latest
34+
command:
35+
- sleep
36+
- "3600"
37+
ports:
38+
- containerPort: 80
File renamed without changes.
File renamed without changes.

manifests/sample/k8s/nginx-ds.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: nginx-ds
5+
labels:
6+
app: nginx-ds
7+
spec:
8+
type: NodePort
9+
selector:
10+
app: nginx-ds
11+
ports:
12+
- name: http
13+
port: 80
14+
targetPort: 80
15+
---
16+
apiVersion: apps/v1
17+
kind: DaemonSet
18+
metadata:
19+
name: nginx-ds
20+
labels:
21+
addonmanager.kubernetes.io/mode: Reconcile
22+
spec:
23+
selector:
24+
matchLabels:
25+
app: nginx-ds
26+
template:
27+
metadata:
28+
labels:
29+
app: nginx-ds
30+
spec:
31+
containers:
32+
- name: my-nginx
33+
image: nginx
34+
ports:
35+
- containerPort: 80
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)