Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
joohanhong
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JooHan Hong
joohanhong
Commits
ea6774e3
Commit
ea6774e3
authored
Aug 08, 2022
by
JooHan Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
k8s, oper update3
parent
76f2c7a6
Pipeline
#6065
passed with stages
in 1 minute and 18 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
95 deletions
+96
-95
README.md
MON/FRONTEND/K8S_OPER/DBAPI/README.md
+47
-45
README.md
MON/FRONTEND/K8S_OPER/NGINX/README.md
+2
-2
README.md
MON/FRONTEND/K8S_OPER/NODEJS/README.md
+47
-48
No files found.
MON/FRONTEND/K8S_OPER/DBAPI/README.md
View file @
ea6774e3
...
...
@@ -2,7 +2,7 @@
# MON Operation Overview
> K8s 기반의 **N
ginx**
Front-End System Overview
> K8s 기반의 **N
ode.js** DB API
Front-End System Overview
# K8s Deployment Current Status
...
...
@@ -28,19 +28,19 @@ monitor-nodejs-f68967947-vrchl 1/1 Running 0 5d23h 10
# monitor Deployment Status
## N
ginx
Deployment yaml
## N
ode.js DB API
Deployment yaml
> 역할 : N
ginx
POD를 배포하는 Deployment를 작성한다.
> 역할 : N
ode.js DB API
POD를 배포하는 Deployment를 작성한다.
```
# cat mon_n
ginx
.yaml
# cat mon_n
odejs_db
.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app:
nginx
name: monitor-
nginx
app:
dbapi
name: monitor-
dbapi
spec:
replicas: 2
strategy:
...
...
@@ -50,11 +50,11 @@ spec:
maxUnavailable: 0
selector:
matchLabels:
app:
nginx
app:
dbapi
template:
metadata:
labels:
app:
nginx
app:
dbapi
spec:
affinity:
nodeAffinity:
...
...
@@ -70,9 +70,10 @@ spec:
- labelSelector:
matchExpressions:
- key: app
#- key: servertype
operator: In
values:
-
nginx
-
dbapi
topologyKey: "kubernetes.io/hostname"
volumes:
- name: mon-home-volume
...
...
@@ -85,61 +86,61 @@ spec:
- 61.100.0.136
- 61.100.0.152
containers:
- image: harbor.hongsnet.net/monitor/monitoring-n
ginx:20220801_32
- image: harbor.hongsnet.net/monitor/monitoring-n
odejs-db:20220801_6
imagePullPolicy: IfNotPresent
name: monitor-
nginx
name: monitor-
dbapi
volumeMounts:
- mountPath: /home
name: mon-home-volume
imagePullSecrets:
- name: harbor-login
```
## N
ginx
HPA Scale yaml
## N
ode.js DB API
HPA Scale yaml
> 역할 : AutoScaling 정책을 작성한다.
```
# cat mon_scale_n
ginx
.yaml
# cat mon_scale_n
odejs_db
.yaml
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name:
nginx
-hpa
name:
dbapi
-hpa
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: monitor-
nginx
name: monitor-
dbapi
minReplicas: 2
maxReplicas: 3
targetCPUUtilizationPercentage:
8
0
targetCPUUtilizationPercentage:
6
0
```
## N
ginx
Service yaml
## N
ode.js DB API
Service yaml
> 역할 : N
ginx
Service를 작성한다. 여기서는 NodePort 방식을 통해 배포한다.
> 역할 : N
ode.js DB API
Service를 작성한다. 여기서는 NodePort 방식을 통해 배포한다.
```
# cat mon_service_n
ginx
.yaml
# cat mon_service_n
odejs_db
.yaml
apiVersion: v1
kind: Service
metadata:
name: monitor-
nginx
name: monitor-
dbapi
spec:
externalTrafficPolicy: Local
type: NodePort
selector:
app:
nginx
app:
dbapi
ports:
- name: nginx
port: 80
protocol: TCP
targetPort: 80
nodePort: 32000
- name: dbapi
port: 8900
targetPort: 8900
nodePort: 32002
```
...
...
@@ -147,45 +148,46 @@ spec:
> 배포 및 관리는 여러 가지 방법이 있지만, 여기서는 **kubectl** 을 사용하여 실행한다.
-
**시작**
-
**시작**
스크립트
```
# cat start-mon_n
ginx
.sh
# cat start-mon_n
odejs_db
.sh
#!/bin/bash
kubectl create -f mon_n
ginx
.yaml
kubectl create -f mon_scale_n
ginx
.yaml
kubectl create -f mon_service_n
ginx
.yaml
kubectl create -f mon_n
odejs_db
.yaml
kubectl create -f mon_scale_n
odejs_db
.yaml
kubectl create -f mon_service_n
odejs_db
.yaml
```
실행결과는 다음과 같다.
```
# ./start-mon_nginx.sh
deployment.apps/monitor-nginx created
horizontalpodautoscaler.autoscaling/nginx-hpa created
service/monitor-nginx created
# ./start-mon_nodejs_db.sh
deployment.apps/monitor-dbapi created
horizontalpodautoscaler.autoscaling/dbapi-hpa created
service/monitor-dbapi created
```
-
**중지**
-
**중지**
스크립트
```
# cat stop-mon_nginx.sh
#!/bin/bash
kubectl delete -f mon_service_n
ginx
.yaml
kubectl delete -f mon_scale_n
ginx
.yaml
kubectl delete -f mon_n
ginx
.yaml
#kubectl delete hpa monitor-nginx
kubectl delete
-f
mon_service_n
odejs_db
.yaml
kubectl delete
-f
mon_scale_n
odejs_db
.yaml
kubectl delete
-f
mon_n
odejs_db
.yaml
```
실행결과는 다음과 같다.
```
# ./stop-mon_nginx.sh
service "monitor-nginx" deleted
horizontalpodautoscaler.autoscaling "nginx-hpa" deleted
deployment.apps "monitor-nginx" deleted
# ./stop-mon_nodejs_db.sh
service "monitor-dbapi" deleted
horizontalpodautoscaler.autoscaling "dbapi-hpa" deleted
deployment.apps "monitor-dbapi" deleted
```
MON/FRONTEND/K8S_OPER/NGINX/README.md
View file @
ea6774e3
...
...
@@ -147,7 +147,7 @@ spec:
> 배포 및 관리는 여러 가지 방법이 있지만, 여기서는 **kubectl** 을 사용하여 실행한다.
-
**시작**
-
**시작**
스크립트
```
# cat start-mon_nginx.sh
...
...
@@ -168,7 +168,7 @@ horizontalpodautoscaler.autoscaling/nginx-hpa created
service/monitor-nginx created
```
-
**중지**
-
**중지**
스크립트
```
# cat stop-mon_nginx.sh
...
...
MON/FRONTEND/K8S_OPER/NODEJS/README.md
View file @
ea6774e3
...
...
@@ -2,7 +2,7 @@
# MON Operation Overview
> K8s 기반의 **N
ginx
** Front-End System Overview
> K8s 기반의 **N
ode.js API
** Front-End System Overview
# K8s Deployment Current Status
...
...
@@ -28,19 +28,19 @@ monitor-nodejs-f68967947-vrchl 1/1 Running 0 5d23h 10
# monitor Deployment Status
## N
ginx
Deployment yaml
## N
ode.js
Deployment yaml
> 역할 : N
ginx
POD를 배포하는 Deployment를 작성한다.
> 역할 : N
ode.js API
POD를 배포하는 Deployment를 작성한다.
```
# cat mon_n
ginx
.yaml
# cat mon_n
odejs
.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: n
ginx
name: monitor-n
ginx
app: n
odejs
name: monitor-n
odejs
spec:
replicas: 2
strategy:
...
...
@@ -50,11 +50,11 @@ spec:
maxUnavailable: 0
selector:
matchLabels:
app: n
ginx
app: n
odejs
template:
metadata:
labels:
app: n
ginx
app: n
odejs
spec:
affinity:
nodeAffinity:
...
...
@@ -72,7 +72,7 @@ spec:
- key: app
operator: In
values:
- n
ginx
- n
odejs
topologyKey: "kubernetes.io/hostname"
volumes:
- name: mon-home-volume
...
...
@@ -83,11 +83,11 @@ spec:
nameservers:
- 8.8.8.8
- 61.100.0.136
- 61.100.0.
1
52
- 61.100.0.
2
52
containers:
- image: harbor.hongsnet.net/monitor/monitoring-n
ginx:20220801_32
- image: harbor.hongsnet.net/monitor/monitoring-n
odejs:20220801_24
imagePullPolicy: IfNotPresent
name: monitor-n
ginx
name: monitor-n
odejs
volumeMounts:
- mountPath: /home
name: mon-home-volume
...
...
@@ -95,97 +95,96 @@ spec:
- name: harbor-login
```
## N
ginx
HPA Scale yaml
## N
ode.js API
HPA Scale yaml
> 역할 : AutoScaling 정책을 작성한다.
```
# cat mon_scale_n
ginx
.yaml
# cat mon_scale_n
odejs
.yaml
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: n
ginx
-hpa
name: n
odejs
-hpa
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: monitor-n
ginx
name: monitor-n
odejs
minReplicas: 2
maxReplicas: 3
targetCPUUtilizationPercentage: 80
targetCPUUtilizationPercentage: 50
```
## N
ginx
Service yaml
## N
ode.js API
Service yaml
> 역할 : N
ginx
Service를 작성한다. 여기서는 NodePort 방식을 통해 배포한다.
> 역할 : N
ode.js API
Service를 작성한다. 여기서는 NodePort 방식을 통해 배포한다.
```
# cat mon_service_n
ginx
.yaml
# cat mon_service_n
odejs
.yaml
apiVersion: v1
kind: Service
metadata:
name: monitor-n
ginx
name: monitor-n
odejs
spec:
externalTrafficPolicy: Local
type: NodePort
selector:
app: n
ginx
app: n
odejs
ports:
- name: nginx
port: 80
protocol: TCP
targetPort: 80
nodePort: 32000
- name: nodejs
port: 8081
targetPort: 8081
nodePort: 32001
```
## 실행
> 배포 및 관리는 여러 가지 방법이 있지만, 여기서는 **kubectl** 을 사용하여 실행한다.
-
**시작**
-
**시작**
스크립트
```
# cat start-mon_n
ginx
.sh
# cat start-mon_n
odejs
.sh
#!/bin/bash
kubectl create -f mon_n
ginx
.yaml
kubectl create -f mon_scale_n
ginx
.yaml
kubectl create -f mon_service_n
ginx
.yaml
kubectl create -f mon_n
odejs
.yaml
kubectl create -f mon_scale_n
odejs
.yaml
kubectl create -f mon_service_n
odejs
.yaml
```
실행결과는 다음과 같다.
```
# ./start-mon_n
ginx
.sh
deployment.apps/monitor-n
ginx
created
horizontalpodautoscaler.autoscaling/n
ginx
-hpa created
service/monitor-n
ginx
created
# ./start-mon_n
odejs
.sh
deployment.apps/monitor-n
odejs
created
horizontalpodautoscaler.autoscaling/n
odejs
-hpa created
service/monitor-n
odejs
created
```
-
**중지**
-
**중지**
스크립트
```
# cat stop-mon_n
ginx
.sh
# cat stop-mon_n
odejs
.sh
#!/bin/bash
kubectl delete -f mon_service_n
ginx
.yaml
kubectl delete -f mon_scale_n
ginx
.yaml
kubectl delete -f mon_n
ginx
.yaml
#kubectl delete hpa monitor-nginx
kubectl delete -f mon_service_n
odejs
.yaml
kubectl delete -f mon_scale_n
odejs
.yaml
kubectl delete -f mon_n
odejs
.yaml
```
실행결과는 다음과 같다.
```
# ./stop-mon_nginx.sh
service "monitor-nginx" deleted
horizontalpodautoscaler.autoscaling "nginx-hpa" deleted
deployment.apps "monitor-nginx" deleted
# ./stop-mon_nodejs.sh
service "monitor-nodejs" deleted
horizontalpodautoscaler.autoscaling "nodejs-hpa" deleted
deployment.apps "monitor-nodejs" deleted
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment