-
Notifications
You must be signed in to change notification settings - Fork 313
/
Copy pathpod.quiz-data-importer.yaml
101 lines (101 loc) · 3.15 KB
/
pod.quiz-data-importer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
apiVersion: v1
kind: Pod
metadata:
name: quiz-data-importer
spec:
restartPolicy: OnFailure
volumes:
- name: quiz-questions
configMap:
name: quiz-questions
containers:
- name: mongoimport
image: mongo:5
command:
- mongoimport
- mongodb+srv://quiz-pods.kiada.svc.cluster.local/kiada?tls=false
- --collection
- questions
- --file
- /questions.json
- --drop
volumeMounts:
- name: quiz-questions
mountPath: /questions.json
subPath: questions.json
readOnly: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: quiz-questions
labels:
app: quiz
data:
questions.json: |
{
"id": 1,
"text": "The three sections you can find in most Kubernetes API objects are:",
"correctAnswerIndex": 1,
"answers": [
"`info`, `config`, `status`",
"`metadata`, `spec`, `status`",
"`data`, `spec`, `status`",
"`pod`, `deployment`, `service`"
]
}
{
"id": 2,
"text": "Which `kubectl` command describes the fields associated with an API object type?",
"correctAnswerIndex": 2,
"answers": [
"`kubectl describe`",
"`kubectl get`",
"`kubectl explain`",
"`kubectl create`"
]
}
{
"id": 3,
"text": "Which of the following statements is correct?",
"correctAnswerIndex": 2,
"answers": [
"API objects can be labelled and then selected with field selectors.",
"Field selectors can filter objects based on their annotations.",
"A field selector can be used to list pods that run on a particular node.",
"You can use any field in a field selector."
]
}
{
"id": 4,
"text": "When is a pod part of a service?",
"correctAnswerIndex": 0,
"answers": [
"When the pod's labels match the label selector defined in the service.",
"When the pod's name matches the name of the service.",
"When the pod is added to the service's `spec.members` list."
]
}
{
"id": 5,
"text": "Which of the following statements regarding the container shutdown process is correct?",
"correctAnswerIndex": 0,
"answers": [
"The container's preStop hook runs first, then the `TERM` signal is sent to the process in the container.",
"The process in the container receives the `TERM` signal and then runs its preStop hook.",
"The preStop hook kills the container.",
"The `TERM` signal kills the container.",
"The container receives the `KILL` and then the `TERM` signal."
]
}
{
"id": 6,
"text": "Which of the following statements is correct?",
"correctAnswerIndex": 1,
"answers": [
"When the readiness probe fails, the container is restarted.",
"When the liveness probe fails, the container is restarted.",
"Containers without a readiness probe are never restarted.",
"Containers without a liveness probe are never restarted."
]
}