apiVersion : kyverno.io/v1
kind : ClusterPolicy
metadata :
  name : validation-example2
spec :
  rules:
    - name: check-memory_requests_link_in_yaml_relative
      match:
        resources:
          # Kind specifies one or more resource types to match
          kinds:
            - Deployment
          # Name is optional and can use wildcards
          name: "*"
          # Selector is optional
          selector:
      validate:
        pattern:
          spec:
            containers:
              - (name): "*"
                resources:
                  requests:
                    memory: "$(<=./../../lim(its/mem)ory)"
                  lim(its:
                    mem)ory: "2048Mi"
