From 539cf5de4ffc260913eb58cdc35e4d32a688ab82 Mon Sep 17 00:00:00 2001 From: Aarushi Date: Thu, 25 Jul 2024 22:22:40 +0100 Subject: [PATCH] helm lint --- .github/workflows/autogpt-infra-ci.yml | 21 +++++++++++++++++++ .../helm/autogpt-server/templates/NOTES.txt | 8 +++---- rnd/infra/helm/autogpt-server/values.yaml | 11 ++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autogpt-infra-ci.yml b/.github/workflows/autogpt-infra-ci.yml index 2605cd02de..6e2f2dffbd 100644 --- a/.github/workflows/autogpt-infra-ci.yml +++ b/.github/workflows/autogpt-infra-ci.yml @@ -23,6 +23,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: TFLint uses: pauloconnor/tflint-action@v0.0.2 env: @@ -31,3 +32,23 @@ jobs: tflint_path: terraform/ tflint_recurse: true tflint_changed_only: false + + - name: Set up Helm + uses: azure/setup-helm@v4.2.0 + with: + version: v3.14.4 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.7.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} diff --git a/rnd/infra/helm/autogpt-server/templates/NOTES.txt b/rnd/infra/helm/autogpt-server/templates/NOTES.txt index 01105181f4..2b660011ad 100644 --- a/rnd/infra/helm/autogpt-server/templates/NOTES.txt +++ b/rnd/infra/helm/autogpt-server/templates/NOTES.txt @@ -6,16 +6,16 @@ {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "autogpt_server.fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "autogpt-server.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "autogpt_server.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "autogpt_server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "autogpt-server.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "autogpt-server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "autogpt_server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "autogpt-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT diff --git a/rnd/infra/helm/autogpt-server/values.yaml b/rnd/infra/helm/autogpt-server/values.yaml index 80797575df..037b278312 100644 --- a/rnd/infra/helm/autogpt-server/values.yaml +++ b/rnd/infra/helm/autogpt-server/values.yaml @@ -74,3 +74,14 @@ tolerations: [] affinity: {} domain: "" + +cloudSqlProxy: + image: + repository: gcr.io/cloud-sql-connectors/cloud-sql-proxy + tag: 2.11.4 + instanceConnectionName: "" + port: 5432 + resources: + requests: + memory: "2Gi" + cpu: "1"