SIMULATION
Score: 4%

Task
Set the node named ek8s-node-1 as unavailable and reschedule all the pods running on it.
Answer : A
SOLUTION:
[student@node-1] > ssh ek8s
kubectl cordon ek8s-node-1
kubectl drain ek8s-node-1 --delete-local-data --ignore-daemonsets --force
SIMULATION
Check to see how many worker nodes are ready (not including nodes tainted NoSchedule) and write the number to /opt/KUCC00104/kucc00104.txt.
Answer : A
solution


SIMULATION
Print pod name and start time to ''/opt/pod-status'' file
Answer : A
kubect1 get pods -o=jsonpath='{range
items[*]}{.metadata.name}{'\t'}{.status.podIP}{'\n'}{end}'
SIMULATION
Get list of all pods in all namespaces and write it to file ''/opt/pods-list.yaml''
Answer : A
kubectl get po --all-namespaces > /opt/pods-list.yaml
SIMULATION
Check the image version in pod without the describe command
Answer : A
kubectl get po nginx -o
jsonpath='{.spec.containers[].image}{'\n'}'
SIMULATION
Score: 7%

Task
Reconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx.
Create a new service named front-end-svc exposing the container port http.
Configure the new service to also expose the individual Pods via a NodePort on the nodes on which they are scheduled.
Answer : A
Solution:
kubectl get deploy front-end
kubectl edit deploy front-end -o yaml
#port specification named http
#service.yaml
apiVersion: v1
kind: Service
metadata:
name: front-end-svc
labels:
app: nginx
spec:
ports:
- port: 80
protocol: tcp
name: http
selector:
app: nginx
type: NodePort
# kubectl create -f service.yaml
# kubectl get svc
# port specification named http
kubectl expose deployment front-end --name=front-end-svc --port=80 --tarport=80 --type=NodePort
SIMULATION
Schedule a Pod as follows:
. Name: kucc1
. App Containers : 2
. Container Name/Images :
redis
Memcached
Answer : A
