terraform-provider-flux: [Bug]: Flux Terraform Provider Not Updating Annotations & Comments To The Desired Version When Upgrading
Describe the bug
Hi Team,
We are currently running 2.4.0 Flux version on EKS bootstrapped via GitLab. When we are trying to upgrade it to 2.5.1, we are seeing controller deployments, their images & CRDs getting updated in the terraform plan but the annotations app.kubernetes.io/version: v2.4.0 on all Flux resources are NOT getting updated to app.kubernetes.io/version: v2.5.1 & the comments which say the Flux version are also NOT getting updated.
# This manifest was generated by flux. DO NOT EDIT.
# Flux Version: v2.4.0
Can you please check if this is a bug and provide a fix for this.
Thankyou
Steps to reproduce
Install Flux 2.4.0 using the below config:
Flux version: 2.4.0 Flux Terraform provider: 1.4.0
provider "flux" {
kubernetes = {
config_path = "${path.root}/../config.yaml"
}
git = {
url = gitlab_project.flux_bootstrap.web_url
http = {
username = var.gitlab_token
password = var.gitlab_token
}
}
}
resource "flux_bootstrap_git" "bootstrap" {
embedded_manifests = true
path = var.eks_cluster_name
namespace = "flux-cd"
version = var.flux_version
watch_all_namespaces = true
keep_namespace = true
depends_on = [kubernetes_namespace.flux_cd]
}
Upgrade it in-place using the below config:
Flux version: 2.5.1 Flux Terraform provider: 1.5.1
provider "flux" {
kubernetes = {
config_path = "${path.root}/../config.yaml"
}
git = {
url = gitlab_project.flux_bootstrap.web_url
http = {
username = var.gitlab_token
password = var.gitlab_token
}
}
}
resource "flux_bootstrap_git" "bootstrap" {
embedded_manifests = true
path = var.eks_cluster_name
namespace = "flux-cd"
version = var.flux_version
watch_all_namespaces = true
keep_namespace = true
depends_on = [kubernetes_namespace.flux_cd]
}
Expected behavior
app.kubernetes.io/version annotations & Comments should get updated along with controller deployments, controller images & CRDs.
Screenshots and recordings
Terraform and provider versions
Current Versions:
Flux version: 2.4.0
Flux Terraform provider: 1.4.0
Terraform version: 1.11.2
Versions To Which we are trying to upgrade:
Flux version: 2.5.1
Flux Terraform provider: 1.5.1
Terraform version: 1.11.2
Terraform provider configurations
Current Config:
provider "flux" {
kubernetes = {
config_path = "${path.root}/../config.yaml"
}
git = {
url = gitlab_project.flux_bootstrap.web_url
http = {
username = var.gitlab_token
password = var.gitlab_token
}
}
}
Config to which we are trying to upgrade:
provider "flux" {
kubernetes = {
config_path = "${path.root}/../config.yaml"
}
git = {
url = gitlab_project.flux_bootstrap.web_url
http = {
username = var.gitlab_token
password = var.gitlab_token
}
}
}
flux_bootstrap_git resource
Current Config:
resource "flux_bootstrap_git" "bootstrap" {
embedded_manifests = true
path = var.eks_cluster_name
namespace = "flux-cd"
version = 2.4.0
watch_all_namespaces = true
keep_namespace = true
depends_on = [kubernetes_namespace.flux_cd]
}
Config to which we are trying to upgrade:
resource "flux_bootstrap_git" "bootstrap" {
embedded_manifests = true
path = var.eks_cluster_name
namespace = "flux-cd"
version = 2.5.1
watch_all_namespaces = true
keep_namespace = true
depends_on = [kubernetes_namespace.flux_cd]
}
Flux version
2.5.1
Additional context
No response
Code of Conduct
- I agree to follow this project’s Code of Conduct
Would you like to implement a fix?
None
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (6 by maintainers)
My gut feeling tells me it is not strictly a bug, but some sort of a limitation specific to the Terraform provider.
@satyamsareen007
I’m not member of Flux development team, so I cannot answer your question. See https://fluxcd.io/support/ for your options like paid support request or Flux channel on CNCF Slack.
I just did some testing with two of my K3s clusters.
When
embedded_manifestsis set totrueandversionis set tov2.5.1the controllers will be updated as expected, but the distribution has not changedflux-v2.5.1. According to the documentation theversionwill be ignored ifembedded_manifestsis set totrue.However, when I set
embedded_versiontofalseandversiontov2.6.1the labels will be updated and the distribution has changed toflux-v2.6.1.