新增learn-kubernetes(https://github.com/yyong-brs/learn-kubernetes)相关文件
This commit is contained in:
27
learn/learn-kubernetes-master/kiamol/ch19/pi/deployment.yaml
Normal file
27
learn/learn-kubernetes-master/kiamol/ch19/pi/deployment.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pi-web
|
||||
labels:
|
||||
kiamol: ch19
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: pi-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: pi-web
|
||||
spec:
|
||||
containers:
|
||||
- image: kiamol/ch05-pi
|
||||
command: ["dotnet", "Pi.Web.dll", "-m", "web"]
|
||||
name: web
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
resources:
|
||||
limits:
|
||||
cpu: 250m
|
||||
requests:
|
||||
cpu: 125m
|
||||
14
learn/learn-kubernetes-master/kiamol/ch19/pi/hpa-cpu.yaml
Normal file
14
learn/learn-kubernetes-master/kiamol/ch19/pi/hpa-cpu.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: autoscaling/v1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: pi-cpu
|
||||
labels:
|
||||
kiamol: ch19
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: pi-web
|
||||
minReplicas: 1
|
||||
maxReplicas: 5
|
||||
targetCPUUtilizationPercentage: 75
|
||||
13
learn/learn-kubernetes-master/kiamol/ch19/pi/service.yaml
Normal file
13
learn/learn-kubernetes-master/kiamol/ch19/pi/service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pi-web
|
||||
labels:
|
||||
kiamol: ch19
|
||||
spec:
|
||||
ports:
|
||||
- port: 8031
|
||||
targetPort: http
|
||||
selector:
|
||||
app: pi-web
|
||||
type: LoadBalancer
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: pi-cpu
|
||||
labels:
|
||||
kiamol: ch19
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: pi-web
|
||||
minReplicas: 1
|
||||
maxReplicas: 5
|
||||
metrics:
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: 75
|
||||
behavior:
|
||||
scaleDown:
|
||||
stabilizationWindowSeconds: 30
|
||||
policies:
|
||||
- type: Percent
|
||||
value: 50
|
||||
periodSeconds: 15
|
||||
Reference in New Issue
Block a user