[nginx/certbot] finish!

This commit is contained in:
Nico Schottelius 2021-06-18 23:42:15 +02:00
commit 659e445f04
8 changed files with 229 additions and 73 deletions

View file

@ -25,46 +25,6 @@ spec:
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tls1-http
spec:
selector:
matchLabels:
app: tls1-nginx
ssl: no
replicas: 1
template:
metadata:
labels:
app: tls1-nginx
ssl: no
spec:
containers:
- name: nginx-80
image: nginx:1.20.0-alpine
ports:
- containerPort: 80
volumeMounts:
- name: nginx-config-80
mountPath: "/etc/nginx/conf.d/"
- name: etcletsencrypt
mountPath: "/etc/letsencrypt"
- name: webroot
mountPath: "/usr/share/nginx/html"
volumes:
- name: nginx-config-80
configMap:
name: nginx-80-config
- name: etcletsencrypt
persistentVolumeClaim:
claimName: tls1-letsencrypt-certs
- name: webroot
persistentVolumeClaim:
claimName: tls1-webroot
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tls1-https
spec:
@ -81,8 +41,9 @@ spec:
spec:
containers:
- name: nginx-443
image: nginx:1.20.0-alpine
image: nginx:1.21.0-alpine
ports:
- containerPort: 80
- containerPort: 443
volumeMounts:
- name: nginx-config-443
@ -125,11 +86,16 @@ metadata:
name: tls1-getcert
spec:
template:
metadata:
labels:
app: tls1-nginx
spec:
restartPolicy: Never
containers:
- name: certbot
image: ungleich/ungleich-certbot
ports:
- containerPort: 80
command:
- certbot
- certonly
@ -140,22 +106,14 @@ spec:
- sre@ungleich.ch
- --expand
- --non-interactive
- --webroot
- --webroot-path
- /usr/share/nginx/html
- --domain
- 'tls1.default.svc.c2.k8s.ooo'
# - --staging
- --standalone
volumeMounts:
- name: etcletsencrypt
mountPath: "/etc/letsencrypt"
- name: webroot
mountPath: "/usr/share/nginx/html"
volumes:
- name: etcletsencrypt
persistentVolumeClaim:
claimName: tls1-letsencrypt-certs
- name: webroot
persistentVolumeClaim:
claimName: tls1-webroot
backoffLimit: 3

View file

@ -1,9 +1,7 @@
configMapGenerator:
- name: nginx-80-config
files:
- default.conf=nginx-80
- name: nginx-443-config
files:
- default.conf=nginx-443
- http.conf=nginx-80
resources:
- deployment.yaml

View file

@ -1,20 +0,0 @@
server {
listen *:443 ssl http2;
listen [::]:443 ssl http2;
server_name www.schottelius.org;
access_log /home/services/www/nico/www.schottelius.org/logs/access.log;
ssl_certificate /etc/letsencrypt/live/www.schottelius.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.schottelius.org/privkey.pem;
index index.html index.htm;
location / {
root /home/services/www/nico/www.schottelius.org/www;
autoindex on;
}
}