Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds template for cluster and project sets #2

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions system/argocd/argoset/clusterSet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: ClusterSet
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters: {}
template:
metadata:
name: '{{.name}}'
spec:
project: "management"
source:
repoURL: https://github.com/ClubCedille/k8s-management/
targetRevision: HEAD
path: argocd/appset
destination:
server: https://kubernetes.default.svc
namespace: management
kustomize:
patches:
- patch: |-
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
project: '{{.name}}'
- patch: |-
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: '{{.name}}'
50 changes: 50 additions & 0 deletions system/argocd/argoset/projectSet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: management
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
description: ''
sourceRepos:
- '*'
destinations:
- namespace: ''
server: https://kubernetes.default.svc
# Deny all cluster-scoped resources from being created, except for Namespace
# clusterResourceWhitelist:
# - group: ''
# kind: Namespace
# Allow all namespaced-scoped resources to be created, except for ResourceQuota, LimitRange, NetworkPolicy
# namespaceResourceBlacklist:
# - group: ''
# kind: ResourceQuota
# - group: ''
# kind: LimitRange
# - group: ''
# kind: NetworkPolicy
# # Deny all namespaced-scoped resources from being created, except for Deployment and StatefulSet
# namespaceResourceWhitelist:
# - group: 'apps'
# kind: Deployment
# - group: 'apps'
# kind: StatefulSet
# roles:
# # A role which provides read-only access to all applications in the project
# - name: read-only
# description: Read-only privileges to my-project
# policies:
# - p, proj:my-project:read-only, applications, get, my-project/*, allow
# groups:
# - my-oidc-group
# # A role which provides sync privileges to only the guestbook-dev application, e.g. to provide
# # sync privileges to a CI system
# - name: ci-role
# description: Sync privileges for guestbook-dev
# policies:
# - p, proj:my-project:ci-role, applications, sync, my-project/guestbook-dev, allow
# # NOTE: JWT tokens can only be generated by the API server and the token is not persisted
# # anywhere by Argo CD. It can be prematurely revoked by removing the entry from this list.
# jwtTokens:
# - iat: 1535390316
4 changes: 3 additions & 1 deletion system/argocd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- argocd-app.yaml
- argocd-app.yaml
- argoset/clusterSet.yaml
- argoset/projectSet.yaml
Loading