Fix issue with PhpFpm Application Deployed on Kubernetes Kodekloud

 

Question: We deployed a Nginx and PHPFPM based application on Kubernetes cluster last week and it had been working fine. This morning one of the team members was troubleshooting an issue with this stack and he was supposed to run Nginx welcome page for now on this stack till issue with phpfpm is fixed but he made a change somewhere which caused some issue and the application stopped working. Please look into the issue and fix the same:

The deployment name is nginx-phpfpm-dp and service name is nginx-service. Figure out the issues and fix them. FYI Nginx is configured to use default http port, node port is 30008 and copy index.php under /tmp/index.php to deployment under /var/www/html. Please do not try to delete/modify any other existing components like deployment name, service name etc.

Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.

Solution:

At first check the configmap. 

kubectl get cm

Here, i found index.php typo like index.ph p . So i fixed it at first

Then check the deployment and services

I found wrong port number in services. So i changed port 8092 to 80 in services

kubectl edit svc nginx-service

Then copy th index.php file to /var/www/html

kubectl cp /tmp/index.php nginx-phpfpm-dp-5cccd45499-bn46n:/var/www/html

Finally, check the NodePort 30008 from the UI view port (3 parallel lines on upper right side)





Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment