Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deployments): fix volume mounts for GKE and add validation tests #1284

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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