sl1pm4t/k2tf

Default values for terraform and kubectl can be different

charlottemach opened this issue · 2 comments

When converting a daemonset.yaml without explicitly setting automount_service_account_token to true (which is the kubectl default), terraform puts false as a default.

E.g. turning daemonset.yaml

apiVersion: apps/v1
kind: DaemonSet
metadata:
[...]
spec:
  template:
    spec:
[...]

into terraform:

resource "kubernetes_daemonset" "name" {
  metadata {
   [...]
  }
  spec {
    selector {
      match_labels = {
        [...]
      }
    }
    template {
      spec {
       [...]

results in:

apiVersion: apps/v1beta1
  kind: DaemonSet
  metadata:
    [...]
  spec:
    template:
      spec:
        automountServiceAccountToken: false

A specific example can be found here, when trying to use k2tf on the quickstart.yaml, it needs the automountServiceAccountToken to be explicitly set to true, otherwise the services can't connect.

hashicorp/terraform-provider-kubernetes#263
Related to that issue, seems to be in progress. But assuming a check in the tool can't hurt.

Looks like HashiCorp has fixed this upstream. Closing this issue.
See the following comment for more info:
#78 (comment)