Skip to content

juliocnsouzadev/CKAD

Repository files navigation

CKAD

CKAD - CERTIFIED KUBERNETES APPLICATION DEVELOPER




Run commands inside pod:

kubectl exec -it podname -- command
kubectl exec -it simple-webapp-1 -- sh ./root/curl-test.sh

Logging

kubectl logs -f my-app-pod my-app-container

Configuration

Commands and arguments

Given the Dockefile bellow:

FROM ubuntu
ENTRYPOINT ["sleep"]
CMD ["5"]

Can run like this:

docker run ubuntu-sleeper #runs with default 5 seconds 
docker run ubuntu-sleeper 10 #runs with explicit 10 seconds 

Translating to a Kubernetes pod definition yaml:

apiVersion: v1
kind: Pod
metadata:
  name: ubuntu-sleeper-pod
spec:
    containers:
     - name: ubuntu-sleeper
       image: ubuntu:latest
       command: ["sleep"] #command is docker ENTRYPOINT
       args: ["10"] #args is docker CMD

or

apiVersion: v1
kind: Pod
metadata:
  name: ubuntu-sleeper-pod
spec:
    containers:
     - name: ubuntu-sleeper
       image: ubuntu:latest
       command: 
        - sleep
        - "10"

About

CKAD - CERTIFIED KUBERNETES APPLICATION DEVELOPER

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages