nginx added
This commit is contained in:
76
nginx/cm.yaml
Normal file
76
nginx/cm.yaml
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: nginx-vhosts
|
||||||
|
data:
|
||||||
|
default.conf: |
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html/homepage;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
charset utf-8;
|
||||||
|
}
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
|
||||||
|
gzip_min_length 1000;
|
||||||
|
|
||||||
|
## direkt in Treafik geroutet
|
||||||
|
# location /_matrix {
|
||||||
|
# proxy_pass http://synapse:8008;
|
||||||
|
# proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
# client_max_body_size 128m;
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# location /.well-known/matrix/ {
|
||||||
|
# default_type application/json;
|
||||||
|
# add_header Access-Control-Allow-Origin https://borninpain.de;
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name dev.ggwe;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html/ggwe;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
#access_log /var/log/nginx/dev.abc.de.access.log;
|
||||||
|
#error_log /var/log/nginx/dev.abc.de.error.log;
|
||||||
|
|
||||||
|
# location / {
|
||||||
|
# try_files $uri $uri/ =404;
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# location ~ /\.ht {
|
||||||
|
# deny all;
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name i.pki.home c.pki.home;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html/pki;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
#access_log /var/log/nginx/dev.abc.de.access.log;
|
||||||
|
#error_log /var/log/nginx/dev.abc.de.error.log;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
33
nginx/deploy.yaml
Normal file
33
nginx/deploy.yaml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-nfs-webseite
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx-nfs
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx-nfs
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:alpine
|
||||||
|
volumeMounts:
|
||||||
|
- name: web-content
|
||||||
|
mountPath: /usr/share/nginx/html
|
||||||
|
readOnly: true
|
||||||
|
- name: nginx-vhosts
|
||||||
|
mountPath: /etc/nginx/conf.d
|
||||||
|
readOnly: true
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
volumes:
|
||||||
|
- name: web-content
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: nfs-media-nginx
|
||||||
|
- name: nginx-vhosts
|
||||||
|
configMap:
|
||||||
|
name: nginx-vhosts
|
||||||
9
nginx/kustomization.yaml
Normal file
9
nginx/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- cm.yaml
|
||||||
|
- deploy.yaml
|
||||||
|
- pv.yaml
|
||||||
|
- pvc.yaml
|
||||||
|
- svc.yaml
|
||||||
16
nginx/pv.yaml
Normal file
16
nginx/pv.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: nfs-media-nginx
|
||||||
|
spec:
|
||||||
|
storageClassName: nfs-storage
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi # Beachte: NFS ist dynamisch, die Größe ist nur ein Label
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany # Mehrere Pods können es gleichzeitig nutzen
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
path: /mnt/volume1/container/docker/nginx/websites # Der Pfad der NFS-Freigabe auf der NAS
|
||||||
|
server: 192.168.10.1 # Die IP-Adresse deiner NAS
|
||||||
|
mountOptions:
|
||||||
|
- nfsvers=4 # Passe ggf. an (nfsvers=3 falls nötig)
|
||||||
11
nginx/pvc.yaml
Normal file
11
nginx/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: nfs-media-nginx
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadOnlyMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
volumeName: nfs-media-nginx
|
||||||
12
nginx/svc.yaml
Normal file
12
nginx/svc.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: nginx-nfs
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 80
|
||||||
|
type: ClusterIP
|
||||||
Reference in New Issue
Block a user