Core Concepts Flashcards
What is a Kubernetes Object
A data object that describes the state of a cluster
How do I list the available Kubernetes objects
kubectl api-resources -o name
What are the two properties of a Kubernets object
spec and status
What is the spec of a kubernetes object
It is the desired state of an object - usually supplied by you
What is the status of a kubernetes object
The actual status of the object
What does the kubectl get command do ?
Returns a list of objects
What does the kubectl describe command do ?
Describes the properties of an object
What are pods ?
A way of adding containers to a kubernetes cluster
Can a pod have more than one container ?
Yes but it is usually one
What does the kind directive specify in yml format ?
The type of kubernetes object that you want
Name two common yml metadata items ?
name and labels
In the spec containers item name three common items?
name image and command
What is the command to create a pod ?
kubectl create -f
How do you list pods ?
kubectl get pods
How do I update a pod ?
kubectly apply -f or kubectly edit pod
What are namespaces ?
A way of organising objects within a cluster ?
How do you specify a namespace ?
Namespace directive under the meta data tag
Whats the command for listing namespaces ?
kubectl get namespaces
How do you create a namespace ?
kubectl create ns
How do you list pods in a namespace ?
kubectl get pods -n
What do the commands and args options do in a yaml file. ?
Allows you to specify a command and arguments to run
How do you specify ports in a yaml file ?
container port option