diff --git a/job-reportportal-migrations.yaml b/job-reportportal-migrations.yaml new file mode 100644 index 0000000..3f86802 --- /dev/null +++ b/job-reportportal-migrations.yaml @@ -0,0 +1,92 @@ +apiVersion: batch/v1 +kind: Job +metadata: + annotations: + meta.helm.sh/release-name: reportportal + meta.helm.sh/release-namespace: default + creationTimestamp: "2024-08-27T15:53:50Z" + generation: 1 + labels: + app: reportportal + app.kubernetes.io/managed-by: Helm + chart: reportportal-24.1.3 + heritage: Helm + release: reportportal + name: reportportal-migrations + namespace: default + resourceVersion: "13045" + uid: 717a0c3a-ff59-426f-9c7a-280b4fb77938 +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + manualSelector: false + parallelism: 1 + podReplacementPolicy: TerminatingOrFailed + selector: + matchLabels: + batch.kubernetes.io/controller-uid: 717a0c3a-ff59-426f-9c7a-280b4fb77938 + suspend: false + template: + metadata: + creationTimestamp: null + labels: + batch.kubernetes.io/controller-uid: 717a0c3a-ff59-426f-9c7a-280b4fb77938 + batch.kubernetes.io/job-name: reportportal-migrations + component: reportportal-migrations + controller-uid: 717a0c3a-ff59-426f-9c7a-280b4fb77938 + job-name: reportportal-migrations + spec: + containers: + - env: + - name: POSTGRES_SSLMODE + value: disable + - name: POSTGRES_SERVER + value: reportportal-postgresql.default.svc.cluster.local + - name: POSTGRES_DB + value: reportportal + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_USER + value: postgres + - name: POSTGRES_PASSWORD + value: rppassword + - name: OS_HOST + value: opensearch-cluster-master.default.svc.cluster.local + - name: OS_PORT + value: "9200" + - name: OS_PROTOCOL + value: http + - name: OS_USER + - name: OS_PASSWORD + image: reportportal/migrations:5.11.1 + imagePullPolicy: Always + name: migrations + resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + serviceAccount: reportportal + serviceAccountName: reportportal + terminationGracePeriodSeconds: 30 +status: + completionTime: "2024-08-27T15:53:57Z" + conditions: + - lastProbeTime: "2024-08-27T15:53:57Z" + lastTransitionTime: "2024-08-27T15:53:57Z" + status: "True" + type: Complete + ready: 0 + startTime: "2024-08-27T15:53:50Z" + succeeded: 1 + terminating: 0 + uncountedTerminatedPods: {} diff --git a/reportportal/templates/tests/readiness-test.yaml b/reportportal/templates/hooks/tests/readiness-test.yaml similarity index 93% rename from reportportal/templates/tests/readiness-test.yaml rename to reportportal/templates/hooks/tests/readiness-test.yaml index d81aafa..a63e8ca 100644 --- a/reportportal/templates/tests/readiness-test.yaml +++ b/reportportal/templates/hooks/tests/readiness-test.yaml @@ -1,3 +1,4 @@ +{{- if and .Values.hooks.enabled .Values.hooks.test.enabled }} apiVersion: v1 kind: Pod metadata: @@ -31,3 +32,4 @@ spec: done; echo "All health checks passed."; restartPolicy: Never +{{- end }} \ No newline at end of file diff --git a/reportportal/templates/hooks/pre-upgrade-hook.yaml b/reportportal/templates/hooks/upgrade/pre-upgrade-cleanup.yaml similarity index 78% rename from reportportal/templates/hooks/pre-upgrade-hook.yaml rename to reportportal/templates/hooks/upgrade/pre-upgrade-cleanup.yaml index cb97ab5..93d9c4c 100644 --- a/reportportal/templates/hooks/pre-upgrade-hook.yaml +++ b/reportportal/templates/hooks/upgrade/pre-upgrade-cleanup.yaml @@ -1,7 +1,8 @@ +{{- if and .Values.hooks.enabled .Values.hooks.preUpgrade.enabled }} apiVersion: batch/v1 kind: Job metadata: - name: {{ include "reportportal.fullname" . }}-pre-upgrade-delete-job + name: {{ include "reportportal.fullname" . }}-pre-upgrade-cleanup labels: {{ include "labels" . | indent 4 }} annotations: @@ -14,7 +15,7 @@ spec: {{- range $key, $value := .Values.migrations.podLabels }} {{ $key }}: {{ $value | quote }} {{- end }} - component: {{ include "reportportal.fullname" . }}-pre-upgrade-delete-job + component: {{ include "reportportal.fullname" . }}-pre-upgrade-cleanup spec: serviceAccountName: {{ template "reportportal.serviceAccountName" . }} restartPolicy: OnFailure @@ -25,4 +26,5 @@ spec: - /bin/sh - -c - | - kubectl delete job {{ include "reportportal.fullname" . }}-migrations --ignore-not-found=true \ No newline at end of file + kubectl delete job {{ include "reportportal.fullname" . }}-migrations --ignore-not-found=true +{{- end }} \ No newline at end of file diff --git a/reportportal/values.yaml b/reportportal/values.yaml index 5295b35..74054af 100644 --- a/reportportal/values.yaml +++ b/reportportal/values.yaml @@ -813,7 +813,13 @@ extraInitContainers: {} # - "-c" # - "for i in `seq 1 300`; do sleep 1; if wget http://-minio.default.svc.cluster.local:9000/minio/health/live -q -O /dev/null ; then exit 0; fi; done; exit 1" - +## @param hooks Helm 3+ hooks toggles +hooks: + enabled: true + preUpgrade: + enabled: true + test: + enabled: true ## @section External dependencies installation configuration ##