You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.5 KiB
38 lines
1.5 KiB
{{- if .Values.portal.createAndUpgrade }}
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: {{ include "portalmodelo.fullname" . }}-plone-scaleup
|
|
labels:
|
|
{{- include "portalmodelo.labels" . | nindent 4 }}
|
|
annotations:
|
|
"helm.sh/hook": post-install,post-upgrade
|
|
"helm.sh/hook-weight": "1"
|
|
"helm.sh/hook-delete-policy": "hook-succeeded"
|
|
spec:
|
|
backoffLimit: 5
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "portalmodelo.labels" . | nindent 8 }}
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
serviceAccountName: {{ include "portalmodelo.fullname" . }}-scaleup
|
|
containers:
|
|
- name: kubectl
|
|
image: alpine/k8s:1.31.5
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
echo "Waiting for plonecfg job to complete..."
|
|
kubectl wait --for=condition=complete --timeout=600s job/{{ include "portalmodelo.fullname" . }}-plonecfg -n {{ .Release.Namespace }}
|
|
|
|
echo "Scaling up plone deployment to {{ .Values.instance.replicaCount }} replicas..."
|
|
kubectl scale deployment/{{ include "portalmodelo.fullname" . }}-plone --replicas={{ .Values.instance.replicaCount }} -n {{ .Release.Namespace }}
|
|
|
|
echo "Waiting for deployment to be ready..."
|
|
kubectl rollout status deployment/{{ include "portalmodelo.fullname" . }}-plone -n {{ .Release.Namespace }}
|
|
|
|
echo "Plone deployment scaled up successfully!"
|
|
{{- end }}
|
|
|