Guest User

Untitled

a guest
Nov 18th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. package kubernetes.admission
  2.  
  3. import data.kubernetes.namespaces
  4.  
  5. import input.request.object.metadata.annotations as annotations
  6.  
  7. deny[msg] {
  8. input.request.kind.kind = "Service"
  9. input.request.operation = "CREATE"
  10. input.request.object.spec.type = "LoadBalancer"
  11. missing_required_annotations[msg]
  12. }
  13.  
  14. # Require use of Security Group sg-123
  15. missing_required_annotations[msg] {
  16. not annotations["service.beta.kubernetes.io/aws-load-balancer-security-groups"] = "sg-123"
  17. msg = "Services of type LoadBalancer must use Security Group sg-123"
  18. }
Add Comment
Please, Sign In to add comment