K8S 指定节点,command, 使用宿主机网络例子

apiVersion: apps/v1
kind: Deployment
metadata:
  name: centos8
  namespace: test-nengguan
spec:
  replicas: 1
  minReadySeconds: 120
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: centos8
  template:
    metadata:
      labels:
        app: centos8
    spec:
      hostNetwork: true
      nodeName: cn-shenzhen.172.18.113.129
      containers:
      - name: centos8
        image: busybox
        command: ["top","-b"]
        resources:
          limits:
            cpu: 1000m
            memory: 1Gi
          requests:
            cpu: 50m
            memory: 1Gi
posted @ 2021-08-26 10:32  klvchen  阅读(303)  评论(0)    收藏  举报