Use kubernetes provider to manage aws auth (#355)

This commit changes the way aws auth is managed. Before a local file
was used the generate the template and a null resource to apply it. This
is now switched to the terraform kubernetes provider.
This commit is contained in:
Stijn De Haes
2019-11-28 10:25:13 +01:00
committed by Max Williams
parent b69c8fb759
commit 9363662574
10 changed files with 108 additions and 82 deletions

View File

@@ -1,19 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
${worker_role_arn}
%{if chomp(map_roles) != "[]" }
${indent(4, map_roles)}
%{ endif }
%{if chomp(map_users) != "[]" }
mapUsers: |
${indent(4, map_users)}
%{ endif }
%{if chomp(map_accounts) != "[]" }
mapAccounts: |
${indent(4, map_accounts)}
%{ endif }

View File

@@ -1,8 +1,8 @@
- rolearn: ${worker_role_arn}
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
%{~ if platform == "windows" ~}
- eks:kube-proxy-windows
%{~ endif ~}
- rolearn: ${worker_role_arn}
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
%{~ if platform == "windows" ~}
- eks:kube-proxy-windows
%{~ endif ~}