sl1pm4t / k2tf

Kubernetes YAML to Terraform HCL converter
Mozilla Public License 2.0
1.17k stars 108 forks source link

SecurityContext.Capabilities not found in Terraform schema #52

Closed ArturZurawski closed 4 years ago

ArturZurawski commented 4 years ago

First of all thanks for such awesome tool!

I'm trying to convert https://github.com/kubernetes/ingress-nginx/blob/master/deploy/cloud-generic/deployment.yaml

with following output:

❯ k2tf -f deployment.yaml -o deployment.tf
9:55PM Warn | excluding attribute [kubernetes_deployment.spec.template.spec.container.security_context.capability] not found in Terraform schema  field=Deployment.Spec.Template.Spec.Containers.SecurityContext.Capabilities name=nginx_ingress_controller type=kubernetes_deployment

SecurityContext.Capabilities seems to be supported by terraform https://github.com/terraform-providers/terraform-provider-kubernetes/issues/247

modifying output file manually seems to cause no problems while planning:

                      + security_context {
                          + allow_privilege_escalation = true
                          + privileged                 = false
                          + read_only_root_filesystem  = false
                          + run_as_user                = 33

                          + capabilities {
                              + add  = [
                                  + "NET_BIND_SERVICE",
                                ]
                              + drop = [
                                  + "ALL",
                                ]
                            }
                        }

I'm using k2tf_0.2.8_Darwin_x86_64.tar.gz

sl1pm4t commented 4 years ago

This should be fixed now by #65.