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

HelmRelease reporting severity instead of reason in Events #4453

Closed
1 task done
johnmadden-sp opened this issue Dec 5, 2023 · 1 comment
Closed
1 task done

HelmRelease reporting severity instead of reason in Events #4453

johnmadden-sp opened this issue Dec 5, 2023 · 1 comment

Comments

@johnmadden-sp
Copy link

Describe the bug

Using HelmRelease we're capturing Events with a webhook and the payload provided is incorrect. (This does work correctly with Kustomization.) k8s statuses such as:

$ kubectl events -n flux-system --for helmrelease/appnamehere
LAST SEEN   TYPE     REASON   OBJECT                       MESSAGE
7m34s       Normal   info     HelmRelease/appnamehere   Helm upgrade has started
3m15s       Normal   info     HelmRelease/appnamehere   Helm upgrade succeeded

REASON here should be e.g. InstallSucceeded, not info, which is the severity. The notification/Event represents this, note the duplication:

{
    "involvedObject": {
        "kind": "HelmRelease",
        "namespace": "flux-system",
        "name": "appnamehere",
        "uid": "b380efb3-1234-1234-a421-cd1e39b22e93",
        "apiVersion": "helm.toolkit.fluxcd.io/v2beta1",
        "resourceVersion": "73597309"
    },
    "severity": "info",
    "timestamp": "2023-12-04T15:44:50Z",
    "message": "Helm upgrade succeeded",
    "reason": "info",
    "metadata": {
        "revision": "0.1.3+2",
        "token": "abcd1234"
    },
    "reportingController": "helm-controller",
    "reportingInstance": "helm-controller-678f5d99b8-tsxl8"
}

Steps to reproduce

  1. Install flux
  2. Configure a helmrelease such as
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: appnamehere
  namespace: flux-system
spec:
  interval: 1m
  type: oci
  url: oci://1234.dkr.ecr.us-west-1.amazonaws.com
  provider: aws
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: appnamehere
  namespace: flux-system
spec:
  releaseName: appnamehere
  serviceAccountName: helm-controller
  targetNamespace: appnamehere
  storageNamespace: appnamehere
  interval: 1h
  timeout: 15m
  chart:
    spec:
      chart: appnamehere
      version: 0.1.x
      sourceRef:
        kind: HelmRepository
        name: appnamehere
      valuesFiles:
        - ./values.yaml
      interval: 1m
      reconcileStrategy: Revision
  install:
    remediation:
      remediateLastFailure: false
  upgrade:
    remediation:
      remediateLastFailure: true
      strategy: rollback
  values:
    image:
      tag: 0.1.x
    frontend:
      tag: 0.1.x
---
apiVersion: notification.toolkit.fluxcd.io/v1beta2
kind: Provider
metadata:
  name: flux-webhook-receiver
  namespace: flux-system
spec:
  type: generic
  address: https://host/path/to/webhook
  secretRef:
    name: etc...
  1. Push an OCI chart to that OCI endpoint and wait for reconciliation
  2. Watch events and notifications

Expected behavior

As with Kustomization, as per the documentation, reasons such as "ReconciliationSucceeded" or "ReconciliationFailed" should be in the notification and/or Event.

Screenshots and recordings

No response

OS / Distro

Amazon Linux 2

Flux version

2.1.2

Flux check

► checking prerequisites
✔ Kubernetes 1.28.3-eks-4f4795d >=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

N/A

Container Registry provider

ECR

Additional context

No response

Code of Conduct

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

hiddeco commented Dec 6, 2023

This will be addressed in the upcoming release (#4410), which has far better events in general.

25s         Normal   HelmChartInSync     helmrelease/podinfo              HelmChart/default/default-podinfo with SourceRef 'HelmRepository/default/podinfo' is in-sync
25s         Normal   UpgradeSucceeded    helmrelease/podinfo              Helm upgrade succeeded for release default/podinfo.v2 with chart [email protected]
17s         Normal   TestSucceeded       helmrelease/podinfo              Helm test succeeded for release default/podinfo.v2 with chart [email protected]: 3 test hooks completed successfully

@hiddeco hiddeco closed this as completed Dec 6, 2023
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

No branches or pull requests

2 participants