cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: ubuntu-pod
namespace: airflow
spec:
containers:
- name: ubuntu-pod
image: ubuntu:latest
tty: true
resources:
limits:
cpu: 1.6
memory: 2Gi
requests:
memory: 1.1Gi
cpu: 0.7
EOF
kubectl exec -it pod-name -- /bin/bash
If namespace is required
kubectl exec -it pod-name -n namespace-name -- /bin/bash