Skip to content

Instantly share code, notes, and snippets.

@Andreluizfc
Last active July 20, 2022 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andreluizfc/f0867be81096b323d6e0957f4373cf88 to your computer and use it in GitHub Desktop.
Save Andreluizfc/f0867be81096b323d6e0957f4373cf88 to your computer and use it in GitHub Desktop.
K8s Cheat Sheet

K8s Cheat Sheet

Create ubuntu pod for testing

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

Enter pod for inspection

kubectl exec -it pod-name -- /bin/bash

If namespace is required

kubectl exec -it pod-name -n namespace-name -- /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment