-
Notifications
You must be signed in to change notification settings - Fork 46
Test Plan
José Guilherme Vanz (a.k.a galináceo) edited this page Sep 28, 2021
·
22 revisions
Test based on the Quick start documentation.
- Run the commands to install Kubewarden using the Helm charts. See more about the command in the Quick start documentation
- Wait installation to finish
- Check if the Kubewarden is installed and the custom resource definition is configured
The Kubewarden stack should be installed and properly configured in the Kubernetes cluster
Test based on the Quick start documentation.
A Kubernetes cluster with Kubewarden installed.
- Delete all
ClusterAdimissionPolicyresources - Wait for the for the kubewarden-controller to remove all the Kubernetes
ValidatingWebhookConfigurationand theMutatingWebhookConfigurationresources it created. - Uninstall the Helm chart
After the deinstallation process all the Kubewarden stack should be removed.
A Kubernetes cluster with Kubewarden installed.
- Define a
ClusterAdmissionPolicy
kubectl apply -f - <<EOF
apiVersion: policies.kubewarden.io/v1alpha2
kind: ClusterAdmissionPolicy
metadata:
name: privileged-pods
spec:
module: registry://ghcr.io/kubewarden/policies/pod-privileged:v0.1.5
rules:
- apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
operations:
- CREATE
- UPDATE
mutating: false
EOF- Wait policy to be active
- Try to deploy a pod which violates the policy previously defined. It should fail.
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: privileged-pod
spec:
containers:
- name: nginx
image: nginx:latest
securityContext:
privileged: true
EOFThe kubectl command used to create the pod should fail.
A Kubernetes cluster with Kubewarden installed.
- Define a
ClusterAdmissionPolicy
kubectl apply -f - <<EOF
apiVersion: policies.kubewarden.io/v1alpha2
kind: ClusterAdmissionPolicy
metadata:
name: privileged-pods
spec:
module: registry://ghcr.io/kubewarden/policies/pod-privileged:v0.1.5
rules:
- apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
operations:
- CREATE
- UPDATE
mutating: false
EOF- Wait policy to be active
- Try to deploy a pod which violates the policy previously defined. It should not fail.
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: unprivileged-pod
spec:
containers:
- name: nginx
image: nginx:latest
EOFThe kubectl command used to create the pod should not fail and the pod should be created.