Created
July 24, 2024 01:42
-
-
Save febri4n/2897e7930577b846f14ff08f287799ec to your computer and use it in GitHub Desktop.
Nginx NFS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: nfs-pv | |
spec: | |
capacity: | |
storage: 1Gi | |
accessModes: | |
- ReadWriteMany | |
persistentVolumeReclaimPolicy: Retain | |
nfs: | |
server: #IP NFS Servernya | |
path: "" #Path NFSnya | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: nfs-pvc | |
spec: | |
accessModes: | |
- ReadWriteMany | |
storageClassName: "" | |
resources: | |
requests: | |
storage: 1Gi | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-nfs-deployment | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: nginx-nfs | |
template: | |
metadata: | |
labels: | |
app: nginx-nfs | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:latest | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- name: nfs-volume | |
mountPath: /usr/share/nginx/html | |
volumes: | |
- name: nfs-volume | |
persistentVolumeClaim: | |
claimName: nfs-pvc | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-nfs-service | |
spec: | |
type: NodePort | |
ports: | |
- port: 80 | |
targetPort: 80 | |
nodePort: 30080 | |
selector: | |
app: nginx-nfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment