mirror of
https://github.com/fluxcd/flux2-hub-spoke-example.git
synced 2025-07-27 15:53:19 +00:00
Provision production cluster
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
98577807dd
commit
5dcfc42aaf
6 changed files with 152 additions and 0 deletions
9
clusters/production/apps/kustomization.yaml
Normal file
9
clusters/production/apps/kustomization.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../../deploy/apps
|
||||||
|
patches:
|
||||||
|
- path: podinfo-values.yaml
|
||||||
|
target:
|
||||||
|
kind: HelmRelease
|
||||||
|
name: podinfo
|
17
clusters/production/apps/podinfo-values.yaml
Normal file
17
clusters/production/apps/podinfo-values.yaml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2beta2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: podinfo
|
||||||
|
spec:
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
version: ">=1.0.0-alpha"
|
||||||
|
test:
|
||||||
|
enable: false
|
||||||
|
values:
|
||||||
|
ingress:
|
||||||
|
hosts:
|
||||||
|
- host: podinfo.production
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: ImplementationSpecific
|
4
clusters/production/infra-configs/kustomization.yaml
Normal file
4
clusters/production/infra-configs/kustomization.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../../deploy/infra-configs
|
4
clusters/production/infra-controllers/kustomization.yaml
Normal file
4
clusters/production/infra-controllers/kustomization.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../../deploy/infra-controllers
|
4
clusters/production/tenants/kustomization.yaml
Normal file
4
clusters/production/tenants/kustomization.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../../deploy/tenants
|
114
hub/production.yaml
Normal file
114
hub/production.yaml
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: production
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: tenants
|
||||||
|
namespace: production
|
||||||
|
spec:
|
||||||
|
interval: 1h
|
||||||
|
retryInterval: 3m
|
||||||
|
timeout: 5m
|
||||||
|
prune: true
|
||||||
|
wait: true
|
||||||
|
path: ./clusters/production/tenants
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: flux-system
|
||||||
|
namespace: flux-system
|
||||||
|
kubeConfig:
|
||||||
|
secretRef:
|
||||||
|
name: cluster-kubeconfig
|
||||||
|
postBuild:
|
||||||
|
substitute:
|
||||||
|
CLUSTER_NAME: production
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: infra-controllers
|
||||||
|
namespace: production
|
||||||
|
spec:
|
||||||
|
dependsOn:
|
||||||
|
- name: tenants
|
||||||
|
targetNamespace: production
|
||||||
|
interval: 1h
|
||||||
|
retryInterval: 3m
|
||||||
|
timeout: 5m
|
||||||
|
prune: true
|
||||||
|
wait: true
|
||||||
|
path: ./clusters/production/infra-controllers
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: flux-system
|
||||||
|
namespace: flux-system
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
patch: |
|
||||||
|
- op: add
|
||||||
|
path: /spec/kubeConfig
|
||||||
|
value:
|
||||||
|
secretRef:
|
||||||
|
name: cluster-kubeconfig
|
||||||
|
- op: add
|
||||||
|
path: /spec/serviceAccountName
|
||||||
|
value: flux-cluster-admin
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: infra-configs
|
||||||
|
namespace: production
|
||||||
|
spec:
|
||||||
|
dependsOn:
|
||||||
|
- name: infra-controllers
|
||||||
|
targetNamespace: production
|
||||||
|
interval: 1h
|
||||||
|
retryInterval: 3m
|
||||||
|
timeout: 5m
|
||||||
|
prune: true
|
||||||
|
wait: true
|
||||||
|
path: ./clusters/production/infra-configs
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: flux-system
|
||||||
|
namespace: flux-system
|
||||||
|
kubeConfig:
|
||||||
|
secretRef:
|
||||||
|
name: cluster-kubeconfig
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: apps
|
||||||
|
namespace: production
|
||||||
|
spec:
|
||||||
|
dependsOn:
|
||||||
|
- name: infra-configs
|
||||||
|
targetNamespace: production
|
||||||
|
interval: 1h
|
||||||
|
retryInterval: 3m
|
||||||
|
timeout: 5m
|
||||||
|
prune: true
|
||||||
|
wait: true
|
||||||
|
path: ./clusters/production/apps
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: flux-system
|
||||||
|
namespace: flux-system
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
kind: HelmRelease
|
||||||
|
patch: |
|
||||||
|
- op: add
|
||||||
|
path: /spec/kubeConfig
|
||||||
|
value:
|
||||||
|
secretRef:
|
||||||
|
name: cluster-kubeconfig
|
||||||
|
- op: add
|
||||||
|
path: /spec/serviceAccountName
|
||||||
|
value: flux-restricted
|
Loading…
Add table
Add a link
Reference in a new issue