Hi @Inderpreet @rahul456 “Deploy Nginx and Phpfpm on Kubernetes”
I have configured the things in correct manner and copied the file in the end in the container too.
apiVersion: v1
kind: Service
metadata:
name: app-service
spec:
type: NodePort
selector:
app: nginx
ports:
- port: 80
targetPort: 80
nodePort: 30012
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
nginx.conf: |
events {}
http {
server {
listen 8099;
index index.html index.htm index.php;
root /var/www/html;
location ~ .php$ {
include fastcgi_params;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
}
apiVersion: v1
kind: Pod
metadata:
name: nginx-phpfpm
labels:
app: nginx
spec:
volumes:
- name: shared-files
emptyDir: {} - name: nginx-config-volume
configMap:
name: nginx-config
containers: - name: nginx-container
image: nginx:latest
volumeMounts: - name: shared-files
mountPath: /var/www/html - name: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf - name: php-fpm-container
image: php:7.1-fpm
volumeMounts: - name: shared-files
mountPath: /var/www/html
I have also copied the file from jump host to the respective container.
But as per the given question the nodeport should be 30012, which I have written. As there were no details given for targetport and port hence I used 80.
But unfortunately, the task failed.
My ask here is why you haven’t mentioned in the question to set which port number to set?
I have posted the solution in the review and hence I have got this feedback.
Is it possible rollback the task and reassign to me again or update the question for future?