Terraform-aws-eks: Missing kubectl or aws-iam-authenticator should abort apply

Created on 10 Apr 2019  路  3Comments  路  Source: terraform-aws-modules/terraform-aws-eks

I'm submitting a...

  • [x] bug report

What is the current behavior?

Without kubectl, it logs some errors but still succeeds. That makes it harder to fix the problem and re-apply the changes.

If this is a bug, how to reproduce? Please include a code sample if relevant.

Run example without kubectl installed.

What's the expected behavior?

terraform apply should fail.

Environment details

  • Affected module version: 2.3.1
  • OS: linux
  • Terraform version: v0.11.11

Most helpful comment

I double this.
In our CI environment we didn't have kubectl installed, so created cluster wasn't functional.
Yet job was still finishing with success.
This is CI guy worst nightmare :)

Here is the output:

module.eks_cluster.aws_security_group_rule.workers_ingress_cluster: Creation complete after 8s (ID: sgrule-1325689863)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (20s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (10s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (30s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (20s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (40s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (30s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (50s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (40s elapsed)
module.eks_cluster.aws_autoscaling_group.workers: Creation complete after 40s (ID: eks-02019042521314172370000000e)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m0s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m10s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m20s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m30s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m40s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Creation complete after 1m40s (ID: 6995365904878102443)

Apply complete! Resources: 35 added, 0 changed, 0 destroyed.

I'm guessing inline bash script here is not failing like it should:
https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/aws_auth.tf

All 3 comments

I double this.
In our CI environment we didn't have kubectl installed, so created cluster wasn't functional.
Yet job was still finishing with success.
This is CI guy worst nightmare :)

Here is the output:

module.eks_cluster.aws_security_group_rule.workers_ingress_cluster: Creation complete after 8s (ID: sgrule-1325689863)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (20s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (10s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (30s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (20s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (40s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (30s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (50s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.aws_autoscaling_group.workers: Still creating... (40s elapsed)
module.eks_cluster.aws_autoscaling_group.workers: Creation complete after 40s (ID: eks-02019042521314172370000000e)
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m0s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m10s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m20s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m30s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth (local-exec): /bin/sh: 64: kubectl: not found
module.eks_cluster.null_resource.update_config_map_aws_auth: Still creating... (1m40s elapsed)
module.eks_cluster.null_resource.update_config_map_aws_auth: Creation complete after 1m40s (ID: 6995365904878102443)

Apply complete! Resources: 35 added, 0 changed, 0 destroyed.

I'm guessing inline bash script here is not failing like it should:
https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/aws_auth.tf

Cool, feel free to make a PR to fix.

Please retest with current master and reopen if required 馃檪

Was this page helpful?
0 / 5 - 0 ratings