-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update ci to include cmctl Signed-off-by: Achref ben saad <[email protected]>
- Loading branch information
1 parent
b7a0176
commit a43dfe2
Showing
4 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: run-in-cluster-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
paths: | ||
- "deployments/annotations/**" | ||
- "deployments/generic/**" | ||
- "tests/test-scenarios-github.sh" | ||
- ".github/workflows/ci-test-incluster.yml" | ||
pull_request: | ||
branches: ["*"] | ||
paths: | ||
- "deployments/annotations/**" | ||
- "deployments/generic/**" | ||
- "tests/test-scenarios-github.sh" | ||
- ".github/workflows/ci-test-incluster.yml" | ||
|
||
jobs: | ||
manifest-test: | ||
name: Run basic manifest tests / ${{ matrix.os }} / ${{ matrix.runtime }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, ubuntu-18.04] | ||
runtime: ["docker", "containerd", "crio"] | ||
steps: | ||
- name: Kernel version | ||
run: uname -r | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Enviroment | ||
run: | | ||
echo "RUNTIME="$RUNTIME | ||
if [ "$RUNTIME" == "docker" ]; then | ||
./contribution/self-managed-k8s/docker/install_docker.sh | ||
docker --version | ||
elif [ "$RUNTIME" == "crio" ]; then | ||
./contribution/self-managed-k8s/crio/install_crio.sh | ||
crio --version | ||
fi | ||
./contribution/k3s/install_k3s.sh | ||
- name: Install cmctl | ||
run: | | ||
OS=$(go env GOOS); ARCH=$(go env GOARCH); curl -sSL -o cmctl.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.7.2/cmctl-$OS-$ARCH.tar.gz | ||
tar xzf cmctl.tar.gz | ||
sudo mv cmctl /usr/local/bin | ||
- name: Install annotation controller | ||
run: | | ||
kubectl apply -f deployments/annotations/cert-manager.yaml | ||
kubectl wait pods --for=condition=ready -n cert-manager -l app.kubernetes.io/instance=cert-manager | ||
cmctl check api --wait 300s | ||
kubectl apply -f deployments/annotations/kubearmor-annotation-manager.yaml | ||
kubectl wait pods --for=condition=ready -n kube-system -l kubearmor-app=kubearmor-annotation-manager | ||
- name: Apply KubeArmor manifest | ||
run: | | ||
kubectl apply -f deployments/generic/kubearmor.yaml | ||
- name: Test manifests | ||
run: | | ||
./tests/test-scenarios-github.sh | ||
- name: Get pod informations | ||
if: ${{ failure() }} | ||
run: | | ||
kubectl get po -n kube-system | ||
kubectl describe po -n kube-system | ||
- name: Archive log artifacts | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kubearmor.logs | ||
path: | | ||
/tmp/kubearmor.test | ||
/tmp/kubearmor.log | ||
/tmp/kubearmor.msg | ||
- name: Check Results | ||
if: ${{ always() }} | ||
run: cat /tmp/kubearmor.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters