UNCLASSIFIED

Commit e33dddf3 authored by Branden Cobb's avatar Branden Cobb
Browse files

Core Package Update

parent b8775155
commonAnnotations:
argocd.argoproj.io/sync-wave: "1"
resources:
- configs.yaml
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sRequiredLabels
metadata:
name: all-must-have-owner
spec:
enforcementAction: dryrun
match:
kinds:
- apiGroups: [""]
kinds: ["Namespace"]
parameters:
message: "All namespaces must have an `owner` label"
labels:
- key: owner
allowedRegex: "^[a-zA-Z]+$"
commonLabels:
owner: p1
policy-type: core
commonAnnotations:
argocd.argoproj.io/sync-wave: "2"
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
resources:
- all_ns_must_have_owner.yaml
patches:
- target:
group: constraints.gatekeeper.sh
version: v1beta1
patch: |-
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sRequiredLabels
metadata:
name: all
spec:
parameters:
exemptNamespaces:
- istio-system
- monitoring
- elastic-system
- logging
- gatekeeper-system
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
name: k8srequiredlabels
spec:
crd:
spec:
names:
kind: K8sRequiredLabels
validation:
# Schema for the `parameters` field
openAPIV3Schema:
properties:
labels:
type: array
items: string
targets:
- target: admission.k8s.gatekeeper.sh
rego: |-
package k8srequiredlabels
violation[{"msg": msg, "details": {"missing_labels": missing}}] {
provided := {label | input.review.object.metadata.labels[label]}
required := {label | label := input.parameters.labels[_]}
missing := required - provided
count(missing) > 0
msg := sprintf("you must provide labels: %v", [missing])
}
commonLabels:
owner: p1
policy-type: core
commonAnnotations:
argocd.argoproj.io/sync-wave: "1"
resources:
- k8srequiredlabels_template.yaml
namespace: gatekeeper-system
resources:
- opa-gatekeeper
# Global configs for gatekeeper
- configs
# Core constraint templates
- contraint-templates/core
# Core constraints
# - constraints/core
This diff is collapsed.
commonLabels:
owner: p1
resources:
- gatekeeper.yaml
createNamespace: false
imagePullSecrets:
- name: private-registry-mil
image:
pullSecrets:
- name: private-registry-mil
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment