apiVersion: v1
kind: Pod
metadata:
name: pod-demo
namespace: default
labels:
app: myapp
tier: frontend
spec:
containers:
- name: busybox
image: busybox:latest
command:- “/bin/sh”
- “-c”
- “sleep 3600”
Step 1: Run this yaml file
Step 2: Enter this pod
kubectl exec -it pod-demo bash Enter pod
Step 3: Test whether the domain name resolution is normal
ping kubernetes.default It is normal that the following information appears