Skip to content

Commit

Permalink
add: ingress + cert
Browse files Browse the repository at this point in the history
  • Loading branch information
Saturn-V committed Jan 26, 2024
1 parent 6ae93e4 commit 771635c
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ tobi
# Smokeping changes

## TODO
- enable our docker image to accept volume mounts for `config/config` so users of our image can provide their own configuration file or customise the default configuration file.
- enable our docker image to accept volume mounts for `config/config` so users of our image can provide their own configuration file or customise the default configuration file
- redirect / to /smokeping/smokeping.fcgi.dist

## NOTES
- followed https://atetux.com/how-to-build-and-install-latest-smokeping-on-ubuntu-20-04 as a base to creating this docker image

## Smokeping configuration defaults
A default smokeping configuration can be found in `config/config`.
Expand Down
4 changes: 2 additions & 2 deletions config/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** General ***
owner = Atetux
contact = hello.darling@atetux.com
owner = sjultra
contact = alex+smokeping.ops@sjultra.com
mailhost = my.mail.host
imgcache = /usr/local/smokeping/cache
imgurl = cache
Expand Down
5 changes: 4 additions & 1 deletion config/smokeping.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Alias /smokeping/cache /usr/local/smokeping/cache
Alias /smokeping /usr/local/smokeping/htdocs/
Alias / /usr/local/smokeping/htdocs/smokeping.fcgi.dist


<Directory "/usr/local/smokeping/cache">
Expand All @@ -11,4 +12,6 @@ Alias /smokeping /usr/local/smokeping/htdocs/
Options FollowSymLinks ExecCGI
AllowOverride all
Require all granted
</Directory>
</Directory>

RedirectMatch 301 ^/$ /smokeping/smokeping.fcgi.dist
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
dockerfile: ./docker/Dockerfile
volumes:
- ./config/config:/usr/local/smokeping/etc/config
- ./config/smokeping.conf:/etc/apache2/conf-available/smokeping.conf
- ./data:/data
ports:
- 8080:80
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ RUN echo "**** configure Smokeping GUI ****"
RUN chown www-data:www-data -R /usr/local/smokeping
RUN chmod 777 /usr/local/smokeping
COPY ./config/smokeping.conf /etc/apache2/conf-available/smokeping.conf
VOLUME /etc/apache2/conf-available

RUN a2enconf smokeping
RUN a2enmod cgi
Expand Down
12 changes: 12 additions & 0 deletions helm/service/templates/cert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ .Values.issuer.secretName }}
namespace: smokeping
spec:
secretName: {{ .Values.issuer.secretName }}
issuerRef:
name: smokeping-issuer
commonName: {{ .Values.ingress.ingressDomain }}
dnsNames:
- {{ .Values.ingress.ingressDomain }}
24 changes: 24 additions & 0 deletions helm/service/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: smokeping-ingress
annotations:
kubernetes.io/ingress.class: "traefik"
cert-manager.io/issuer: "smokeping-issuer"
traefik.ingress.kubernetes.io/redirect-entry-point: "https"
spec:
rules:
- host: {{ .Values.ingress.ingressDomain }}
http:
paths:
- backend:
service:
name: smokeping
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- {{ .Values.ingress.ingressDomain }}
secretName: {{ .Values.issuer.secretName }}
17 changes: 17 additions & 0 deletions helm/service/templates/issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.issuer }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: smokeping-issuer
namespace: smokeping
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: {{ .Values.issuer.issuerEmail }}
privateKeySecretRef:
name: {{ .Values.issuer.privateKeyName }}
solvers:
- http01:
ingress:
class: traefik
{{- end }}
7 changes: 7 additions & 0 deletions helm/service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ smokeping:
image: sjultra/smokeping:latest
port: 8080

issuer:
issuerEmail: ops@sjultra.com
secretName: smokeping-tls-prod
privateKeyName: smokeping-tls-pkey-prod

ingress:
ingressDomain: smokepingkube.vzxy.net

0 comments on commit 771635c

Please sign in to comment.