Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flux Operator 0.6 #178

Merged
merged 15 commits into from
Jun 24, 2024
Merged

Flux Operator 0.6 #178

merged 15 commits into from
Jun 24, 2024

Conversation

kingdonb
Copy link
Contributor

@kingdonb kingdonb commented Jun 22, 2024

This PR upgrades to Flux-Operator 0.6 released this morning, also includes:

I have at least 80% confidence there are no errors in this PR. It also restores the networkPolicy default and the deleted cozy-dashboard network policy, which we will see fixed (restored to install NetworkPolicy resources by default) in the next flux-operator release.

Ref: controlplaneio-fluxcd/flux-operator#52

Little more testing on my end and then I will mark it as review-worthy. (This PR is still a draft)

kingdonb and others added 11 commits June 22, 2024 16:52
Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

add flux-operator chart

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

redefine fluxcd chart source as flux-operator

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

default FluxInstance

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

make flux instance minimal

we need to conform to the current version in use, 2.2.x, but otherwise
we don't need to specify all of this, and as long as we don't specify
any of this, then user can merge their own configs in with kubectl apply

I hope the FluxInstance registry is set to default to ghcr, so we don't
block anyone from using an enterprise or paid distribution of flux with
this config!

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

fix versions map (and tag)

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

The FluxInstance "flux" is invalid:

spec.distribution.registry: Required value
(drat!)

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

Revert "fix versions map (and tag)"

This reverts commit 4989e01.

take over all components

the chart installs by default all 6 components, so make sure we are
taking them all over this way

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

kubectl wait for fluxinstance/flux

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

try a different wait order

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

now I see what this is doing

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

try to understand how to fix this

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

test hostNetwork in chart

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

add hostNetwork: true value

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

test kubeprism with flux-operator

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

is this a good validation

IDK

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

better logic order

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

set domain in cluster correctly for flux config

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

set cozy-fluxcd namespace to privileged

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

magical operators

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

test cluster.domain

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

parameterize everything

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

remove unsure statements from installer.sh

it's tested now, it works, we know where the failures are (and they
aren't a problem for now)

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

FluxInstance CRD

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

Resolve deprecated API references

HelmRelease is v2 and HelmRepository is v1 now, as of Flux 2.3

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

upgrade Flux to match new helmrelease definitions

Helm Controller is GA as of Flux 2.3

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

fluxFaster.yaml - values to speed things up

this change was the real motivation for introducing flux-operator

+fixup

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>

do not set cluster domain by default

so users can override it (we should probably provide a way to disable
these customizations as well, so they can provide their own without
getting clobbered by cozystack-installer)

As we know there is no simple way to perform array merges in Helm values

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
this caused an error

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
Co-authored-by: Andrei Kvapil <kvapss@gmail.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
@kingdonb
Copy link
Contributor Author

kingdonb commented Jun 22, 2024

I tested, was able to get kubeapps to boot with the changes you added 👍 I have also now rebased and am in the process of testing again, had some local environment issues to work out with the multi-arch build

(fwiw I just had to clean up some broken builders from buildx, and be sure to create and set a default builder... then it worked)

docker buildx create --name my-builder
docker buildx use my-builder

Will push over this branch with the rebased commits, so we can review it rebased & with conflicts resolved

Before the rebase we are at 6a097bc

@kingdonb
Copy link
Contributor Author

I would probably merge this change-set instead of the branch that's currently in #170 upd-flux

Still have to give it a quick once-over to be sure I haven't made any rebase errors, I did a pull --rebase=merges 🧐

kingdonb added 3 commits June 22, 2024 22:00
This came back in a rebase error, but these values have already been
merged into `values.yaml`

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
This is required until
controlplaneio-fluxcd/flux-operator#51 can be
resolved in a release, if you don't set `networkPolicy` then you'll get
a wrong behavior from Flux, which should be deployed with NetworkPolicy
resources by default.

The `allow-from-kubeapps` policy is so that cozy-dashboard can poll and
represent the status of Helm artifacts, it is still needed when this fix
is in.

Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
Signed-off-by: Kingdon Barrett <kingdon+github@tuesdaystudios.com>
@kingdonb
Copy link
Contributor Author

kingdonb commented Jun 22, 2024

Now I've tested, and kingdonb/cozystack:0.1.22 properly invokes clusters.networkPolicy: true and Flux pods are able to communicate properly, it seems, so long as they are started after the network policies are in place.

I saw the changes you made to patch source controller advertise address and notification controller, that's pretty ingenious, it seems to obviate the importance of the setting for spec.cluster.domain - a default value of cluster.local

spec:
  cluster:
    domain: cluster.local
    networkPolicy: true
    type: kubernetes

These are the implied defaults, and controlplaneio-fluxcd/flux-operator#52 solves that they are not honored now, in 0.6 operator, so we can remove that setting in our instance template values of cluster.networkPolicy after it merges. I don't know if you want to encourage the "fork the installer to override values" pattern, but this works great for me, I've been able to test every change I've made so far.

I don't want to hold things up clamoring that there still isn't a really good way for users to provide their own custom settings to Flux while we are providing some extensions to the defaults, I think a configmap, but I'm not prepared to solve it now. I think it's OK to move forward with sane defaults.

I'm happy with how this is turning out, because Flux won't be the bottleneck installing. It performs much better with the concurrency set to 20 than the default! (4?) I have some mixed feelings about the way that cluster domain is resolved, but it's not a blocker.

I've still some local end-to-end testing left to do on my part, but smoke test it works, from my end looks good right now.

@kingdonb kingdonb marked this pull request as ready for review June 22, 2024 23:13
@kingdonb
Copy link
Contributor Author

kingdonb commented Jun 23, 2024

End-to-end testing in here is going pretty well (the latest test build right now is kingdonb/cozystack:0.1.24):

I was able to deploy the full stack, and access the dashboard, and upgrade tenant-root, and deploy a virtual cluster. That's as far as I've got time to test today, (and now I am a bit more familiar with the build system

I managed to built my own dashboard+kubeapps API to be sure I test a specific version - by hand, in a personal Docker Hub repo - and test those with the changes in this branch, in a personal build of cozystack installer)

@kingdonb
Copy link
Contributor Author

kingdonb commented Jun 23, 2024

I'll re-target this PR to the upd-flux branch so it's easier to see what the full diff is.

Pretty sure that does not help. I have pointed it back at the main branch, which looks OK because it has already been rebased on main.

@kingdonb kingdonb changed the base branch from main to upd-flux June 23, 2024 02:09
@kingdonb kingdonb changed the base branch from upd-flux to main June 23, 2024 02:12
@kvaps kvaps changed the base branch from main to upd-flux June 24, 2024 11:19
@kvaps kvaps merged commit da4b382 into aenix-io:upd-flux Jun 24, 2024
kvaps pushed a commit that referenced this pull request Jun 24, 2024
This PR upgrades to Flux-Operator 0.6 released this morning, also includes:

* #170
which is an aggregate PR, so #171 #172 etc. I think this PR now basically subsumes #170 and can replace it.

I have at least 80% confidence there are no errors in this PR. It also restores the networkPolicy default and the deleted cozy-dashboard network policy, which we will see fixed (restored to install NetworkPolicy resources by default) in the next `flux-operator` release.

Ref: controlplaneio-fluxcd/flux-operator#52
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps mentioned this pull request Jun 24, 2024
5 tasks
kvaps pushed a commit that referenced this pull request Jun 24, 2024
This PR upgrades to Flux-Operator 0.6 released this morning, also includes:

* #170
which is an aggregate PR, so #171 #172 etc. I think this PR now basically subsumes #170 and can replace it.

I have at least 80% confidence there are no errors in this PR. It also restores the networkPolicy default and the deleted cozy-dashboard network policy, which we will see fixed (restored to install NetworkPolicy resources by default) in the next `flux-operator` release.

Ref: controlplaneio-fluxcd/flux-operator#52
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
kvaps pushed a commit that referenced this pull request Jun 24, 2024
This PR upgrades to Flux-Operator 0.6 released this morning, also includes:

* #170
which is an aggregate PR, so #171 #172 etc. I think this PR now basically subsumes #170 and can replace it.

I have at least 80% confidence there are no errors in this PR. It also restores the networkPolicy default and the deleted cozy-dashboard network policy, which we will see fixed (restored to install NetworkPolicy resources by default) in the next `flux-operator` release.

Ref: controlplaneio-fluxcd/flux-operator#52
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kingdonb kingdonb deleted the flux-oper-0.6 branch June 24, 2024 13:09
kvaps added a commit that referenced this pull request Jun 24, 2024
This cumulative PR includes the following changes:

- Migrate from fluxcd-community charts to Flux-Operator #166
- Upgrade to Flux 2.3.x #167
- Refactor Flux 2.3 update #172
- Update flux plugin for dashboard #171
- Flux Operator 0.6 #178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants