-
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.
NIT-1229 fetching values from helm release
- Loading branch information
1 parent
0ab559a
commit 79ed1d6
Showing
2 changed files
with
45 additions
and
6 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Scale down Lower Environments | |
|
||
on: | ||
schedule: | ||
- cron: '15 10 * * *' | ||
- cron: '00 19 * * *' | ||
|
||
jobs: | ||
scale-down: | ||
|
@@ -21,6 +21,12 @@ jobs: | |
with: | ||
version: 'v1.26.0' # default is latest stable | ||
id: kubectl_install | ||
|
||
- name: Install Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: 'v3.9.0' | ||
id: helm_install | ||
|
||
- name: Scale Down Deployments in ${{ matrix.environment }} | ||
env: | ||
|
@@ -36,6 +42,11 @@ jobs: | |
kubectl config set-context ${KUBE_CLUSTER} --cluster=${KUBE_CLUSTER} --user=deploy-user --namespace=${KUBE_NAMESPACE} | ||
kubectl config use-context ${KUBE_CLUSTER} | ||
kubectl config set-context --current --namespace=${KUBE_NAMESPACE} | ||
kubectl config set-context --current --namespace=${KUBE_NAMESPACE} | ||
kubectl scale deployment -all --replicas=0 | ||
RELEASE_NAME="alfresco-content-services" | ||
DEPLOYMENTS=$(helm get manifest $RELEASE_NAME | kubectl get -f - --no-headers=true | awk '/deployment/{print $1}') | ||
for deployment in $DEPLOYMENTS; do | ||
kubectl scale $deployment --replicas=0 | ||
done |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Scale down Lower Environments | |
|
||
on: | ||
schedule: | ||
- cron: '22 10 * * *' | ||
- cron: '0 7 * * *' | ||
|
||
jobs: | ||
scale-up: | ||
|
@@ -21,6 +21,19 @@ jobs: | |
with: | ||
version: 'v1.26.0' # default is latest stable | ||
id: kubectl_install | ||
|
||
- name: Install Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: 'v3.9.0' | ||
id: helm_install | ||
|
||
- name: Install yq | ||
uses: dcarbone/[email protected] | ||
with: | ||
download-compressed: true | ||
version: "v4.35.1" | ||
force: true | ||
|
||
- name: Scale up Deployments in ${{ matrix.environment }} | ||
env: | ||
|
@@ -34,5 +47,20 @@ jobs: | |
kubectl config set-context ${KUBE_CLUSTER} --cluster=${KUBE_CLUSTER} --user=deploy-user --namespace=${KUBE_NAMESPACE} | ||
kubectl config use-context ${KUBE_CLUSTER} | ||
kubectl config set-context --current --namespace=${KUBE_NAMESPACE} | ||
kubectl scale deployment -all --replicas=1 | ||
kubectl config set-context --current --namespace=${KUBE_NAMESPACE} | ||
RELEASE_NAME="alfresco-content-services" | ||
LATEST_REVISION=$(helm history "$RELEASE_NAME" --max 1 -o yaml | yq '.[0].revision') | ||
LATEST_VALUES=$(helm get values "$RELEASE_NAME" --revision "$LATEST_REVISION") | ||
kubectl scale deployment alfresco-content-services-alfresco-cs-repository --replicas=$(echo $LATEST_VALUES | yq '.repository.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-cs-share --replicas=$(echo $LATEST_VALUES | yq '.share.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-activemq --replicas=$(echo $LATEST_VALUES | yq '.activemq.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-cs-imagemagick --replicas=$(echo $LATEST_VALUES | yq '.imagemagick.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-cs-libreoffice --replicas=$(echo $LATEST_VALUES | yq '.libreoffice.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-cs-pdfrenderer --replicas=$(echo $LATEST_VALUES | yq '.pdfrenderer.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-cs-tika --replicas=$(echo $LATEST_VALUES | yq '.tika.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-cs-transform-misc --replicas=$(echo $LATEST_VALUES | yq '.transformmisc.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-filestore --replicas=$(echo $LATEST_VALUES | yq '.filestore.replicaCount // 0') | ||
kubectl scale deployment alfresco-content-services-alfresco-router --replicas=$(echo $LATEST_VALUES | yq '.transformrouter.replicaCount // 1') | ||
kubectl scale deployment alfresco-content-services-alfresco-search-solr --replicas=$(echo $LATEST_VALUES | yq '.share.replicaCount // 1') |