Skip to content
New issue

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

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

Already on GitHub? # to your account

Reconciler error - Too long: may not be longer than 32768 #4470

Closed
1 task done
Tracked by #4473
ricardo-aspira opened this issue Dec 12, 2023 · 1 comment · Fixed by fluxcd/kustomize-controller#1031
Closed
1 task done
Tracked by #4473
Labels
bug Something isn't working

Comments

@ricardo-aspira
Copy link

ricardo-aspira commented Dec 12, 2023

Describe the bug

Not able to apply values.yaml file from Airbyte using flux.

Steps to reproduce

Having a multi-tenancy repo, create a platform entry which applies your middlewares like Airbyte, using Helm Releases.

  1. Bootstrap flux from gitlab inside a specific folder from that git repo.
export GITLAB_TOKEN="<MY-TOKEN>"

flux bootstrap gitlab \
    --owner="my-group-in-gitlab/my-subgroup" \
    --repository="my-cluster-repo" \
    --hostname="gitlab.mydomain.com" \
    --token-auth \
    --branch master \
    --path=cluster

After bootstraping, you will have the following structure into your GitLab repo:

├── cluster
│   ├── flux-system
│   │   ├── gotk-components.yaml
│   │   ├── gotk-sync.yaml
│   │   ├── kustomization.yaml
  1. Create the following configuration files in order to install Airbyte as a Helm Release:
├── cluster
│   ├── flux-system
│   ├── platform.yaml
├── platform
│   ├── airbyte
│   │   ├── kustomization.yaml
│   │   ├── namespace.yaml
│   │   ├── release.yaml
│   │   ├── repository.yaml
└── .gitignore
  1. Make the files have the following content:

a. platform.yaml:

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: airbyte
  namespace: flux-system
spec:
  interval: 10m0s
  sourceRef:
    kind: GitRepository
    name: flux-system
  path: ./platform/airbyte
  prune: true
  wait: true
  timeout: 5m0s

b. platform/airbyte/kustomization.yaml:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: airbyte
resources:
  - namespace.yaml
  - repository.yaml
  - release.yaml

c. platform/airbyte/namespace.yaml:

apiVersion: v1
kind: Namespace
metadata:
  name: airbyte
  labels:
    toolkit.fluxcd.io/tenant: data-team

d. platform/airbyte/release.yaml:

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: airbyte
  namespace: airbyte
spec:
  releaseName: comp-airbyte
  chart:
    spec:
      chart: airbyte
      sourceRef:
        kind: HelmRepository
        name: airbyte
  interval: 50m
  install:
    remediation:
      retries: 3

e. platform/airbyte/repository.yaml:

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: airbyte
  namespace: airbyte
spec:
  interval: 5m
  url: https://airbytehq.github.io/helm-charts

If you do the previous steps, commit the code, it will work properly since the Helm Release will be applied with default Airbyte values.yaml file.

  1. Now, create a custom values.yaml value to host your own Airbyte configurations, like using an external Postgres.
├── cluster
│   ...
├── platform
│   ├── airbyte
│   │   ├── ...
│   │   ├── values.yaml
└── .gitignore

a. Use the default one used by Airbyte test scenarios: https://github.com/airbytehq/airbyte-platform/blob/main/charts/airbyte/values.yaml

b. Change the externalDatabase or any other entry, like enabling metrics (https://github.com/airbytehq/airbyte-platform/blob/main/charts/airbyte/values.yaml#L925)

...

## @section Metrics parameters
metrics:
  enabled: true
  1. Result, since the values.yaml is very big, not being able to complete the reconciliation.

a. Running flux get kustomizations we get READY as Unknown and MESSAGE as Reconciliation in progress.

b. Running flux logs --flux-namespace=flux-system --kind=Kustomization we get the following error message:

2023-12-12T17:16:23.983Z error Kustomization/airbyte.flux-system - Reconciler error Kustomization.kustomize.toolkit.fluxcd.io "airbyte" is invalid: status.conditions[1].message: Too long: may not be longer than 32768

Expected behavior

Applied revision and reconciliation completed.

For sure, I do not need to get the entire values.yaml as I did but I believe, there will be use cases in which this size is a limitation.

Screenshots and recordings

No response

OS / Distro

kubernetes Version: 1.25.6 / Kustomize Version: v5.0.1

Flux version

2.1.2

Flux check

✗ flux 2.1.2 <2.2.0 (new version is available, please upgrade)
✔ Kubernetes 1.25.6 >=1.25.0-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.36.2
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.1.1
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.1.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.1.2
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta2
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
✔ helmreleases.helm.toolkit.fluxcd.io/v2beta1
✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta2
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed

Git provider

GitLab

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@hiddeco
Copy link
Member

hiddeco commented Dec 12, 2023

The error is misleading, and I suspect your YAML is malformed which causes the kustomize-controller to print it in the Ready condition message.

We should however ensure that if messages exceed the maximum length, we trim them.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
3 participants