Skip to content

Commit d6698f3

Browse files
authored
Merge pull request #8 from tanakaryo/how-to-use-k8s
#3 add resource.
2 parents d465d8d + 2e4ae1b commit d6698f3

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

k8s/apps/app5/test-k8s/dplymnt.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
namespace: test-k8s-ns
6+
labels:
7+
app: nginx
8+
spec:
9+
selector:
10+
matchLabels:
11+
app: nginx
12+
replicas: 2
13+
strategy:
14+
rollingUpdate:
15+
maxSurge: 25%
16+
maxUnavailable: 25%
17+
type: RollingUpdate
18+
template:
19+
metadata:
20+
labels:
21+
app: nginx
22+
spec:
23+
containers:
24+
- name: nginx
25+
image: nginx:latest
26+
ports:
27+
- containerPort: 80

k8s/apps/app5/test-k8s/ns.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: test-k8s-ns

k8s/apps/app5/test-k8s/svc.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: test-k8s-svc
5+
namespace: test-k8s-ns
6+
spec:
7+
type: ClusterIP
8+
sessionAffinity: ClientIP
9+
sessionAffinityConfig:
10+
clientIP:
11+
timeoutSeconds: 10800
12+
ports:
13+
- protocol: TCP
14+
port: 8080
15+
targetPort: 80

k8s/apps/app5/test-k8s/svc2.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: test-k8s-svc
5+
namespace: test-k8s-ns
6+
labels:
7+
app: nginx
8+
spec:
9+
type: NodePort
10+
selector:
11+
app: nginx
12+
ports:
13+
- protocol: TCP
14+
port: 8080
15+
targetPort: 80

0 commit comments

Comments
 (0)