Commit 9d79b554 authored by JooHan Hong's avatar JooHan Hong

k8s deployment update

parent 63e1074c
Pipeline #5229 passed with stages
in 46 seconds
......@@ -74,13 +74,58 @@ spec:
labels:
app: k8s-verify
spec:
volumes:
- name: webeditor-hongsnet-volume
persistentVolumeClaim:
claimName: webeditor-hongsnet-volume-pvc
- name: webdata-hongsnet-volume
persistentVolumeClaim:
claimName: webdata-hongsnet-volume-pvc
- name: webeditor-edu-volume
persistentVolumeClaim:
claimName: webeditor-edu-volume-pvc
- name: webdata-edu-volume
persistentVolumeClaim:
claimName: webdata-edu-volume-pvc
- name: webeditorfile-edu-volume
persistentVolumeClaim:
claimName: webeditorfile-edu-volume-pvc
- name: webeditor-newsystem-volume
persistentVolumeClaim:
claimName: webeditor-newsystem-volume-pvc
- name: webdata-newsystem-volume
persistentVolumeClaim:
claimName: webdata-newsystem-volume-pvc
- name: testsrc-home-volume
persistentVolumeClaim:
claimName: testsrc-home-volume-pvc
containers:
- image: registry.hongsnet.net/joohan.hong/docker/nodejs:latest
#imagePullPolicy: Always
imagePullPolicy: IfNotPresent
name: hello-world
ports:
- containerPort: 8080
volumeMounts:
- mountPath: /home
name: testsrc-home-volume
- mountPath: /home/edu/public_html/HongsBoard/Data
name: webdata-edu-volume
- mountPath: /home/edu/public_html/HongsBoard/Web_editor/EDU
name: webeditor-edu-volume
- mountPath: /home/edu/public_html/HongsBoard/Web_editor/FILE
name: webeditorfile-edu-volume
- mountPath: /home/hongsnet/public_html/Data
name: webdata-hongsnet-volume
- mountPath: /home/hongsnet/public_html/Web_editor/FILE
name: webeditor-hongsnet-volume
- mountPath: /home/newhongsystem/public_html/Data
name: webdata-newsystem-volume
- mountPath: /home/newhongsystem/public_html/Web_editor/FILE
name: webeditor-newsystem-volume
resources:
requests:
cpu: "500m"
limits:
cpu: "500m"
nodeSelector:
key: worker
......@@ -102,6 +147,25 @@ spec:
- port: 8080
targetPort: 8080
nodePort: 32000
```
- **Scaling**
```python
# cat hello-world_scale.yaml
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: k8s-verify-hpa
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: hello-world
minReplicas: 5
maxReplicas: 10
targetCPUUtilizationPercentage: 5
```
......@@ -109,6 +173,7 @@ spec:
```bash
# kubectl apply -f hello-world.yaml
# kubectl apply -f hello-world_scale.yaml
# kubectl apply -f hello-world_service.yaml
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment