Skip to content

Commit

Permalink
Gatekeeper migration to apps folder (#55)
Browse files Browse the repository at this point in the history
* gatekeeper app migration to apps folder

* constraint sync-wave order fixed
  • Loading branch information
kevinobee committed Jun 3, 2023
1 parent cade05d commit 7fe1a00
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 24 deletions.
1 change: 0 additions & 1 deletion apps/cluster-addons/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ bases:
- argo
- argo-events
- argo-rollouts
- gatekeeper-system
- litmus
- starboard-system
13 changes: 13 additions & 0 deletions apps/gatekeeper-library/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

commonLabels:
k8s-app: gatekeeper-library

commonAnnotations:
linkerd.io/inject: enabled

# Issue: using app-of-apps pattern and orchestrating synchronization using sync waves
# ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/upgrading/1.7-1.8/#health-assessment-of-argoprojioapplication-crd-has-been-removed
resources:
- github.com/open-policy-agent/gatekeeper-library/library/general
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ commonAnnotations:
bases:
- github.com/sighupio/gatekeeper-policy-manager?ref=v0.5.1

namespace: gatekeeper-system

resources:
- ingress.yaml

namespace: gatekeeper-system
2 changes: 2 additions & 0 deletions apps/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ bases:
- argocd
- cert-manager
- gatekeeper
- gatekeeper-library
- gatekeeper-policy-manager
- cluster-addons
- ingress-nginx
- loki
Expand Down
4 changes: 2 additions & 2 deletions gitops/cluster-addons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ kind: ApplicationSet
metadata:
name: cluster-addons
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
generators:
- git:
Expand All @@ -15,6 +13,8 @@ spec:
template:
metadata:
name: '{{path.basename}}'
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
project: default
source:
Expand Down
18 changes: 18 additions & 0 deletions gitops/gatekeeper-library.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: gatekeeper-library
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: 'https://github.com/kevinobee/k8s-gitops.git'
targetRevision: HEAD
path: apps/gatekeeper-library
destination:
server: https://kubernetes.default.svc
namespace: gatekeeper-system
syncPolicy:
automated: {}
18 changes: 18 additions & 0 deletions gitops/gatekeeper-policy-manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: gatekeeper-policy-manager
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: 'https://github.com/kevinobee/k8s-gitops.git'
targetRevision: HEAD
path: apps/gatekeeper-policy-manager
destination:
server: https://kubernetes.default.svc
namespace: gatekeeper-system
syncPolicy:
automated: {}
2 changes: 1 addition & 1 deletion gitops/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: policy
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
argocd.argoproj.io/sync-wave: "2"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
Expand Down
6 changes: 0 additions & 6 deletions kustomization.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions policy/constraints/cluster-constraints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sBlockNodePort
metadata:
name: block-node-port
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
match:
kinds:
Expand All @@ -16,8 +14,6 @@ apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sUniqueIngressHost
metadata:
name: unique-ingress-host
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
match:
kinds:
Expand Down
10 changes: 2 additions & 8 deletions policy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ kind: Kustomization
commonLabels:
k8s-app: policy

commonAnnotations:
linkerd.io/inject: enabled
namespace: gatekeeper-system

# Issue: using app-of-apps pattern and orchestrating synchronization using sync waves
# ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/upgrading/1.7-1.8/#health-assessment-of-argoprojioapplication-crd-has-been-removed
resources:
- github.com/open-policy-agent/gatekeeper-library/library/general
# - constraints/cluster-constraints.yaml

namespace: gatekeeper-system
- constraints/cluster-constraints.yaml

0 comments on commit 7fe1a00

Please sign in to comment.