Set 1 Flashcards

1
Q

Shorthand to create a service for a resource

A

kubectl expose

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Flag to set name in kubectl expose

A

–name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Flag to set port in kubectl expose

A

–port

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Flag to set target-port in kubectl expose

A

–target-port

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which flag is used to create a configMap from file

A

–from-file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

which flag is likely used when using shorthand for a secret

A

–from-literal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Grep flag for 5 lines before match

A

-B 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Grep flag for 8 lines after match

A

-A 8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Build image with a tag for registry.killer.sh:5000/sun-cipher

A

Docker build -t registry.killer.sh:5000/sun-cipher:TAGVALUE

podman build -t registry.killer.sh:5000/sun-cipher:TAGVALUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the 3 recommended exam start procedures

A
  1. alias k=kubectl
  2. export do=”–dry-run=client -o yaml”
  3. export now=”–force –grace-period 0”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Navigate to container spec for a deployment and what else would occur in these levels?

A

root (metadata) -> spec (replicas) -> template (metadata) -> pod spec (volumes) -> containers (volumeMounts)
spec.template.spec.containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Build a temp pod to run a command

A

kubectl run tmp –restart=Never –rm –image=nginx:alpine -i – <command></command>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain the steps required to build a functional persistent volume

A

build the following: PersistentVolume, PersistentVolumeClaim, Pod
pod.yaml:
fill spec.volumes:
- name
- persistentVolumeClaim: with claimName
fill spec.containers.volumeMounts:
- mountPath
- name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Where do you control PVC access control?

A

PV.yaml:
metadata.annotations:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

spec to make job execute 3 times

A

spec.completions: 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

spec to make job execute in pairs of 2

A

spec.parallelism: 3

17
Q

T or F: jobs have a spec.template just like a deployment

A

T

18
Q

How do you mount a secret to a pod?

A

spec.containers.volumeMounts:
set name, mountPath and readOnly

spec.volumes:
set name,
secret:
set secretName and optional

19
Q

shorthand to create ConfigMap called indexer: fill it with a file index.html under the key, web.

A

kubectl create configmap indexer –from-file web=index.html

20
Q

How do you mount a ConfigMap to a pod, with a specific value?

A

spec.containers.volumeMounts:
set name and mountPath

spec.volumes:
set name,
configMap:
set name,
items:
set key and path

21
Q

how would you write a pod command in its yaml manifest?

A

[‘sh’, ‘-c’, ‘<command></command>’] or [‘bash’, ‘-c’, ‘<command></command>’]

22
Q

change namespace context to dev

A

kubectl config set-context –current –namespace=dev

23
Q

difference between StatefulSet vs. DaemonSet vs. Deployment

A

StatefulSets run one or more pods with a persistent ID and persistent volumes, which is suitable for running stateful applications.

DaemonSets run one or more pods across the entire cluster or a certain set of nodes. This can be used to run administrative workloads such as logging and monitoring components.

Deployments run one or more pods, allowing you to define how many replicas of the pods need to run, on which types of nodes, and which deployment strategy should be used (for example, a Rolling deployment which replaces pods with a new version one by one, to prevent downtime).