Skip to content

Commit

Permalink
Use existing GH Actions to install Kind and Helm
Browse files Browse the repository at this point in the history
  • Loading branch information
szh committed May 21, 2024
1 parent a64cdd7 commit 416868f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ To see an example of this Action in use, check out the [self test](./.github/wor

## Roadmap

- Use https://github.com/helm/kind-action
- Add signing of VEX documents
10 changes: 9 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ inputs:
runs:
using: "composite"
steps:
- name: "Setup"
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.15.0

- name: "Setup Kubescape"
run: $GITHUB_ACTION_PATH/setup.sh
shell: bash

Expand Down
15 changes: 2 additions & 13 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
#!/usr/bin/env bash
set -x

# Install kind and kubectl
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-$(uname)-amd64
chmod +x ./kind
./kind create cluster
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.21.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
# Install helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
sudo ./get_helm.sh
# Install Kubescape
helm repo add kubescape https://kubescape.github.io/helm-charts/
helm repo update
Expand All @@ -22,8 +11,8 @@ helm upgrade --install kubescape kubescape/kubescape-operator -n kubescape --cre
--set nodeAgent.config.updatePeriod=1m \
--set logger.level=debug \
--wait
# Wait for the pod to be ready
# Wait for the pods to be ready
sleep 5
kubectl -n kubescape wait --for=condition=ready pod -l app.kubernetes.io/name=node-agent --timeout=300s
kubectl -n kubescape wait --for=condition=ready pod -l app.kubernetes.io/name=storage --timeout=300s
echo "Kubescape is ready"
echo "Kubescape is ready"

0 comments on commit 416868f

Please sign in to comment.