Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
flux2
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
fluxcd
flux2
Commits
5df91183
Commit
5df91183
authored
4 years ago
by
Stefan Prodan
Committed by
Hidde Beydals
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add pre-bootstrap customisation to install docs
Signed-off-by:
Stefan Prodan
<
stefan.prodan@gmail.com
>
parent
4a4af94d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/guides/installation.md
+30
-12
30 additions, 12 deletions
docs/guides/installation.md
internal/utils/utils.go
+2
-8
2 additions, 8 deletions
internal/utils/utils.go
with
32 additions
and
20 deletions
docs/guides/installation.md
+
30
−
12
View file @
5df91183
...
...
@@ -337,16 +337,23 @@ please see [fluxcd/terraform-provider-flux](https://github.com/fluxcd/terraform-
## Customize Flux manifests
You can customize the Flux components
in the Git repository where you've run bootstrap with Kustomize patches
.
You can customize the Flux components
before or after running bootstrap
.
First clone the repository locally and generate a
`kustomization.yaml`
file with:
Assuming you want to customise the Flux controllers before they get deployed on the cluster,
first you'll need to create a Git repository and clone it locally.
Create the file structure required by bootstrap with:
```
sh
cd
./clusters/production
&&
kustomize create
--autodetect
mkdir
-p
clusters/my-cluster/flux-system
touch
clusters/my-cluster/flux-system/gotk-components.yaml
\
clusters/my-cluster/flux-system/gotk-patches.yaml
\
clusters/my-cluster/flux-system/gotk-sync.yaml
\
clusters/my-cluster/flux-system/kustomization.yaml
```
Assuming you want to add custom annotations and labels to the Flux controllers
in
`clusters/production`
.
Create a Kustomize patch
and set the metadata for source-controller and kustomize-controller pods:
Assuming you want to add custom annotations and labels to the Flux controllers
,
edit
`clusters/my-cluster/gotk-patches.yaml`
and set the metadata for source-controller and kustomize-controller pods:
```
yaml
apiVersion
:
apps/v1
...
...
@@ -376,26 +383,37 @@ spec:
custom
:
label
```
Save the above file as
`flux-system-patch.yaml`
inside the
`clusters/production`
dir.
Edit
`clusters/production/kustomization.yaml`
and add the patch:
Edit
`clusters/my-cluster/kustomization.yaml`
and set the resources and patches:
```
yaml
apiVersion
:
kustomize.config.k8s.io/v1beta1
kind
:
Kustomization
resources
:
-
flux-system
-
gotk-components.yaml
-
gotk-sync.yaml
patchesStrategicMerge
:
-
flux-system
-patch.yaml
-
gotk
-patch
es
.yaml
```
Push the changes to main branch:
```
sh
git add
-A
&&
git commit
-m
"add
production metadata
"
&&
git push
git add
-A
&&
git commit
-m
"add
flux customisations
"
&&
git push
```
Flux will detect the change and will update itself on the production cluster.
Now run the bootstrap for
`clusters/my-cluster`
:
```
sh
flux bootstrap git
\
--url
=
ssh://git@<host>/<org>/<repository>
\
--branch
=
main
\
--path
=
clusters/my-cluster
```
When the controllers are deployed for the first time on your cluster, they will contain all
the customisations from
`gotk-patches.yaml`
.
You can make changes to the patches after bootstrap and Flux will apply them in-cluster on its own.
## Dev install
...
...
This diff is collapsed.
Click to expand it.
internal/utils/utils.go
+
2
−
8
View file @
5df91183
...
...
@@ -30,21 +30,15 @@ import (
"strings"
"text/template"
helmv2
"github.com/fluxcd/helm-controller/api/v2beta1"
imageautov1
"github.com/fluxcd/image-automation-controller/api/v1alpha2"
imagereflectv1
"github.com/fluxcd/image-reflector-controller/api/v1alpha2"
kustomizev1
"github.com/fluxcd/kustomize-controller/api/v1beta1"
notificationv1
"github.com/fluxcd/notification-controller/api/v1beta1"
"github.com/fluxcd/pkg/runtime/dependency"
"github.com/fluxcd/pkg/version"
sourcev1
"github.com/fluxcd/source-controller/api/v1beta1"
"github.com/olekukonko/tablewriter"
appsv1
"k8s.io/api/apps/v1"
corev1
"k8s.io/api/core/v1"
networkingv1
"k8s.io/api/networking/v1"
rbacv1
"k8s.io/api/rbac/v1"
apiextensionsv1
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
apiruntime
"k8s.io/apimachinery/pkg/runtime"
sigyaml
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"sigs.k8s.io/controller-runtime/pkg/client"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment