Kubernetes Flashcards
- True or False? In a pod .yaml file, resource limit of cpu: 0.1 is allowed.
True. This can also be written as 100m.
- True or False? A secret can be visible to only one container in a pod.
True. This may be done for security reason, such as this example: https://kubernetes.io/docs/concepts/configuration/secret/#use-case-secret-visible-to-one-container-in-a-pod
- What are four main types of services?
-Cluster IP
(Expose the service on a cluster-internal IP, not exposed to anything external to Kubernetes cluster)
-NodePort
(Expose the service on each Node’s IP at a static port. External callers can call the service)
-LoadBalancer
(Provision an external IP to act as a load balancer for the service. Exposes a service to external callers)
-ExternalName
(Maps a service to a DNS name. The service doesn’t change IP addresses, but it routes traffic to an external service that does have a dynamic IP)
- What kubectl command will give you information such as what node and IP address a pod is on? And any failure events?
kubectl describe pod my-nginx
- What are some of the benefits of Deployments?
Deployments support
zero-downtime updates by creating and destroying replica
provide rollback functionality
- What is the name of the AWS volume type?
awsElasticBlockStore
- What command will create three pod replicas?
kubectl scale deployment my-deployement –replicas=3
- What specifies that data in a storage provider should not be erased if a PVC is deleted?
persistentVolumeReclaimPolicy: Retain
- What does the spec.selector.matchLabels key in a Pod .yaml do?
Queries for a template with the specified label in order to use that pod template
- What command creates a ConfigMap from an env file?
kubectl create configmap [configmap-name] –from-env-file=[path-to-file]
- What is a LimitRange?
A LimitRange specifies min and max limits on cpu and memory for pods in a namespace. This prevents pods from not being given a limit and consuming too much memory, thus causing other pods to fail on a node.
- What access mode allows only one client (i.e. one pod) to write to a PV?
-ReadWriteOnce
- How does Kubernetes accomplish a no downtime deployment?
It spins up new pods and routes traffic to them, then subsequently destroys the old pods that no longer have traffic
- What command can be used to externally expose a port on a clusterIP service?
kubectl port-forward service/[service-name] 8080
- What are some zero-downtime deployment options that kubernetes can facilitate?
Blue-Green and Canary deployments, among others
- What are the two types of Kubernetes probes?
Liveness and readiness
- What is the annotations.last-applied-configuration.key in a .yaml file?
It gives details of the resource’s configurations.
This allows changes to be made to a Pod using kubectl apply
- What is a StatefulSet?
A StatefulSet manages the following of a set of pods
1) deployment and
2) scaling
- What happens to a scheduled pod that cannot have its resource requests met by a node?
It remains in the PENDING state.
- What is a risk of using a hostPath volume?
It is dependent on the host. If the host dies, the data is inaccessible and potentially lost.