Skip to content

Commit

Permalink
Merge pull request #1284 from DelusionalOptimist/helm-gke-values
Browse files Browse the repository at this point in the history
chore(deployments): fix volume mounts for GKE and add validation tests
  • Loading branch information
daemon1024 authored Jun 27, 2023
2 parents 7155df8 + 4fb3427 commit ddbf60e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Commit updated chart to main
run: |
STABLE_VERSION=`cat STABLE-RELEASE`
git add .
git add deployments/helm/Chart.yaml
git config user.name $GITHUB_ACTOR
git config user.email [email protected]
git commit -m "[Automated] Update Helm Chart To $STABLE_VERSION" --signoff
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/ci-test-helm-charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ci-test-helm-charts

on:
push:
branches: [main]
paths:
- "deployments/helm/**"
- ".github/workflows/ci-test-helm-charts.yml"
pull_request:
branches: [main]
paths:
- "deployments/helm/**"
- ".github/workflows/ci-test-helm-charts.yml"

jobs:
lint:
name: Helm Chart Tests / ubuntu 20.04
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v3
with:
submodules: true

- uses: actions/setup-go@v3
with:
go-version: "v1.20"

- uses: azure/setup-helm@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: helm lint
run: |
helm lint ./deployments/helm
- name: Validate helm environment template values
run: |
./.github/workflows/helm-validate-values.sh
19 changes: 19 additions & 0 deletions .github/workflows/helm-validate-values.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Authors of KubeArmor

envs=("docker" "crio" "k3s" "microk8s" "minikube" "GKE" "BottleRocket" "EKS" "generic")

echo "Testing environment specific helm templates..."
for env in ${envs[@]}; do
echo "Generating templates for $env..."
helm template kubearmor ./deployments/helm --set environment.name=$env > $env.yml
if [[ "$?" -eq 1 ]]
then
echo "Failed to generate template for $env!"
exit 1
fi
rm -rf $env.yml
done

echo "Validated environment specific templates!"
2 changes: 1 addition & 1 deletion deployments/helm/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
{{- else if eq .Values.environment.name "minikube" }}
{{- toYaml .Values.kubearmor.volumeMountsMinikube | trim | nindent 10 }}
{{- else if eq .Values.environment.name "GKE" }}
{{- toYaml .Values.kubearmor.volumeMountsGke | trim | nindent 10 }}
{{- toYaml .Values.kubearmor.volumeMountsGKE | trim | nindent 10 }}
{{- else if eq .Values.environment.name "BottleRocket" }}
{{- toYaml .Values.kubearmor.volumeMountsBottleRocket | trim | nindent 10 }}
{{- else if eq .Values.environment.name "EKS" }}
Expand Down
2 changes: 1 addition & 1 deletion deployments/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ kubearmor:
type: DirectoryOrCreate
name: crio-storage-path

volumesMicrok8s:
volumesMicroK8s:
- hostPath:
path: /usr/src
type: Directory
Expand Down

0 comments on commit ddbf60e

Please sign in to comment.