Quick example. I’m assuming this is what you’re trying to do.
$ kubectl run -it alpine --image=alpine:latest -- sh
If you don't see a command prompt, try pressing enter.
/ # apk add curl
(1/5) Installing ca-certificates (20191127-r5)
(2/5) Installing brotli-libs (1.0.9-r3)
(3/5) Installing nghttp2-libs (1.42.0-r1)
(4/5) Installing libcurl (7.76.1-r0)
(5/5) Installing curl (7.76.1-r0)
OK: 8 MiB in 19 packages
/ # curl -kIv https://kubernetes.default.svc.cluster.local
* Trying 10.96.0.1:443...
* Connected to kubernetes.default.svc.cluster.local (10.96.0.1) port 443 (#0)
* Server certificate:
* subject: CN=kube-apiserver
* start date: May 21 00:10:27 2021 GMT
* expire date: May 21 00:10:27 2022 GMT
* issuer: CN=kubernetes
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
/ # exit
Session ended, resume using 'kubectl attach alpine -c alpine -i -t' command when the pod is running
$ kubectl delete pod alpine --force
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod "alpine" force deleted