From 5e6f102ef2a8291b54002decf6a8528d9d5d26b2 Mon Sep 17 00:00:00 2001 From: Szymon Richert Date: Wed, 15 Jun 2022 14:44:11 +0200 Subject: [PATCH] Add terminationGracePeriodSeconds and setup helm lint in pipeline --- .github/workflows/main.yml | 6 ++++++ Dockerfile | 2 +- chart/gha-runner/templates/deployment.yaml | 3 ++- chart/gha-runner/values.yaml | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5cbca9b..4565cd8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,6 +51,12 @@ jobs: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + - name: Lint helm chart + run: | + set -e + + helm lint chart/${CHART_NAME} + - name: Update metadata files run: | set -e diff --git a/Dockerfile b/Dockerfile index d420612..741b3ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN set -xe;\ python3-pip;\ apt-get clean;\ rm -rf /var/lib/apt/lists/*;\ - pip3 install ruamel.yaml requests;\ + pip3 install ruamel.yaml requests ansible;\ useradd -m github;\ usermod -aG sudo github;\ echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers;\ diff --git a/chart/gha-runner/templates/deployment.yaml b/chart/gha-runner/templates/deployment.yaml index d8ead51..4577bbb 100644 --- a/chart/gha-runner/templates/deployment.yaml +++ b/chart/gha-runner/templates/deployment.yaml @@ -17,7 +17,7 @@ spec: annotations: {{- toYaml . | nindent 8 }} {{- end }} - labels: + labels: {{- include "gha-runner.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} @@ -27,6 +27,7 @@ spec: serviceAccountName: {{ include "gha-runner.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} securityContext: diff --git a/chart/gha-runner/values.yaml b/chart/gha-runner/values.yaml index 00c3491..55da4f5 100644 --- a/chart/gha-runner/values.yaml +++ b/chart/gha-runner/values.yaml @@ -4,6 +4,8 @@ replicaCount: 1 +terminationGracePeriodSeconds: 600 + config: githubPersonalToken: "" githubOwner: "szymonrychu"