mirror of
https://github.com/fluxcd/flux2-hub-spoke-example.git
synced 2025-07-27 15:53:19 +00:00
Refactor structure
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
2f9057e96b
commit
98577807dd
17 changed files with 35 additions and 21 deletions
|
@ -1,7 +1,7 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../../apps
|
||||
- ../../../deploy/apps
|
||||
patches:
|
||||
- path: podinfo-values.yaml
|
||||
target:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../../../infrastructure/configs
|
||||
- ../../../deploy/infra-configs
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../../../infrastructure/controllers
|
||||
- ../../../deploy/infra-controllers
|
4
clusters/staging/tenants/kustomization.yaml
Normal file
4
clusters/staging/tenants/kustomization.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../../deploy/tenants
|
|
@ -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}"
|
7
deploy/tenants/kustomization.yaml
Normal file
7
deploy/tenants/kustomization.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- flux.yaml
|
||||
- cert-manager.yaml
|
||||
- ingress-nginx.yaml
|
||||
- podinfo.yaml
|
|
@ -21,4 +21,4 @@ roleRef:
|
|||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: flux-restricted
|
||||
namespace: staging
|
||||
namespace: "${CLUSTER_NAME}"
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue