mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-21 08:59:02 +01:00
feat!: Removed support for launch configuration and replace count with for_each (#1680)
This commit is contained in:
37
templates/aws_auth_cm.tpl
Normal file
37
templates/aws_auth_cm.tpl
Normal file
@@ -0,0 +1,37 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: aws-auth
|
||||
namespace: kube-system
|
||||
data:
|
||||
mapRoles: |
|
||||
%{ for role in eks_managed_role_arns ~}
|
||||
- rolearn: ${role}
|
||||
username: system:node:{{EC2PrivateDNSName}}
|
||||
groups:
|
||||
- system:bootstrappers
|
||||
- system:nodes
|
||||
%{ endfor ~}
|
||||
%{ for role in self_managed_role_arns ~}
|
||||
- rolearn: ${role}
|
||||
username: system:node:{{EC2PrivateDNSName}}
|
||||
groups:
|
||||
- system:bootstrappers
|
||||
- system:nodes
|
||||
%{ endfor ~}
|
||||
%{ for role in win32_self_managed_role_arns ~}
|
||||
- rolearn: ${role}
|
||||
username: system:node:{{EC2PrivateDNSName}}
|
||||
groups:
|
||||
- eks:kube-proxy-windows
|
||||
- system:bootstrappers
|
||||
- system:nodes
|
||||
%{ endfor ~}
|
||||
%{ for role in fargate_profile_arns ~}
|
||||
- rolearn: ${role}
|
||||
username: system:node:{{SessionName}}
|
||||
groups:
|
||||
- system:bootstrappers
|
||||
- system:nodes
|
||||
- system:node-proxier
|
||||
%{ endfor ~}
|
||||
7
templates/bottlerocket_user_data.tpl
Normal file
7
templates/bottlerocket_user_data.tpl
Normal file
@@ -0,0 +1,7 @@
|
||||
%{ if enable_bootstrap_user_data ~}
|
||||
[settings.kubernetes]
|
||||
"cluster-name" = "${cluster_name}"
|
||||
"api-server" = "${cluster_endpoint}"
|
||||
"cluster-certificate" = "${cluster_auth_base64}"
|
||||
%{ endif ~}
|
||||
${bootstrap_extra_args ~}
|
||||
@@ -1,38 +0,0 @@
|
||||
apiVersion: v1
|
||||
preferences: {}
|
||||
kind: Config
|
||||
|
||||
clusters:
|
||||
- cluster:
|
||||
server: ${endpoint}
|
||||
certificate-authority-data: ${cluster_auth_base64}
|
||||
name: ${kubeconfig_name}
|
||||
|
||||
contexts:
|
||||
- context:
|
||||
cluster: ${kubeconfig_name}
|
||||
user: ${kubeconfig_name}
|
||||
name: ${kubeconfig_name}
|
||||
|
||||
current-context: ${kubeconfig_name}
|
||||
|
||||
users:
|
||||
- name: ${kubeconfig_name}
|
||||
user:
|
||||
exec:
|
||||
apiVersion: ${aws_authenticator_kubeconfig_apiversion}
|
||||
command: ${aws_authenticator_command}
|
||||
args:
|
||||
%{~ for i in aws_authenticator_command_args }
|
||||
- "${i}"
|
||||
%{~ endfor ~}
|
||||
%{ for i in aws_authenticator_additional_args }
|
||||
- ${i}
|
||||
%{~ endfor ~}
|
||||
%{ if length(aws_authenticator_env_variables) > 0 }
|
||||
env:
|
||||
%{~ for k, v in aws_authenticator_env_variables ~}
|
||||
- name: ${k}
|
||||
value: ${v}
|
||||
%{~ endfor ~}
|
||||
%{ endif }
|
||||
14
templates/linux_user_data.tpl
Normal file
14
templates/linux_user_data.tpl
Normal file
@@ -0,0 +1,14 @@
|
||||
%{ if enable_bootstrap_user_data ~}
|
||||
#!/bin/bash
|
||||
set -e
|
||||
%{ endif ~}
|
||||
${pre_bootstrap_user_data ~}
|
||||
%{ if length(cluster_service_ipv4_cidr) > 0 ~}
|
||||
export SERVICE_IPV4_CIDR=${cluster_service_ipv4_cidr}
|
||||
%{ endif ~}
|
||||
%{ if enable_bootstrap_user_data ~}
|
||||
B64_CLUSTER_CA=${cluster_auth_base64}
|
||||
API_SERVER_URL=${cluster_endpoint}
|
||||
/etc/eks/bootstrap.sh ${cluster_name} ${bootstrap_extra_args} --b64-cluster-ca $B64_CLUSTER_CA --apiserver-endpoint $API_SERVER_URL
|
||||
${post_bootstrap_user_data ~}
|
||||
%{ endif ~}
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# Allow user supplied pre userdata code
|
||||
${pre_userdata}
|
||||
|
||||
# Bootstrap and join the cluster
|
||||
/etc/eks/bootstrap.sh --b64-cluster-ca '${cluster_auth_base64}' --apiserver-endpoint '${endpoint}' ${bootstrap_extra_args} --kubelet-extra-args "${kubelet_extra_args}" '${cluster_name}'
|
||||
|
||||
# Allow user supplied userdata code
|
||||
${additional_userdata}
|
||||
@@ -1,11 +1,9 @@
|
||||
<powershell>
|
||||
${pre_userdata}
|
||||
|
||||
${pre_bootstrap_user_data ~}
|
||||
[string]$EKSBinDir = "$env:ProgramFiles\Amazon\EKS"
|
||||
[string]$EKSBootstrapScriptName = 'Start-EKSBootstrap.ps1'
|
||||
[string]$EKSBootstrapScriptFile = "$EKSBinDir\$EKSBootstrapScriptName"
|
||||
& $EKSBootstrapScriptFile -EKSClusterName ${cluster_name} -KubeletExtraArgs "${kubelet_extra_args}" 3>&1 4>&1 5>&1 6>&1
|
||||
& $EKSBootstrapScriptFile -EKSClusterName ${cluster_name} -APIServerEndpoint ${cluster_endpoint} -Base64ClusterCA ${cluster_auth_base64} ${bootstrap_extra_args} 3>&1 4>&1 5>&1 6>&1
|
||||
$LastError = if ($?) { 0 } else { $Error[0].Exception.HResult }
|
||||
|
||||
${additional_userdata}
|
||||
${post_bootstrap_user_data ~}
|
||||
</powershell>
|
||||
Reference in New Issue
Block a user