I am new to k8s, and have a YAML file that looks like the following:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ubuntu-2404-0728
namespace: test
labels:
app: ubuntu-2404-0728
spec:
replicas: 1
selector:
matchLabels:
app: ubuntu-2404-0728
template:
metadata:
labels:
app: ubuntu-2404-0728
spec:
containers:
- image: ubuntu:24.04
command: ["tail", "-f", "/dev/null"]
resources:
limits:
# !!! Note the following two lines. !!!
cpu: 230
memory: 200Gi
We have several kinds of nodes available in the cluster (in addition to the 230core200g
listed above, such as 128core128g
etc). However, my organization uses a customized version of k8s that requests that we explicitly specify the resource limits (i.e., CPU and memory) when creating a deployment, this hence prevents us from deploying our application on machines such as 128core128g
(and many other nodes with different CPUs and memory), and we hope to make the fullest use of all nodes available.
May I know whether it is possible for me to specify multiple resource limits at once in a single file? Thanks.