Terraform v0.12.24
Reduced to a relevant equivalent config:
resource "kubernetes_daemonset" "fluent_bit" {
metadata {
name = "fluent-bit"
namespace = "example"
labels = {
k8s-app = "fluent-bit"
}
}
spec {
selector {
match_labels = {
k8s-app = "fluent-bit"
}
}
template {
metadata {
name = "fluent-bit"
labels = {
k8s-app = "fluent-bit"
}
}
spec {
init_container {
image = "mesosphere/aws-cli:1.14.5"
name = "example-setup"
volume_mount {
name = "configs"
mount_path = "/configs/"
}
}
container {
image = "fluent/fluent-bit:1.4.6"
name = "example"
volume_mount {
name = "configs"
mount_path = "/configs/"
read_only = true
}
}
volume {
name = "configs"
empty_dir {}
}
}
}
}
}
N/A
N/A
What should have happened?
kubectl replace should have been used, replacing the spec field for the existing daemonset.What actually happened?
The plan showed the configs volume requiring an update:
~ volume {
name = "configs"
~ empty_dir {
+ size_limit = "0" # forces replacement
}
}
When applying this change, the existing daemonset was deleted, and failed to recreate:
kubernetes_daemonset.fluent_bit: Destruction complete after 3s
kubernetes_daemonset.fluent_bit: Creating...
Error: Failed to create daemonset: object is being deleted: daemonsets.apps "fluent-bit" already exists
on fluentbit.tf line 1, in resource "kubernetes_daemonset" "fluent_bit":
1: resource "kubernetes_daemonset" "fluent_bit" {
None known
I think this is related to #985
Thanks, @Redeux. I was filtering by open issues when searching, so I didn't see any of the existing closed ones.
It looks like #985 may have fixed this one, and I added a test so we'll be alerted if a bug like this occurs again. Thanks for the report!
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!