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
ae49c543
Commit
ae49c543
authored
Aug 08, 2022
by
JooHan Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
k8s, oper update1
parent
1b76aba6
Pipeline
#6063
passed with stages
in 1 minute and 6 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
215 additions
and
1 deletion
+215
-1
.gitkeep
MON/FRONTEND/K8S_OPER/DBAPI/.gitkeep
+0
-0
.gitkeep
MON/FRONTEND/K8S_OPER/NGINX/.gitkeep
+0
-0
.gitkeep
MON/FRONTEND/K8S_OPER/NODEJS/.gitkeep
+0
-0
README.md
MON/FRONTEND/K8S_OPER/README.md
+215
-1
No files found.
MON/FRONTEND/K8S_OPER/DBAPI/.gitkeep
0 → 100644
View file @
ae49c543
MON/FRONTEND/K8S_OPER/NGINX/.gitkeep
0 → 100644
View file @
ae49c543
MON/FRONTEND/K8S_OPER/NODEJS/.gitkeep
0 → 100644
View file @
ae49c543
MON/FRONTEND/K8S_OPER/README.md
View file @
ae49c543
...
...
@@ -6,7 +6,7 @@
> K8s 설치 과정은 생략한다.
# K8s
POD
Current Status
# K8s
Deployment
Current Status
```
# kubectl get pods -o wide |grep mon
...
...
@@ -17,3 +17,217 @@ monitor-nginx-7cdb67c44f-fb8tk 1/1 Running 0 5d23h 10
monitor-nodejs-f68967947-qz7bm 1/1 Running 0 5d23h 10.244.4.6 tb3-docker <none> <none>
monitor-nodejs-f68967947-vrchl 1/1 Running 0 5d23h 10.244.4.5 tb3-docker <none> <none>
```
# Docker Private Registry(harbor.hongsnet.net) Secret
```
# kubectl create secret generic harbor-login --from-file=.dockerconfigjson=/root/.docker/config.json --type=kubernetes.io/dockerconfigjson
```
> Private Container Image에 대한 인증 Secret를 생성한다. 이는 다음의 Deployment에서 사용된다.
# monitor Deployment Status
## Nginx Deployment yaml
> 역할 : Nginx POD를 생성하는 Deployment를 작성한다.
```
# cat mon_nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: monitor-nginx
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: servertype
operator: NotIn
values:
- master
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nginx
topologyKey: "kubernetes.io/hostname"
volumes:
- name: mon-home-volume
persistentVolumeClaim:
claimName: mon-home-volume-pvc
dnsPolicy: "None"
dnsConfig:
nameservers:
- 8.8.8.8
- 61.100.0.136
- 61.100.0.152
containers:
- image: harbor.hongsnet.net/monitor/monitoring-nginx:20220801_32
imagePullPolicy: IfNotPresent
name: monitor-nginx
volumeMounts:
- mountPath: /home
name: mon-home-volume
imagePullSecrets:
- name: harbor-login
```
## Node.js API Deployment yaml
> 역할 :
```
# cat mon_nodejs.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nodejs
name: monitor-nodejs
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: nodejs
template:
metadata:
labels:
app: nodejs
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: servertype
operator: NotIn
values:
- master
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nodejs
topologyKey: "kubernetes.io/hostname"
volumes:
- name: mon-home-volume
persistentVolumeClaim:
claimName: mon-home-volume-pvc
dnsPolicy: "None"
dnsConfig:
nameservers:
- 8.8.8.8
- 61.100.0.136
- 61.100.0.152
containers:
- image: harbor.hongsnet.net/monitor/monitoring-nodejs:20220801_24
imagePullPolicy: IfNotPresent
name: monitor-nodejs
volumeMounts:
- mountPath: /home
name: mon-home-volume
imagePullSecrets:
- name: harbor-login
```
## Node.js DB API Deployment yaml
> 역할 :
```
# cat mon_dbapi.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: dbapi
name: monitor-dbapi
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: dbapi
template:
metadata:
labels:
app: dbapi
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: servertype
operator: NotIn
values:
- master
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- dbapi
topologyKey: "kubernetes.io/hostname"
volumes:
- name: mon-home-volume
persistentVolumeClaim:
claimName: mon-home-volume-pvc
dnsPolicy: "None"
dnsConfig:
nameservers:
- 8.8.8.8
- 61.100.0.136
- 61.100.0.152
containers:
- image: harbor.hongsnet.net/monitor/monitoring-nodejs-db:20220801_6
imagePullPolicy: IfNotPresent
name: monitor-dbapi
volumeMounts:
- mountPath: /home
name: mon-home-volume
imagePullSecrets:
- name: harbor-login
```
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