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 does not revert manual changes back to git state if source is helm #1992

Closed
1 task done
kotnn opened this issue Oct 22, 2021 · 4 comments
Closed
1 task done

Flux does not revert manual changes back to git state if source is helm #1992

kotnn opened this issue Oct 22, 2021 · 4 comments

Comments

@kotnn
Copy link

kotnn commented Oct 22, 2021

Describe the bug

Hello. I just installed Flux to our on-prem k8s cluster v1.21.3. Flux version is 0.18.3.
Git is built on top of on-prem Azure Devops Server 18.181.31626.1 (Azure DevOps Server 2020 Update 1.1)
I created 2 sources for 2 kind of applications: 1) git source 2) helm source
App with git source works as a charm. Problem only with Helm source.
Details:
I put my first application with yaml and kustomization to S3, it deployed to k8s cluster successfully. Then I modify deployment manually -> change for example replicaset to another value and about one minute later replicacount roll back to git versions as excpected.
But the same scenario does not work for helm applicaton: I put HelmRepository and HelmRelease objects to Git, application appears in k8s cluster. But if i modify manually for example replicaset in deployment, this replicaset count stays infinetely in cluster despide on git values

Steps to reproduce

  1. Clone my repo locally:
    git clone ssh://tfs.os33.net:22/DefaultCollection/Portal/_git/OS33K8S
  2. Create "nginx-helm" folder in my Git:
    mkdir nginx-helm; cd nginx-helm
  3. Create source helm repo:
    flux create source helm bitnami --url https://charts.bitnami.com/bitnami --interval 1m0s --export > helmrepo-bitnami.yaml
    Content of helmrepo-bitnami.yaml:

helmrepo-bitnami.txt

  1. Create helm-release:
    flux create helmrelease nginx --source=HelmRepository/bitnami --chart nginx --release-name nginx --target-namespace tst --interval 1m0s --export > helmrelease-nginx.yaml
    Content of helmrelease-nginx.yaml:
    helmrelease-nginx.txt

  2. commit and push changes
    git add -A ; git commit -m "add nginx app"; git push

  3. check state in k8s cluster:
    kubectl get po -n tst | grep www-5ff
    output:
    image

  4. edit deploy manually and set replicaCount to 3:
    kubectl edit deploy -n tst nginx

  5. Replicacount staus 3 forever but must revert to 2:
    image

Another moment: if i commit new change to git with new values, application is upgraded with newly commited values:

  1. edit helmrelease-nginx.yaml with new value:
    replicaCount: 1
  2. commit changes:
    git add -A ; git commit -m "modify nginx app"; git push
  3. check k8s cluster:
    image

Expected behavior

helm chart values must be revert back according to actual valies in git

Screenshots and recordings

No response

OS / Distro

ubuntu20.04 for k8s nodes, Windows 2016 as git client and Flux client

Flux version

0.18.3

Flux check

PS C:\Deployment\OS33K8S\clusters\os33dev> Flux check
► checking prerequisites
✗ flux 0.18.3 <0.19.0 (new version is available, please upgrade)
✔ Kubernetes 1.21.3 >=1.19.0-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.12.0
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.15.5
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.17.1
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.16.0
✔ all checks passed
PS C:\Deployment\OS33K8S\clusters\os33dev> \

Git provider

Azure DevOps Server 2020 Update 1.1

Container Registry provider

n/a

Additional context

Flux logs attached
logs.zip

Code of Conduct

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

hiddeco commented Oct 22, 2021

This is expected behavior at the moment, see: fluxcd/helm-controller#186

The plan is however to support this in the future (fluxcd/helm-controller#186 (comment)), but it is blocked by a bigger unit of work that should solve some other observation issues first.

@hiddeco hiddeco closed this as completed Oct 22, 2021
@kotnn
Copy link
Author

kotnn commented Oct 22, 2021

thank you

@kotnn
Copy link
Author

kotnn commented Oct 22, 2021

This is expected behavior at the moment, see: fluxcd/helm-controller#186

The plan is however to support this in the future (fluxcd/helm-controller#186 (comment)), but it is blocked by a bigger unit of work that should solve some other observation issues first.

may be any workaround for now ?

@kotnn
Copy link
Author

kotnn commented Oct 22, 2021

working for me:
flux suspend hr nginx
flux resume hr nginx

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