Fork the lockdown test to two tests as it is doing the work of 2 (#134)
This patch makes a second copy of the existing lockdown test because it is doing double duty. In follow on patches we will make each test do one thing only. Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
export EXTRA_HELM_ARGS="--values=examples/production/values.yaml"
|
||||||
Executable
+48
@@ -0,0 +1,48 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
SCRIPT=$(readlink -f "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
|
||||||
|
k_wait=(kubectl wait --for condition=available --timeout 30s --namespace)
|
||||||
|
k_rollout_status=(kubectl rollout status --watch --timeout 30s --namespace)
|
||||||
|
|
||||||
|
cat <<EOF >>"$GITHUB_STEP_SUMMARY"
|
||||||
|
### spire
|
||||||
|
| workload | Status |
|
||||||
|
| -------- | ------ |
|
||||||
|
| spire-server | $("${k_rollout_status[@]}" spire-server statefulset spire-server) |
|
||||||
|
| spire-spiffe-csi-driver | $("${k_rollout_status[@]}" spire-system daemonset spire-spiffe-csi-driver) |
|
||||||
|
| spire-agent | $("${k_rollout_status[@]}" spire-system daemonset spire-agent) |
|
||||||
|
| spire-spiffe-oidc-discovery-provider | $("${k_wait[@]}" spire-server deployments.apps spire-spiffe-oidc-discovery-provider) |
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ $1 -ne 0 ]; then
|
||||||
|
echo
|
||||||
|
echo '```'
|
||||||
|
echo '==> Events of namespace spire-server'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s get events --output wide --namespace spire-server'
|
||||||
|
kubectl --request-timeout=30s get events --output wide --namespace spire-server
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '<== Events of namespace spire-server'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s describe pods --namespace spire-server'
|
||||||
|
kubectl --request-timeout=30s describe pods --namespace spire-server
|
||||||
|
echo '========================================================================================================================'
|
||||||
|
echo '==> Events of namespace spire-system'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s get events --output wide --namespace spire-system'
|
||||||
|
kubectl --request-timeout=30s get events --output wide --namespace spire-system
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '<== Events of namespace spire-system'
|
||||||
|
echo '........................................................................................................................'
|
||||||
|
echo '>>> kubectl --request-timeout=30s describe pods --namespace spire-system'
|
||||||
|
kubectl --request-timeout=30s describe pods --namespace spire-system
|
||||||
|
echo '========================================================================================================================'
|
||||||
|
kubectl get pods -o name -n spire-server | while read line; do echo logs for $line; kubectl logs -n spire-server $line --all-containers=true --ignore-errors=true; done
|
||||||
|
kubectl get pods -o name -n spire-system | while read line; do echo logs for $line; kubectl logs -n spire-system $line --all-containers=true --ignore-errors=true; done
|
||||||
|
echo '========================================================================================================================'
|
||||||
|
echo '```'
|
||||||
|
fi | cat >> "$GITHUB_STEP_SUMMARY"
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
kubectl create namespace "spire-system"
|
||||||
|
kubectl label namespace "spire-system" pod-security.kubernetes.io/enforce=privileged
|
||||||
|
kubectl create namespace "spire-server"
|
||||||
|
kubectl label namespace "spire-server" pod-security.kubernetes.io/enforce=restricted
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
spiffe-oidc-discovery-provider:
|
||||||
|
namespaceOverride: spire-server
|
||||||
|
|
||||||
|
spire-server:
|
||||||
|
namespaceOverride: spire-server
|
||||||
Reference in New Issue
Block a user