apiVersion: apps/v1
kind: Deployment
metadata:
  name: centos-qos
spec:
  replicas: 1
  selector:
    matchLabels:
      app: centos
  template:
    metadata:
      labels:
        app: centos
    spec:
      containers:
      - command:
        - tail
        - -f
        - /dev/null
        image: centos
        name: centos
        resources:
          requests:
            cpu: 250m
            memory: 1Gi
          limits:
            cpu: 250m
            memory: 1Gi
        env:
          - name: SYSTEM_NAMESPACE_ENV
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: PODIP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
          - name: CPU_LIMIT
            valueFrom:
              resourceFieldRef:
                containerName: centos
                resource: limits.cpu
                divisor: 1m