diff options
author | Spike <avlampson+git@gmail.com> | 2019-05-09 15:05:04 +0100 |
---|---|---|
committer | Spike <avlampson+git@gmail.com> | 2019-05-09 15:05:04 +0100 |
commit | 8907927fab9bf122bd4f5ad0928abe6b9faec449 (patch) | |
tree | 7320aae3731f9efd616be9c4f8156499dc30d10c /terraform/kubeconfig.tf | |
parent | 1c0b57878c9ac06b707ce52a2f381b244f4ea7ac (diff) | |
download | sensyne_demo-8907927fab9bf122bd4f5ad0928abe6b9faec449.zip sensyne_demo-8907927fab9bf122bd4f5ad0928abe6b9faec449.tar.gz sensyne_demo-8907927fab9bf122bd4f5ad0928abe6b9faec449.tar.bz2 |
Adding autoscaling group for worker nodes, and kube config
Diffstat (limited to 'terraform/kubeconfig.tf')
-rw-r--r-- | terraform/kubeconfig.tf | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/terraform/kubeconfig.tf b/terraform/kubeconfig.tf new file mode 100644 index 0000000..7a923b6 --- /dev/null +++ b/terraform/kubeconfig.tf @@ -0,0 +1,58 @@ +locals { + kubeconfig = <<KUBECONFIG + + +apiVersion: v1 +clusters: +- cluster: + server: ${aws_eks_cluster.sensyne_demo_cluster.endpoint} + certificate-authority-data: ${aws_eks_cluster.sensyne_demo_cluster.certificate_authority.0.data} + name: kubernetes +contexts: +- context: + cluster: kubernetes + user: aws + name: aws +current-context: aws +kind: Config +preferences: {} +users: +- name: aws + user: + exec: + apiVersion: client.authentication.k8s.io/v1alpha1 + command: aws-iam-authenticator + args: + - "token" + - "-i" + - "${var.cluster_name}" +KUBECONFIG +} + +output "kubeconfig" { + value = "${local.kubeconfig}" +} + +locals { + config_map_aws_auth = <<CONFIGMAPAWSAUTH + + +apiVersion: v1 +kind: ConfigMap +metadata: + name: aws-auth + namespace: kube-system +data: + mapRoles: | + - rolearn: ${aws_iam_role.sensyne_demo_node.arn} + username: system:node:{{EC2PrivateDNSName}} + groups: + - system:bootstrappers + - system:nodes +CONFIGMAPAWSAUTH +} + +output "config_map_aws_auth" { + value = "${local.config_map_aws_auth}" +} + |