jenkins: harden oidc and timeouts
This commit is contained in:
parent
4e479147ec
commit
f512e0fa29
@ -15,13 +15,17 @@ spec:
|
|||||||
name: jenkins
|
name: jenkins
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
install:
|
install:
|
||||||
|
timeout: 15m
|
||||||
remediation:
|
remediation:
|
||||||
retries: 3
|
retries: 3
|
||||||
upgrade:
|
upgrade:
|
||||||
|
timeout: 15m
|
||||||
remediation:
|
remediation:
|
||||||
retries: 3
|
retries: 3
|
||||||
remediateLastFailure: true
|
remediateLastFailure: true
|
||||||
cleanupOnFail: true
|
cleanupOnFail: true
|
||||||
|
rollback:
|
||||||
|
timeout: 15m
|
||||||
values:
|
values:
|
||||||
controller:
|
controller:
|
||||||
jenkinsUrl: https://ci.bstein.dev
|
jenkinsUrl: https://ci.bstein.dev
|
||||||
@ -90,6 +94,7 @@ spec:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
rm -f /var/jenkins_home/casc_configs/*.yaml || true
|
rm -f /var/jenkins_home/casc_configs/*.yaml || true
|
||||||
securityContext:
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
runAsGroup: 1000
|
runAsGroup: 1000
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
@ -110,8 +115,7 @@ spec:
|
|||||||
}
|
}
|
||||||
def required = ['OIDC_CLIENT_ID','OIDC_CLIENT_SECRET','OIDC_ISSUER']
|
def required = ['OIDC_CLIENT_ID','OIDC_CLIENT_SECRET','OIDC_ISSUER']
|
||||||
if (!required.every { env[it] }) {
|
if (!required.every { env[it] }) {
|
||||||
println("OIDC enabled but missing vars: ${required.findAll { !env[it] }}")
|
throw new IllegalStateException("OIDC enabled but missing vars: ${required.findAll { !env[it] }}")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
def wellKnown = "${env['OIDC_ISSUER']}/.well-known/openid-configuration"
|
def wellKnown = "${env['OIDC_ISSUER']}/.well-known/openid-configuration"
|
||||||
@ -143,6 +147,7 @@ spec:
|
|||||||
println("Configured OIDC realm from init script (well-known)")
|
println("Configured OIDC realm from init script (well-known)")
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
println("Failed to configure OIDC realm: ${e}")
|
println("Failed to configure OIDC realm: ${e}")
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
JCasC:
|
JCasC:
|
||||||
configScripts:
|
configScripts:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user