Support ingress_v1
orgads opened this issue · 3 comments
orgads commented
kubernetes_ingress
belongs to v1beta1
, while the official v1 release has the more complete kubernetes_ingress_v1
. See for example hashicorp/terraform-provider-kubernetes#1023 (comment)
Example:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: foo-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/backend-protocol: https
spec:
rules:
- host: my.host.com
http:
paths:
- path: /api/v1/actions/foo
pathType: Prefix
backend:
service:
name: foo
port:
number: 443
This generates the following errors:
Warn | excluding attribute [kubernetes_ingress.spec.rule.http.path.backend.service.port] not found in Terraform schema field=Ingress.Spec.Rules.HTTP.Paths.Backend.Service.Port name=foo_ingress type=kubernetes_ingress
Warn | excluding attribute [kubernetes_ingress.spec.rule.http.path.backend.service] not found in Terraform schema field=Ingress.Spec.Rules.HTTP.Paths.Backend.Service name=foo_ingress type=kubernetes_ingress
And the tf file for spec has only this:
spec {
rule {
host = "my.host.com"
http {
path {
path = "/api/v1/actions/foo"
}
}
}
}
It misses pathType
and the entire backend
section.
The following works for me with v1:
resource "kubernetes_ingress_v1" "foo_ingress" {
metadata {
name = "foo-ingress"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
"nginx.ingress.kubernetes.io/backend-protocol" = "https"
"nginx.ingress.kubernetes.io/enable-cors" = "true"
}
}
spec {
rule {
host = "my.host.com"
http {
path {
path = "/api/v1/actions/foo"
path_type = "Prefix"
backend {
service {
name = "foo"
port {
number = 443
}
}
}
}
}
}
}
}
sl1pm4t commented
Looks like I need to update the Terraform Kubernetes provider dependency so it picks up the networking/v1 changes they added in v2.7.0
jyousefpour commented
Is there any update on this on this release?
munir94 commented
would love to know also . sp i can update my docker image