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
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../../../apps
|
- ../../../deploy/apps
|
||||||
patches:
|
patches:
|
||||||
- path: podinfo-values.yaml
|
- path: podinfo-values.yaml
|
||||||
target:
|
target:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ../../../../infrastructure/configs
|
- ../../../deploy/infra-configs
|
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
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
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: staging
|
name: "${CLUSTER_NAME}"
|
||||||
labels:
|
labels:
|
||||||
toolkit.fluxcd.io/tenant: admin-team
|
toolkit.fluxcd.io/tenant: sre-team
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
toolkit.fluxcd.io/tenant: admin-team
|
toolkit.fluxcd.io/tenant: sre-team
|
||||||
name: flux-restricted
|
name: flux-restricted
|
||||||
namespace: staging
|
namespace: "${CLUSTER_NAME}"
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
toolkit.fluxcd.io/tenant: admin-team
|
toolkit.fluxcd.io/tenant: sre-team
|
||||||
name: flux-cluster-admin
|
name: flux-cluster-admin
|
||||||
namespace: staging
|
namespace: "${CLUSTER_NAME}"
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
toolkit.fluxcd.io/tenant: admin-team
|
toolkit.fluxcd.io/tenant: sre-team
|
||||||
name: flux-cluster-admin
|
name: flux-cluster-admin
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
@ -34,4 +34,4 @@ roleRef:
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: flux-cluster-admin
|
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:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
name: flux-restricted
|
name: flux-restricted
|
||||||
namespace: staging
|
namespace: "${CLUSTER_NAME}"
|
|
@ -6,7 +6,7 @@ metadata:
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
name: tenants-sync
|
name: tenants
|
||||||
namespace: staging
|
namespace: staging
|
||||||
spec:
|
spec:
|
||||||
interval: 1h
|
interval: 1h
|
||||||
|
@ -22,22 +22,25 @@ spec:
|
||||||
kubeConfig:
|
kubeConfig:
|
||||||
secretRef:
|
secretRef:
|
||||||
name: cluster-kubeconfig
|
name: cluster-kubeconfig
|
||||||
|
postBuild:
|
||||||
|
substitute:
|
||||||
|
CLUSTER_NAME: staging
|
||||||
---
|
---
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
name: infra-controllers-sync
|
name: infra-controllers
|
||||||
namespace: staging
|
namespace: staging
|
||||||
spec:
|
spec:
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: tenants-sync
|
- name: tenants
|
||||||
targetNamespace: staging
|
targetNamespace: staging
|
||||||
interval: 1h
|
interval: 1h
|
||||||
retryInterval: 3m
|
retryInterval: 3m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
prune: true
|
prune: true
|
||||||
wait: true
|
wait: true
|
||||||
path: ./clusters/staging/infrastructure/controllers
|
path: ./clusters/staging/infra-controllers
|
||||||
sourceRef:
|
sourceRef:
|
||||||
kind: GitRepository
|
kind: GitRepository
|
||||||
name: flux-system
|
name: flux-system
|
||||||
|
@ -58,18 +61,18 @@ spec:
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
name: infra-configs-sync
|
name: infra-configs
|
||||||
namespace: staging
|
namespace: staging
|
||||||
spec:
|
spec:
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: infra-controllers-sync
|
- name: infra-controllers
|
||||||
targetNamespace: staging
|
targetNamespace: staging
|
||||||
interval: 1h
|
interval: 1h
|
||||||
retryInterval: 3m
|
retryInterval: 3m
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
prune: true
|
prune: true
|
||||||
wait: true
|
wait: true
|
||||||
path: ./clusters/staging/infrastructure/configs
|
path: ./clusters/staging/infra-configs
|
||||||
sourceRef:
|
sourceRef:
|
||||||
kind: GitRepository
|
kind: GitRepository
|
||||||
name: flux-system
|
name: flux-system
|
||||||
|
@ -81,11 +84,11 @@ spec:
|
||||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
metadata:
|
metadata:
|
||||||
name: apps-sync
|
name: apps
|
||||||
namespace: staging
|
namespace: staging
|
||||||
spec:
|
spec:
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- name: infra-configs-sync
|
- name: infra-configs
|
||||||
targetNamespace: staging
|
targetNamespace: staging
|
||||||
interval: 1h
|
interval: 1h
|
||||||
retryInterval: 3m
|
retryInterval: 3m
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue