My .yaml file:
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
nginx.config: |
events {}
http {
server {
listen 8095;
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_FILRNAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
}
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: NodePort
selector:
app: nginx
ports:
- port: 8095
targetPort: 8095
nodePort: 30012
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: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf - name: shared-files
mountPath: /var/www/html
- name: nginx-config-volume
- name: php-fpm-container
image: php:8.2-fpm-alpine
volumeMounts:- name: shared-files
mountPath: /var/www/html
- name: shared-files
The error is in POD:
NAME READY STATUS RESTARTS AGE
pod/nginx-phpfpm 1/2 CrashLoopBackOff 1 (5s ago) 52s