Kubernetes Redis Deployment-need help

Actually we don’t define path for the emptyDir because of nonpersistent behaviour. Remove the path from there.
We cannot define labels under the containers section remove from there. We only write labels under metadata section.
After deployment up and running, You can verify by: –
kubectl describe deployment redis-deployment

Hi ,
In task statement it is mentioned to create empty dir at /redis-master-data ,without path i tried to run
kubectl apply -f redis-deployment.yml
deployment get created but it is not runningproblem_statement

Actually emptyDir don’t need path, it will occupy path from mountPath so don’t worry for that.
Is it scheduled on master node?
kubectl get pod -owide ???
Did you create configmap?

configmap

I think you have to deploy this configmap yaml file. Instead of putting whole config.
kubectl create -f redis-config.yml → declarative way
kubectl create configmap redis-config --from-literal=maxmemory=2mb → imperative way

I am not getting what you want to say. Please explain

Now you are getting?

first i made redis-config.yml file mention all detail in it then
run
kubectl create configmap redis-config --from-file=/redis-config.yml

You don’t need to export whole data in it.

rather then do kubectl create -f redis-config.yml
You have to add data not whole config file
and as we knew data is “maxmemory=2mb”.

Can you describe the events of the pod why it’s not running?
kubectl describe pod pod-name


Pod should be schedule on master node but i can see it’s trying to schedule on node01 ? as per question.

how to schedule it on masternode??

Whatever i said apply it, it will be up and run but schedule this pod on master not in node01

I am trying what all you said , thanks for your support and quick reply

What is the name of master node?
To see do “kubectl get nodes”

kubectl get nodes
NAME STATUS ROLES AGE VERSION
master Ready master 6h13m v1.16.0
node01 Ready 6h12m v1.16.0

Add also this to schedule on master, “nodeName: master-name” whatever it is, Under the Pod spec in your deployment manifest file.

spec:
  nodeName: master-name

To validate , Deployment Pods deployed on master node or somewhere run the following command: -
kubectl get pods -owide

Collect all the data and give it a try again. If any issue let me know.