Refactor structure

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2024-04-10 12:55:53 +03:00
parent 2f9057e96b
commit 98577807dd
No known key found for this signature in database
GPG key ID: 3299AEB0E4085BAF
17 changed files with 35 additions and 21 deletions

View file

@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../apps
- ../../../deploy/apps
patches:
- path: podinfo-values.yaml
target:

View file

@ -1,4 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../infrastructure/configs
- ../../../deploy/infra-configs

View file

@ -1,4 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../infrastructure/controllers
- ../../../deploy/infra-controllers

View file

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../deploy/tenants

View file

@ -1,31 +1,31 @@
apiVersion: v1
kind: Namespace
metadata:
name: staging
name: "${CLUSTER_NAME}"
labels:
toolkit.fluxcd.io/tenant: admin-team
toolkit.fluxcd.io/tenant: sre-team
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
toolkit.fluxcd.io/tenant: admin-team
toolkit.fluxcd.io/tenant: sre-team
name: flux-restricted
namespace: staging
namespace: "${CLUSTER_NAME}"
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
toolkit.fluxcd.io/tenant: admin-team
toolkit.fluxcd.io/tenant: sre-team
name: flux-cluster-admin
namespace: staging
namespace: "${CLUSTER_NAME}"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
toolkit.fluxcd.io/tenant: admin-team
toolkit.fluxcd.io/tenant: sre-team
name: flux-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
@ -34,4 +34,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: flux-cluster-admin
namespace: staging
namespace: "${CLUSTER_NAME}"

View file

@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- flux.yaml
- cert-manager.yaml
- ingress-nginx.yaml
- podinfo.yaml

View file

@ -21,4 +21,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: flux-restricted
namespace: staging
namespace: "${CLUSTER_NAME}"

View file

@ -6,7 +6,7 @@ metadata:
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: tenants-sync
name: tenants
namespace: staging
spec:
interval: 1h
@ -22,22 +22,25 @@ spec:
kubeConfig:
secretRef:
name: cluster-kubeconfig
postBuild:
substitute:
CLUSTER_NAME: staging
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra-controllers-sync
name: infra-controllers
namespace: staging
spec:
dependsOn:
- name: tenants-sync
- name: tenants
targetNamespace: staging
interval: 1h
retryInterval: 3m
timeout: 5m
prune: true
wait: true
path: ./clusters/staging/infrastructure/controllers
path: ./clusters/staging/infra-controllers
sourceRef:
kind: GitRepository
name: flux-system
@ -58,18 +61,18 @@ spec:
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra-configs-sync
name: infra-configs
namespace: staging
spec:
dependsOn:
- name: infra-controllers-sync
- name: infra-controllers
targetNamespace: staging
interval: 1h
retryInterval: 3m
timeout: 5m
prune: true
wait: true
path: ./clusters/staging/infrastructure/configs
path: ./clusters/staging/infra-configs
sourceRef:
kind: GitRepository
name: flux-system
@ -81,11 +84,11 @@ spec:
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: apps-sync
name: apps
namespace: staging
spec:
dependsOn:
- name: infra-configs-sync
- name: infra-configs
targetNamespace: staging
interval: 1h
retryInterval: 3m