Commit 4a76ca89 authored by Radu Carpa's avatar Radu Carpa
Browse files

daemons & servers: add helm install hook to generate fts proxy

add a job which will run on helm install and generate the initial
proxy from the longproxy. This way, containers could start after
installation without failing because of missing 509 proxy.

I factorize the job spec into a template and use it in both
cronjob and install hook (job).
parent 455774ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
name: rucio-daemons
version: 1.27.5
version: 1.27.6
apiVersion: v1
description: A Helm chart to deploy daemons for Rucio
keywords:
+75 −55
Original line number Diff line number Diff line
{{- if .Values.ftsRenewal.enabled -}}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ .Release.Name }}-renew-fts-proxy
spec:
  schedule: "{{ .Values.ftsRenewal.schedule }}"
  jobTemplate:
    spec:
      template:
        spec:
{{- define "rucio-servers.renew-fts-proxy-jobspec" }}
{{- if .Values.ftsRenewal.enabled }}
  serviceAccountName: {{ .Release.Name }}-rucio-edit
  volumes:
  {{- if or (eq .Values.ftsRenewal.vo "atlas") (eq .Values.ftsRenewal.vo "dteam") }}
@@ -64,4 +55,33 @@ spec:
          value: {{ .Values.ftsRenewal.longProxy | quote }}
  {{- end }}
  restartPolicy: OnFailure
{{- end }}
{{- end }}

{{- if .Values.ftsRenewal.enabled -}}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ .Release.Name }}-renew-fts-proxy
spec:
  schedule: "{{ .Values.ftsRenewal.schedule }}"
  jobTemplate:
    spec:
      template:
        spec:
          {{- include "rucio-servers.renew-fts-proxy-jobspec" . | indent 8 }}
---
# Also run the cronjob as a one-time job on installation. To perform the first initialization of proxies
apiVersion: batch/v1
kind: Job
metadata:
  name: {{ .Release.Name }}-renew-fts-proxy-on-helm-install
  annotations:
    helm.sh/hook: pre-install
    helm.sh/hook-delete-policy: hook-succeeded
spec:
  template:
    spec:
      {{- include "rucio-servers.renew-fts-proxy-jobspec" . | indent 4 }}
{{ end }}
+1 −1
Original line number Diff line number Diff line
name: rucio-server
version: 1.27.4
version: 1.27.5
apiVersion: v1
description: A Helm chart to deploy servers for Rucio
keywords:
+75 −55
Original line number Diff line number Diff line
{{- if .Values.ftsRenewal.enabled -}}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ .Release.Name }}-renew-fts-proxy
spec:
  schedule: "{{ .Values.ftsRenewal.schedule }}"
  jobTemplate:
    spec:
      template:
        spec:
{{- define "rucio-daemons.renew-fts-proxy-jobspec" }}
{{- if .Values.ftsRenewal.enabled }}
  serviceAccountName: {{ .Release.Name }}-rucio-edit
  volumes:
  {{- if or (eq .Values.ftsRenewal.vo "atlas") (eq .Values.ftsRenewal.vo "dteam") }}
@@ -64,4 +55,33 @@ spec:
          value: {{ .Values.ftsRenewal.longProxy | quote }}
  {{- end }}
  restartPolicy: OnFailure
{{- end }}
{{- end }}

{{- if .Values.ftsRenewal.enabled -}}
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ .Release.Name }}-renew-fts-proxy
spec:
  schedule: "{{ .Values.ftsRenewal.schedule }}"
  jobTemplate:
    spec:
      template:
        spec:
          {{- include "rucio-daemons.renew-fts-proxy-jobspec" . | indent 8 }}
---
# Also run the cronjob as a one-time job on installation. To perform the first initialization of proxies
apiVersion: batch/v1
kind: Job
metadata:
  name: {{ .Release.Name }}-renew-fts-proxy-on-helm-install
  annotations:
    helm.sh/hook: pre-install
    helm.sh/hook-delete-policy: hook-succeeded
spec:
  template:
    spec:
      {{- include "rucio-daemons.renew-fts-proxy-jobspec" . | indent 4 }}
{{ end }}