[skip-ci] Rename folders to c4k-website

This commit is contained in:
erik 2022-09-09 11:17:57 +02:00
parent 1252a4b491
commit 7e006a4780
13 changed files with 54 additions and 47 deletions

View file

@ -39,12 +39,12 @@ nginx-config -> wie
serviceType: LoadBalancer
PVC + volume-mount zeigt auf website-data-vol
**Terraform:**
FQDNs für verschiedene Websites hinzufügen?
Verbindung mit c4k?
c4k-Modulname als Teil des FQDNs wird später noch problematisch.
_Frage_ kann pyb apply nur einen FQDN?
Falls ja, wie könnte das Ausschauen?
Will ich einen Cluster haben, auf dem mit Deployments neue Pods/Webserver installiert werden, die sich dann aus festgelegten pfaden ihren content holen?
### Reading:

View file

@ -1,36 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: default
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
protocol: TCP
envFrom:
- configMapRef:
name: nginx-env
volumeMounts:
- name: website-data-volume
mountPath: "/data"
volumes:
- name: website-data-volume
persistentVolumeClaim:
claimName: website-data-pvc

View file

@ -1,7 +1,7 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: website-data-pvc
name: website-content-pvc
namespace: default
labels:
app: website

View file

@ -1,6 +1,7 @@
# ToDo:
# content-pfad für nginx server definieren
# sinnvolle security policies konfigurieren
# link nginx.conv und virtualhost.conv verstehen
apiVersion: v1
kind: ConfigMap
@ -40,17 +41,20 @@ data:
include /etc/nginx/virtualhost/virtualhost.conf;
}
virtualhost.conf: |
upstream app {
server localhost:8080;
upstream NAME {
server FQDN;
keepalive 1024;
}
server {
listen 80 default_server;
root /usr/local/app;
access_log /var/log/nginx/app.access_log main;
error_log /var/log/nginx/app.error_log;
root WEBSITECONTENTPATH;
access_log /var/log/nginx/NAME.access_log main; #ToDo: change this
error_log /var/log/nginx/NAME.error_log;
location / {
proxy_pass http://app/;
proxy_pass http://NAME/; #ToDo: change this, how does proxy_pass work?
proxy_http_version 1.1;
}
}

View file

@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx # mount nginx-conf volumn to /etc/nginx
readOnly: true
name: nginx-conf
- mountPath: /var/log/nginx
name: log
- mountPath: WEBSITECONTENTPATH
name: website-content-volume
volumes:
- name: nginx-conf
configMap:
name: nginx-conf # place ConfigMap `nginx-conf` on /etc/nginx
items:
- key: nginx.conf
path: nginx.conf
- key: virtualhost.conf
path: virtualhost/virtualhost.conf # dig directory
- name: log
emptyDir: {}
- name: website-content-volume
persistentVolumeClaim:
claimName: website-content-pvc