Go to file
2024-11-28 16:41:14 +01:00
anydatacenter Add kyverno tests 2024-11-28 16:40:10 +01:00
modules/versions Add version constraints module 2024-11-28 12:54:33 +01:00
.envrc.example Add example of environment variables 2024-11-28 12:54:24 +01:00
.gitignore Initialize repository with flakes 2024-11-28 12:53:21 +01:00
flake.lock Initialize repository with flakes 2024-11-28 12:53:21 +01:00
flake.nix Add kyverno tests 2024-11-28 16:40:10 +01:00
README.md Update readme with result information about the demo 2024-11-28 16:41:14 +01:00

Rossum - Kyverno policy demo

This example assumes an existing and preconfigured access to k8s api server

Provide environment variables in the workdir as defined in the .envrc.example

anydatacenter directory represents a theoretical structure where the cluster would be located

Root modules

  • anydatacenter/10-devops is a terraform root module providing prerequisites for kubernetes resources

  • anydatacenter/30-policy-demo is a set of deployments and policies to demonstrate automated topology spread of k8s pods

The reason for split root modules comes from the chicken or the egg dilemma with kubernetes manifests and CRDs

Because the kubernetes provider validates the manifests against CRDs during planning phase, it is not possible to do a single apply in which CRDs are installed and manifests are produced against those CRDs. Other solution would be using kubectl provider which is more error prone (opinionated statement) and using the kubernetes provider is preferred. This requires either a multi-apply approach (frowned upon!) or splitting root modules and applying one after another.

Policies

Policies are deliberately limited to rossum namespace

Tests

Kyverno tests are defined in the policy root module at ./anydatacenter/30-policy-demo/kyvernoPolicies/tests

Execute with nix and devenv

tests

Execute with kyverno cli

kyverno test ./anydatacenter/30-policy-demo