commit e75fa6a1d63f79c96add288f652d66d893e85f85 Author: pierre Date: Wed Jun 19 11:44:07 2024 +0100 :boom: add all the files diff --git a/Certbot_Cron_renew_jobs.yaml b/Certbot_Cron_renew_jobs.yaml new file mode 100644 index 0000000..bfee7b7 --- /dev/null +++ b/Certbot_Cron_renew_jobs.yaml @@ -0,0 +1,40 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: certbot +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: certbotrenew + namespace: certbot +spec: + schedule: "0 0 */15 * *" + jobTemplate: + spec: + ttlSecondsAfterFinished: 100 + template: + spec: + containers: + - name: certbotrenew + image: certbot/certbot:latest + command: ["certbot","renew", "--non-interactive", "--agree-tos", "-m", "franckrobbin6@gmail.com", "--webroot", "--webroot-path", "/var/www/certbot/"] + volumeMounts: + - name: certbot-www + mountPath: /var/www/certbot/ + - name: certbot-conf + mountPath: /etc/letsencrypt/ + - name: letsencrypt-log + mountPath: /var/log/letsencrypt/ + volumes: + - name: certbot-www + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/www/ + - name: certbot-conf + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/conf/ + - name: letsencrypt-log + hostPath: + path: /var/log/letsencrypt/ + restartPolicy: Never + diff --git a/Certbot_Cron_wildcart_jobs.yaml b/Certbot_Cron_wildcart_jobs.yaml new file mode 100644 index 0000000..ee67a51 --- /dev/null +++ b/Certbot_Cron_wildcart_jobs.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: certbot +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: certbotwilcart + namespace: certbot +spec: + schedule: "0 0 */15 * *" + jobTemplate: + spec: + ttlSecondsAfterFinished: 100 + template: + spec: + containers: + - name: certbotwildcart + image: certbot/dns-ovh:latest + command: ["certbot","certonly","--dns-ovh","--dns-ovh-credentials","/secret/ovh.ini","--dns-ovh-propagation-seconds","60","-d","*.tryton.geeraert.eu"] + volumeMounts: + - name: certbot-www + mountPath: /var/www/certbot/ + - name: certbot-conf + mountPath: /etc/letsencrypt/ + - name: letsencrypt-log + mountPath: /var/log/letsencrypt/ + - name: secret-ovh + mountPath: /secret/ + volumes: + - name: certbot-www + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/www/ + - name: certbot-conf + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/conf/ + - name: letsencrypt-log + hostPath: + path: /var/log/letsencrypt/ + #- name: secret-ovh + # hostPath: + # path: /opt/kubernetes/Certbot_jobs/ovh.ini + # type: File + - name: secret-ovh + secret: + secretName: ovh-secret-certbot + restartPolicy: Never + diff --git a/Certbot_manual_certonly.yaml b/Certbot_manual_certonly.yaml new file mode 100644 index 0000000..b7599ed --- /dev/null +++ b/Certbot_manual_certonly.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: certbot +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: certbotcertonly + namespace: certbot +spec: + ttlSecondsAfterFinished: 100 + template: + spec: + containers: + - name: certbotcertonly + image: certbot/certbot:latest + command: ["certbot","certonly", "--non-interactive", "--agree-tos", "-m", "franckrobbin6@gmail.com", "--webroot", "--webroot-path", "/var/www/certbot/","-d", "echo.tryton.geeraert.eu"] + volumeMounts: + - name: certbot-www + mountPath: /var/www/certbot/ + - name: certbot-conf + mountPath: /etc/letsencrypt/ + - name: letsencrypt-log + mountPath: /var/log/letsencrypt/ + volumes: + - name: certbot-www + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/www/ + - name: certbot-conf + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/conf/ + - name: letsencrypt-log + hostPath: + path: /var/log/letsencrypt/ + restartPolicy: Never + backoffLimit: 4 diff --git a/Certbot_manual_renew_jobs.yaml b/Certbot_manual_renew_jobs.yaml new file mode 100644 index 0000000..a906f53 --- /dev/null +++ b/Certbot_manual_renew_jobs.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: certbot +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: certbotrenew + namespace: certbot +spec: + ttlSecondsAfterFinished: 100 + template: + spec: + containers: + - name: certbotrenew + image: certbot/certbot:latest + command: ["certbot","renew", "--non-interactive", "--agree-tos", "-m", "franckrobbin6@gmail.com", "--webroot", "--webroot-path", "/var/www/certbot/"] + volumeMounts: + - name: certbot-www + mountPath: /var/www/certbot/ + - name: certbot-conf + mountPath: /etc/letsencrypt/ + - name: letsencrypt-log + mountPath: /var/log/letsencrypt/ + volumes: + - name: certbot-www + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/www/ + - name: certbot-conf + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/conf/ + - name: letsencrypt-log + hostPath: + path: /var/log/letsencrypt/ + restartPolicy: Never + backoffLimit: 4 diff --git a/Certbot_manual_wildcart.yaml b/Certbot_manual_wildcart.yaml new file mode 100644 index 0000000..f508e50 --- /dev/null +++ b/Certbot_manual_wildcart.yaml @@ -0,0 +1,46 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: certbot +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: certbotwilcart + namespace: certbot +spec: + ttlSecondsAfterFinished: 100 + template: + spec: + containers: + - name: certbotwildcart + image: certbot/dns-ovh:latest + command: ["certbot","certonly","--dns-ovh","--dns-ovh-credentials","/secret/ovh.ini","--dns-ovh-propagation-seconds","60","-d","*.tryton.geeraert.eu"] + volumeMounts: + - name: certbot-www + mountPath: /var/www/certbot/ + - name: certbot-conf + mountPath: /etc/letsencrypt/ + - name: letsencrypt-log + mountPath: /var/log/letsencrypt/ + - name: secret-ovh + mountPath: /secret/ + volumes: + - name: certbot-www + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/www/ + - name: certbot-conf + hostPath: + path: /opt/kubernetes/Reverse_proxy_Nginx/certbot/conf/ + - name: letsencrypt-log + hostPath: + path: /var/log/letsencrypt/ +# - name: secret-ovh +# hostPath: +# path: /opt/kubernetes/Certbot_jobs/ovh.ini +# type: File + - name: secret-ovh + secret: + secretName: ovh-secret-certbot + restartPolicy: Never + backoffLimit: 4 diff --git a/ovh.ini b/ovh.ini new file mode 100644 index 0000000..7b9403e --- /dev/null +++ b/ovh.ini @@ -0,0 +1,5 @@ +# OVH API credentials used by Certbot +dns_ovh_endpoint = ovh-eu +dns_ovh_application_key = '953029e92699383b' +dns_ovh_application_secret = '0c68854dcd6bb8261f11f82ab2314d7e' +dns_ovh_consumer_key = '8cc9c96241d8540a23f665288ecbc6a1' diff --git a/ovh.secret.yaml b/ovh.secret.yaml new file mode 100644 index 0000000..2478e7a --- /dev/null +++ b/ovh.secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +data: + ovh.ini: IyBPVkggQVBJIGNyZWRlbnRpYWxzIHVzZWQgYnkgQ2VydGJvdApkbnNfb3ZoX2VuZHBvaW50ID0gb3ZoLWV1CmRuc19vdmhfYXBwbGljYXRpb25fa2V5ID0gJzk1MzAyOWU5MjY5OTM4M2InCmRuc19vdmhfYXBwbGljYXRpb25fc2VjcmV0ID0gJzBjNjg4NTRkY2Q2YmI4MjYxZjExZjgyYWIyMzE0ZDdlJwpkbnNfb3ZoX2NvbnN1bWVyX2tleSA9ICc4Y2M5Yzk2MjQxZDg1NDBhMjNmNjY1Mjg4ZWNiYzZhMScK +kind: Secret +metadata: + creationTimestamp: null + name: ovh-secret-certbot