Skip to content
kubectl debug demoapp-7cc687d895-8xltm --image=ubuntu:20.04 -it --target=demoapp
kubectl debug demoapp-7cc687d895-8xltm --image=ubuntu:20.04 -it --target=demoapp

或者

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: busybox-deployment
  namespace: ops
spec:
  replicas: 1
  selector:
    matchLabels:
      app: busybox
  template:
    metadata:
      labels:
        app: busybox
    spec:
      containers:
      - name: busybox
        image: busybox
        args:
          - /bin/sh
          - -c "cmd"
apiVersion: apps/v1
kind: Deployment
metadata:
  name: busybox-deployment
  namespace: ops
spec:
  replicas: 1
  selector:
    matchLabels:
      app: busybox
  template:
    metadata:
      labels:
        app: busybox
    spec:
      containers:
      - name: busybox
        image: busybox
        args:
          - /bin/sh
          - -c "cmd"