Shared Flashcard Set

Details

Kubernetes Sec 3
CKA
21
Computer Science
Professional
08/16/2020

Additional Computer Science Flashcards

 


 

Cards

Term
kubectl with selector
Definition
kubectl get pods --selector app=app1
Term
annotations
Definition
- used for info only (not selectable)
- metadata:
labels:
app: app1
annotations:
version: v1
Term
taint effects
Definition
- does NOT guarantee a specific node!
- if pod does NOT tolerate taint
- NoSchedule
- don't schedule pod ever
- PreferNoSchedule
- try not to schedule, but not guaranteed
- NoExecute
- do not schedule any new pods
- any pods already scheduled will be killed
Term
taint command
Definition
- add
kubectl taint nodes "node" app=blue:NoSchedule
- remove
kubectl taint nodes "node" app=blue:NoSchedule-
Term
toleration yaml
Definition
spec:
tolerations:
- key:"app"
operator: "Equal"
value: "blue"
effect: "NoSchedule"
Term
Node selector yaml
Definition
spec:
nodeSelector:
"label1": "value1"
Term
Label nodes
Definition
kubectl label nodes "node" key=value
Term
manually assign pod to node
Definition
spec:
nodeName: "node"
Term
Node affinity yaml
Definition
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: size
operator: In
values:
- Large
- Medium
OR
- matchExpressions:
- key: size
operator: NotIn
values:
- Small
Term
Node affinity types
Definition
- requiredDuringSchedulingIgnoredDuringExectuion
- no placement if no match
- if pod already assigned, ignore affinity
- preferredDuringSchedulingIgnoredDuringExecution
- try to match, but place anyway if no match
- if pod already assigned, ignore affinity
Term
Resources yaml
Definition
spec:
containers:
resources:
requests:
memory: 1Gi
cpu: 1
- cpu
0.1 = 100m = 100 mili
1 = 1 AWS vCPU

- memory
1G (1,000Kb) or 1Gi (1,024Kb)
or without suffix (just #'s)
Term
Default resources & yaml
Definition
- cpu = 1 or 1vCPU
- memory = 512Mi

spec:
containers:
resources:
limits:
memory:
cpu:
Term
Resource behavior
Definition
- cpu - throttle if pass limit
- memory - allow pass limit but kill container if continuously pass limit
Term
LimitRange yaml
Definition
apiVersion: v1
kind: LimitRange
metadata:
name: limit-range
spec:
limits:
- default:
memory: 512Mi
defaultRequest:
memroy: 256Mi
type: Container
Term
Running pods & deployments
Definition
- Certain fields in pods cannot be changed when running so get yaml, change yaml, del pod, recreate pod
- Deployments can be edited when running and all pods will be deleted and recreated automatically
Term
Daemon Sets
Definition
- Replicate pod to every node in cluster
- Replicate pod to new nodes in cluster
- Delete pods from deleted nodes in cluster
- Good for agents like monitoring and logging
- e.g. kube-proxy
- kubectl get daemonsets or ds
Term
Daemonset Yaml
Definition
- same as replica set
- kind: DaemonSet
Term
static pods
Definition
- kubelets read "pod-manifest-path" from kubelet.service file to get pod yaml files.
- used for master nodes to create control plane pods (apiserver, etcd, controller, etc.)
- pods can be viewed by apiserver, but read-only
- ignored by kube scheduler
Term
Pod schedule yaml
Definition
spec:
schedulerName: "custom scheduler"
Term
events
Definition
kubectl get events
Term
Find static pods
Definition
kubectl get pods --all-namespaces | grep "-master"
Supporting users have an ad free experience!