Ai
1 Star 0 Fork 0

hacker007/kubernetes-demos

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
nginx.yaml 677 Bytes
Copy Edit Raw Blame History
yjl authored 2025-05-22 08:22 +08:00 . add: 1.resource limit
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: dev
spec:
replicas: 3 # 副本数
selector:
matchLabels:
app: nginx-resource-limit
template:
metadata:
labels:
app: nginx-resource-limit
spec:
containers:
- name: nginx-res
image: m.daocloud.io/docker.io/nginx # 使用nginx镜像
ports:
- containerPort: 80
resources: # 资源请求和限制
requests:
memory: "64Mi" # 内存请求
cpu: "250m" # CPU请求
limits:
memory: "128Mi" # 内存限制
cpu: "500m" # CPU限制
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/hacker__007/kubernetes-demos.git
git@gitee.com:hacker__007/kubernetes-demos.git
hacker__007
kubernetes-demos
kubernetes-demos
master

Search