Azure / aks-app-routing-operator

Kubernetes operator that implements AKS Application Routing
https://learn.microsoft.com/en-us/azure/aks/app-routing
MIT License
29 stars 20 forks source link

add Gatekeeper validation to manifests #212

Closed OliverMKing closed 3 weeks ago

OliverMKing commented 1 month ago

Description

This PR adds validation to our managed resources to ensure they are following Kubernetes best practices. We accomplish this by scanning our fixtures which represent the resources that we manage. Unfortunately, there's no tool that scans manifests with a complete library of best practices built in. We had a few options

We chose Gatekeeper for now. See the doc added to this PR for information on what we pull automatically and what we have to define.

Along with implementing these tests there were a few other things we had to do

  1. Swap our fixtures from json to yaml. Gatekeeper / Gator doesn't handle json manifests stored in the same file. Yaml is easier to read anyways
  2. Update a few dependencies (and make super minor changes to handle any breaking changes based on these bumps)

When reviewing this PR note that the files in pkg/manifests/policy/manifests/templates are pulled directly from the Gatekeeper Library with no changes. It may be good to view those separately so you can digest the contents of this PR better. This is a large PR but the majority of the diff is due to autogenerated things like fixtures switching from json to yaml and the autopulled templates.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

This is a testing improvement.

Checklist:

OliverMKing commented 4 weeks ago

/ok-to-test sha=f708d88

OliverMKing commented 4 weeks ago

/ok-to-test sha=e875cd2

OliverMKing commented 4 weeks ago

/ok-to-test sha=444387b

OliverMKing commented 4 weeks ago

/ok-to-test sha=5f59606

OliverMKing commented 4 weeks ago

/ok-to-test sha=06278a0