jenkins: redirect plain HTTP requests to HTTPS
This commit is contained in:
parent
8e0e29b445
commit
5f84adbf29
@ -277,7 +277,13 @@ OOM restarts, sustained memory pressure and Jenkins controller unavailability.
|
||||
These rules reach Alertmanager's existing silent default receiver; email routing
|
||||
remains limited to the previously configured Hermes alerts.
|
||||
|
||||
For a repeat report, compare `https://ci.bstein.dev/login` with `/login` inside
|
||||
Jenkins also has an HTTP-only ingress with `jenkins-https-redirect` middleware.
|
||||
It redirects `http://ci.bstein.dev/` to HTTPS, preserving paths and query strings.
|
||||
The HTTPS ingress alone does not match plain HTTP: without the separate route,
|
||||
typing the hostname can return Traefik's plain-text 404 even while HTTPS is healthy.
|
||||
|
||||
For a repeat report, check both `http://ci.bstein.dev/` and
|
||||
`https://ci.bstein.dev/login`, compare `/login` inside
|
||||
the Jenkins container, then check the SSO redirect at
|
||||
`https://ci.bstein.dev/securityRealm/commenceLogin`. Inspect Traefik pod termination
|
||||
reasons, `/ping`, `traefik_open_connections` and memory before restarting Jenkins.
|
||||
|
||||
23
services/jenkins/ingress-http.yaml
Normal file
23
services/jenkins/ingress-http.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
# services/jenkins/ingress-http.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: jenkins-http
|
||||
namespace: jenkins
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||
traefik.ingress.kubernetes.io/router.tls: "false"
|
||||
traefik.ingress.kubernetes.io/router.middlewares: jenkins-jenkins-https-redirect@kubernetescrd
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: ci.bstein.dev
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: jenkins
|
||||
port:
|
||||
name: http
|
||||
@ -17,6 +17,8 @@ resources:
|
||||
- vault-sync-deployment.yaml
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- middleware-https-redirect.yaml
|
||||
- ingress-http.yaml
|
||||
- ingress.yaml
|
||||
- lesavka-userns-probe.yaml
|
||||
- lesavka-kvm-device-plugin.yaml
|
||||
|
||||
10
services/jenkins/middleware-https-redirect.yaml
Normal file
10
services/jenkins/middleware-https-redirect.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
# services/jenkins/middleware-https-redirect.yaml
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: jenkins-https-redirect
|
||||
namespace: jenkins
|
||||
spec:
|
||||
redirectScheme:
|
||||
scheme: https
|
||||
permanent: true
|
||||
Loading…
x
Reference in New Issue
Block a user