Skip to content

Commit

Permalink
add flux
Browse files Browse the repository at this point in the history
  • Loading branch information
sergelogvinov committed Nov 22, 2024
1 parent 23c6b7b commit b19d87b
Show file tree
Hide file tree
Showing 3 changed files with 14,253 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _deployments/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ create-deployments: ## create templates

helm template --namespace=ingress-nginx --version=4.11.1 -f vars/ingress.yaml ingress-nginx \
ingress-nginx/ingress-nginx > vars/ingress-result.yaml

kube kustomize flux > vars/flux-result.yaml
157 changes: 157 additions & 0 deletions _deployments/flux/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/fluxcd/flux2/manifests/install?ref=v2.4.0
patches:
# Remove image automation and image reflector controllers
- patch: |
$patch: delete
apiVersion: apps/v1
kind: Deployment
metadata:
name: all
target:
kind: Deployment
name: (image-automation-controller|image-reflector-controller)
# Remove the built-in network policies
- patch: |
$patch: delete
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: all
target:
group: networking.k8s.io
kind: NetworkPolicy
# Increase the number of workers and limits
# Ref: https://fluxcd.io/flux/installation/configuration/vertical-scaling/#increase-the-number-of-workers-and-limits
- patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --concurrent=10
- op: add
path: /spec/template/spec/containers/0/args/-
value: --requeue-dependency=5s
target:
kind: Deployment
name: (kustomize-controller|helm-controller|source-controller)
- patch: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: all
spec:
template:
spec:
containers:
- name: manager
resources:
limits:
memory: 2Gi
target:
kind: Deployment
name: (kustomize-controller|helm-controller|source-controller)
- patch: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: all
spec:
template:
spec:
tolerations:
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
target:
kind: Deployment
name: (kustomize-controller|helm-controller|source-controller|notification-controller)
# Enable in-memory kustomize builds
# Ref: https://fluxcd.io/flux/installation/configuration/vertical-scaling/#enable-in-memory-kustomize-builds
- patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --concurrent=20
- op: replace
path: /spec/template/spec/volumes/0
value:
name: temp
emptyDir:
medium: Memory
target:
kind: Deployment
name: kustomize-controller
# Enable Helm repositories caching
# Ref: https://fluxcd.io/flux/installation/configuration/vertical-scaling/#enable-helm-repositories-caching
- patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --helm-cache-max-size=10
- op: add
path: /spec/template/spec/containers/0/args/-
value: --helm-cache-ttl=60m
- op: add
path: /spec/template/spec/containers/0/args/-
value: --helm-cache-purge-interval=5m
target:
kind: Deployment
name: source-controller
# Flux near OOM detection for Helm
# Ref: https://fluxcd.io/flux/installation/configuration/helm-oom-detection/
- patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --feature-gates=OOMWatch=true
- op: add
path: /spec/template/spec/containers/0/args/-
value: --oom-watch-memory-threshold=95
- op: add
path: /spec/template/spec/containers/0/args/-
value: --oom-watch-interval=500ms
target:
kind: Deployment
name: helm-controller
# Resources renamed to match those installed by oci://ghcr.io/fluxcd/flux-manifests
- target:
kind: ResourceQuota
name: critical-pods
patch: |
- op: replace
path: /metadata/name
value: critical-pods-flux-system
- target:
kind: ClusterRoleBinding
name: cluster-reconciler
patch: |
- op: replace
path: /metadata/name
value: cluster-reconciler-flux-system
- target:
kind: ClusterRoleBinding
name: crd-controller
patch: |
- op: replace
path: /metadata/name
value: crd-controller-flux-system
- target:
kind: ClusterRole
name: crd-controller
patch: |
- op: replace
path: /metadata/name
value: crd-controller-flux-system
- target:
kind: ClusterRole
name: flux-edit
patch: |
- op: replace
path: /metadata/name
value: flux-edit-flux-system
- target:
kind: ClusterRole
name: flux-view
patch: |
- op: replace
path: /metadata/name
value: flux-view-flux-system
Loading

0 comments on commit b19d87b

Please sign in to comment.