While practising lighting lab 1 , while attempting last questions , there was qu . . .

Rajesh Sinha:
As per error, don’t have enough cpu resources available on nodes

Basavraj Nilkanthe:

Basavraj Nilkanthe:
yes it seems

Basavraj Nilkanthe:
just wanted to confir Rajesh if we can just requests for cpu if we dont defined limits?

Basavraj Nilkanthe:
is that limits definitation mandatory for requests

Basavraj Nilkanthe:
I tried both but still no luck

Basavraj Nilkanthe:
it seems to be resource issue

Basavraj Nilkanthe:
then this lab need to updated

Basavraj Nilkanthe:

kubectl set resources deploy redis --requests=cpu=2 --limits=cpu=2

Basavraj Nilkanthe:
https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#if-you-do-not-specify-a-cpu-limit

Kicky:
@Basavraj Nilkanthe,the question says to request for “0.2” cpu. Not 2 cpu

Rajesh Sinha:
As per question, you can use 200m i.e .2 not 2 core

Mohamed Ayman:
Yes, you requested 2000m but you need to request 200m.

Basavraj Nilkanthe:
thats great finding, thank you guys

Basavraj Nilkanthe:
i will test it again

Basavraj Nilkanthe:
Thanks Guys, It is working as expected after putting --requests=cpu=.2 and really it was consuming my more time while finishing lighting lab and I was manage to finish first four questions in 35 min and because of this issue, it took this time… So it is important to read questions carefully before taking exam …

Rajinikanth:
Hi Guys, I am seeing the below error in pod logs for the above LL-1 last question .

Rajinikanth:
controlplane $ k logs redis-557df78f76-jgp9c
Error from server (NotFound): pods “master” not found

Rajinikanth:
any idea? thanks

Rajinikanth:
cat redis.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: redis
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: redis
spec:
nodeName: master
containers:
- image: redis:alpine
name: redis
ports:
- containerPort: 6379
resources:
requests:
cpu: “0.2”
volumeMounts:
- name: data
mountPath: /redis-master-data
volumeMounts:
- name: redis-storage
mountPath: /redis-master
volumes:
- name: data
emptyDir: {}
- name: redis-storage
configMap:
name: redis-config