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.
You have to write under pod template not deployment.
ok , thank you so much for all your guidance
Welcome…
@Tej-Singh-Rana We are writing here deployment template only right?
How to write POD template inside deployment?
Below is my redis-deployment-yml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-deployment
spec:
selector:
matchLabels:
app: redis
role: master
nodename: master
replicas: 1
template:
metadata:
labels:
app: redis
role: master
spec:
containers:
- name: redis-container
image: redis:alpine
resources:
requests:
cpu: 1
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /redis-master-data
name: data
- mountPath: /redis-master
name: config
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: redis-config
items:
- key: redis-config
path: redis.conf
Can you please tell me, how to tell this deployment to run on Master node?
Hello, balu.networks7
You need to define nodeName field as you did but in the wrong place. nodeName field comes under the template.spec.
You volumes configMap not looks good. You need to define only configmap name.