forked from dmwm/CMSKubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new cronjob for fixing certificates issues.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM registry.cern.ch/cmsweb/pypi/alma-base:alma9-20240305 | ||
RUN dnf -y update && dnf -y install epel-release \ | ||
dnf -y install fetch-crl ca-certificates | ||
|
||
COPY update-crl.sh /usr/local/bin/update-crl.sh | ||
RUN chmod +x /usr/local/bin/update-crl.sh | ||
|
||
CMD ["update-crl.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# Run fetch-crl to update CRLs | ||
/usr/sbin/fetch-crl | ||
|
||
# Copy updated CRLs to the appropriate directory | ||
cp /etc/grid-security/*.pem /host/etc/grid-security/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: fetch-crl-cronjob | ||
namespace: auth | ||
labels: | ||
jobgroup: parallel | ||
spec: | ||
schedule: "0 0 * * *" # Runs daily at midnight | ||
successfulJobsHistoryLimit: 1 | ||
failedJobsHistoryLimit: 1 | ||
jobTemplate: | ||
spec: | ||
parallelism: 1 # Ensures one pod runs at a time | ||
completions: 1 # Ensures each job runs to completion | ||
template: | ||
metadata: | ||
labels: | ||
jobgroup: parallel | ||
spec: | ||
containers: | ||
- name: fetch-crl | ||
image: registry.cern.ch/cmsweb/fetch-crl:latest | ||
imagePullPolicy: Always | ||
command: ["/usr/local/bin/update-crl.sh"] | ||
volumeMounts: | ||
- name: etc-grid-security | ||
mountPath: /host/etc/grid-security | ||
restartPolicy: OnFailure | ||
terminationGracePeriodSeconds: 30 | ||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
topologyKey: kubernetes.io/hostname | ||
whenUnsatisfiable: DoNotSchedule | ||
labelSelector: | ||
matchLabels: | ||
jobgroup: parallel | ||
volumes: | ||
- name: etc-grid-security | ||
hostPath: | ||
path: /etc/grid-security | ||
type: Directory | ||
concurrencyPolicy: Allow | ||
|