Create a PersistentVolume named as pv-nautilus. Configure the spec as storage class should be manual, set capacity to 4Gi, set access mode to ReadWriteOnce, volume type should be hostPath and set path to /mnt/itadmin (this directory is already created, you might not be able to access it directly, so you need not to worry about it).
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nautilus
spec:
capacity:
storage: 4Gi
accessModes:
- ReadWriteOnce
storageClassName: manual
hostPath:
path: /mnt/itadmin
type: “”
Create a PersistentVolumeClaim named as pvc-nautilus. Configure the spec as storage class should be manual, request 3Gi of the storage, set access mode to ReadWriteOnce.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-nautilus
spec:
accessModes:
- ReadWriteOnce
storageClassName: manual
resources:
requests:
storage: 3Gi
Create a pod named as pod-nautilus, mount the persistent volume you created with claim name pvc-nautilus at document root of the web server, the container within the pod should be named as container-nautilus using image httpd with latest tag only (remember to mention the tag i.e httpd:latest).
apiVersion: v1
kind: Pod
metadata:
name: pod-nautilus
spec:
containers:
- name: container-xfusion
image: httpd:latest
volumeMounts:
- name: data
mountPath: /usr/local/apache2/htdocs/
volumes:
- name: data
persistentVolumeClaim:
claimName: pvc-nautilus
Create a node port type service named web-nautilus using node port 30008 to expose the web server running within the pod.
apiVersion: v1
kind: Service
metadata:
name: web-nautilus
spec:
type: NodePort
selector:
app: nautilus
ports:
- name: http
port: 80
targetPort: 80
nodePort: 30008
application is not getting up showing 502 erorr
pods logs
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 10.244.0.6. Set the ‘ServerName’ directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 10.244.0.6. Set the ‘ServerName’ directive globally to suppress this message
[Thu Jan 30 10:52:33.028120 2025] [mpm_event:notice] [pid 1:tid 1] AH00489: Apache/2.4.63 (Unix) configured – resuming normal operations
[Thu Jan 30 10:52:33.028281 2025] [core:notice] [pid 1:tid 1] AH00094: Command line: ‘httpd -D FOREGROUND’