mirror of
https://github.com/terraform-aws-modules/terraform-aws-eks.git
synced 2025-09-09 19:32:58 +08:00
Merge branch 'master' into add-destroy-time-flag
This commit is contained in:
@@ -17,6 +17,10 @@ project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Updated instance_profile_names and instance_profile_arns outputs to also consider launch template as well as asg (by @ankitwal)
|
- Updated instance_profile_names and instance_profile_arns outputs to also consider launch template as well as asg (by @ankitwal)
|
||||||
|
- Updated application of `aws-auth` configmap to create `kube_config.yaml` and `aws_auth_configmap.yaml` in sequence (and not parallel) to `kubectl apply` (by @knittingdev)
|
||||||
|
- Exit with error code when `aws-auth` configmap is unable to be updated (by @knittingdev)
|
||||||
|
- Fix deprecated interpolation-only expression (by @angelabad)
|
||||||
|
- Fix broken terraform plan/apply on a cluster < 1.14 (by @hodduc)
|
||||||
|
|
||||||
# History
|
# History
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
|
|||||||
| cluster\_log\_kms\_key\_id | If a KMS Key ARN is set, this key will be used to encrypt the corresponding log group. Please be sure that the KMS Key has an appropriate key policy (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) | string | `""` | no |
|
| cluster\_log\_kms\_key\_id | If a KMS Key ARN is set, this key will be used to encrypt the corresponding log group. Please be sure that the KMS Key has an appropriate key policy (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) | string | `""` | no |
|
||||||
| cluster\_log\_retention\_in\_days | Number of days to retain log events. Default retention - 90 days. | number | `"90"` | no |
|
| cluster\_log\_retention\_in\_days | Number of days to retain log events. Default retention - 90 days. | number | `"90"` | no |
|
||||||
| cluster\_name | Name of the EKS cluster. Also used as a prefix in names of related resources. | string | n/a | yes |
|
| cluster\_name | Name of the EKS cluster. Also used as a prefix in names of related resources. | string | n/a | yes |
|
||||||
| cluster\_security\_group\_id | If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the workers | string | `""` | no |
|
| cluster\_security\_group\_id | If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the workers | string | `""` | no |
|
||||||
| cluster\_version | Kubernetes version to use for the EKS cluster. | string | `"1.14"` | no |
|
| cluster\_version | Kubernetes version to use for the EKS cluster. | string | `"1.14"` | no |
|
||||||
| config\_output\_path | Where to save the Kubectl config file (if `write_kubeconfig = true`). Assumed to be a directory if the value ends with a forward slash `/`. | string | `"./"` | no |
|
| config\_output\_path | Where to save the Kubectl config file (if `write_kubeconfig = true`). Assumed to be a directory if the value ends with a forward slash `/`. | string | `"./"` | no |
|
||||||
| create\_eks | Controls if EKS resources should be created (it affects almost all resources) | bool | `"true"` | no |
|
| create\_eks | Controls if EKS resources should be created (it affects almost all resources) | bool | `"true"` | no |
|
||||||
@@ -164,7 +164,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
|
|||||||
| worker\_create\_security\_group | Whether to create a security group for the workers or attach the workers to `worker_security_group_id`. | bool | `"true"` | no |
|
| worker\_create\_security\_group | Whether to create a security group for the workers or attach the workers to `worker_security_group_id`. | bool | `"true"` | no |
|
||||||
| worker\_groups | A list of maps defining worker group configurations to be defined using AWS Launch Configurations. See workers_group_defaults for valid keys. | any | `[]` | no |
|
| worker\_groups | A list of maps defining worker group configurations to be defined using AWS Launch Configurations. See workers_group_defaults for valid keys. | any | `[]` | no |
|
||||||
| worker\_groups\_launch\_template | A list of maps defining worker group configurations to be defined using AWS Launch Templates. See workers_group_defaults for valid keys. | any | `[]` | no |
|
| worker\_groups\_launch\_template | A list of maps defining worker group configurations to be defined using AWS Launch Templates. See workers_group_defaults for valid keys. | any | `[]` | no |
|
||||||
| worker\_security\_group\_id | If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the EKS cluster. | string | `""` | no |
|
| worker\_security\_group\_id | If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the EKS cluster. | string | `""` | no |
|
||||||
| worker\_sg\_ingress\_from\_port | Minimum port number from which pods will accept communication. Must be changed to a lower value if some pods in your cluster will expose a port lower than 1025 (e.g. 22, 80, or 443). | number | `"1025"` | no |
|
| worker\_sg\_ingress\_from\_port | Minimum port number from which pods will accept communication. Must be changed to a lower value if some pods in your cluster will expose a port lower than 1025 (e.g. 22, 80, or 443). | number | `"1025"` | no |
|
||||||
| workers\_additional\_policies | Additional policies to be added to workers | list(string) | `[]` | no |
|
| workers\_additional\_policies | Additional policies to be added to workers | list(string) | `[]` | no |
|
||||||
| workers\_group\_defaults | Override default values for target groups. See workers_group_defaults_defaults in local.tf for valid keys. | any | `{}` | no |
|
| workers\_group\_defaults | Override default values for target groups. See workers_group_defaults_defaults in local.tf for valid keys. | any | `{}` | no |
|
||||||
|
|||||||
+6
-3
@@ -12,13 +12,16 @@ resource "null_resource" "update_config_map_aws_auth" {
|
|||||||
working_dir = path.module
|
working_dir = path.module
|
||||||
|
|
||||||
command = <<EOS
|
command = <<EOS
|
||||||
|
completed_apply=0
|
||||||
for i in `seq 1 10`; do \
|
for i in `seq 1 10`; do \
|
||||||
echo "${null_resource.update_config_map_aws_auth[0].triggers.kube_config_map_rendered}" > kube_config.yaml & \
|
echo "${null_resource.update_config_map_aws_auth[0].triggers.kube_config_map_rendered}" > kube_config.yaml && \
|
||||||
echo "${null_resource.update_config_map_aws_auth[0].triggers.config_map_rendered}" > aws_auth_configmap.yaml & \
|
echo "${null_resource.update_config_map_aws_auth[0].triggers.config_map_rendered}" > aws_auth_configmap.yaml && \
|
||||||
kubectl apply -f aws_auth_configmap.yaml --kubeconfig kube_config.yaml && break || \
|
kubectl apply -f aws_auth_configmap.yaml --kubeconfig kube_config.yaml && \
|
||||||
|
completed_apply=1 && break || \
|
||||||
sleep 10; \
|
sleep 10; \
|
||||||
done; \
|
done; \
|
||||||
rm aws_auth_configmap.yaml kube_config.yaml;
|
rm aws_auth_configmap.yaml kube_config.yaml;
|
||||||
|
if [ "$completed_apply" = "0" ]; then exit 1; fi;
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
locals {
|
locals {
|
||||||
worker_ami_name_filter = var.worker_ami_name_filter != "" ? var.worker_ami_name_filter : "amazon-eks-node-${var.cluster_version}-v*"
|
worker_ami_name_filter = var.worker_ami_name_filter != "" ? var.worker_ami_name_filter : "amazon-eks-node-${var.cluster_version}-v*"
|
||||||
worker_ami_name_filter_windows = var.worker_ami_name_filter_windows != "" ? var.worker_ami_name_filter_windows : "Windows_Server-2019-English-Core-EKS_Optimized-${var.cluster_version}-*"
|
|
||||||
|
# Windows nodes are available from k8s 1.14. If cluster version is less than 1.14, fix ami filter to some constant to not fail on 'terraform plan'.
|
||||||
|
worker_ami_name_filter_windows = (var.worker_ami_name_filter_windows != "" ?
|
||||||
|
var.worker_ami_name_filter_windows : "Windows_Server-2019-English-Core-EKS_Optimized-${tonumber(var.cluster_version) >= 1.14 ? var.cluster_version : 1.14}-*"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
data "aws_iam_policy_document" "workers_assume_role_policy" {
|
data "aws_iam_policy_document" "workers_assume_role_policy" {
|
||||||
@@ -42,7 +46,6 @@ data "aws_ami" "eks_worker_windows" {
|
|||||||
|
|
||||||
most_recent = true
|
most_recent = true
|
||||||
|
|
||||||
# Owner ID of AWS EKS team (windows)
|
|
||||||
owners = [var.worker_ami_owner_id_windows]
|
owners = [var.worker_ami_owner_id_windows]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -20,7 +20,7 @@ variable "cluster_name" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "cluster_security_group_id" {
|
variable "cluster_security_group_id" {
|
||||||
description = "If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the workers"
|
description = "If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the workers"
|
||||||
type = string
|
type = string
|
||||||
default = ""
|
default = ""
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ variable "worker_groups_launch_template" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_security_group_id" {
|
variable "worker_security_group_id" {
|
||||||
description = "If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the EKS cluster."
|
description = "If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the EKS cluster."
|
||||||
type = string
|
type = string
|
||||||
default = ""
|
default = ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user