mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-04-09 18:53:34 +02:00
feat: Added support for client.authentication.k8s.io/v1beta1 (#1550)
This commit is contained in:
committed by
GitHub
parent
949bebe5bc
commit
ed048f3c1a
@@ -225,6 +225,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
|
|||||||
| <a name="input_fargate_profiles"></a> [fargate\_profiles](#input\_fargate\_profiles) | Fargate profiles to create. See `fargate_profile` keys section in fargate submodule's README.md for more details | `any` | `{}` | no |
|
| <a name="input_fargate_profiles"></a> [fargate\_profiles](#input\_fargate\_profiles) | Fargate profiles to create. See `fargate_profile` keys section in fargate submodule's README.md for more details | `any` | `{}` | no |
|
||||||
| <a name="input_fargate_subnets"></a> [fargate\_subnets](#input\_fargate\_subnets) | A list of subnets to place fargate workers within (if different from subnets). | `list(string)` | `[]` | no |
|
| <a name="input_fargate_subnets"></a> [fargate\_subnets](#input\_fargate\_subnets) | A list of subnets to place fargate workers within (if different from subnets). | `list(string)` | `[]` | no |
|
||||||
| <a name="input_iam_path"></a> [iam\_path](#input\_iam\_path) | If provided, all IAM roles will be created on this path. | `string` | `"/"` | no |
|
| <a name="input_iam_path"></a> [iam\_path](#input\_iam\_path) | If provided, all IAM roles will be created on this path. | `string` | `"/"` | no |
|
||||||
|
| <a name="input_kubeconfig_api_version"></a> [kubeconfig\_api\_version](#input\_kubeconfig\_api\_version) | KubeConfig API version. Defaults to client.authentication.k8s.io/v1alpha1 | `string` | `"client.authentication.k8s.io/v1alpha1"` | no |
|
||||||
| <a name="input_kubeconfig_aws_authenticator_additional_args"></a> [kubeconfig\_aws\_authenticator\_additional\_args](#input\_kubeconfig\_aws\_authenticator\_additional\_args) | Any additional arguments to pass to the authenticator such as the role to assume. e.g. ["-r", "MyEksRole"]. | `list(string)` | `[]` | no |
|
| <a name="input_kubeconfig_aws_authenticator_additional_args"></a> [kubeconfig\_aws\_authenticator\_additional\_args](#input\_kubeconfig\_aws\_authenticator\_additional\_args) | Any additional arguments to pass to the authenticator such as the role to assume. e.g. ["-r", "MyEksRole"]. | `list(string)` | `[]` | no |
|
||||||
| <a name="input_kubeconfig_aws_authenticator_command"></a> [kubeconfig\_aws\_authenticator\_command](#input\_kubeconfig\_aws\_authenticator\_command) | Command to use to fetch AWS EKS credentials. | `string` | `"aws-iam-authenticator"` | no |
|
| <a name="input_kubeconfig_aws_authenticator_command"></a> [kubeconfig\_aws\_authenticator\_command](#input\_kubeconfig\_aws\_authenticator\_command) | Command to use to fetch AWS EKS credentials. | `string` | `"aws-iam-authenticator"` | no |
|
||||||
| <a name="input_kubeconfig_aws_authenticator_command_args"></a> [kubeconfig\_aws\_authenticator\_command\_args](#input\_kubeconfig\_aws\_authenticator\_command\_args) | Default arguments passed to the authenticator command. Defaults to [token -i $cluster\_name]. | `list(string)` | `[]` | no |
|
| <a name="input_kubeconfig_aws_authenticator_command_args"></a> [kubeconfig\_aws\_authenticator\_command\_args](#input\_kubeconfig\_aws\_authenticator\_command\_args) | Default arguments passed to the authenticator command. Defaults to [token -i $cluster\_name]. | `list(string)` | `[]` | no |
|
||||||
|
|||||||
15
locals.tf
15
locals.tf
@@ -163,13 +163,14 @@ locals {
|
|||||||
]
|
]
|
||||||
|
|
||||||
kubeconfig = var.create_eks ? templatefile("${path.module}/templates/kubeconfig.tpl", {
|
kubeconfig = var.create_eks ? templatefile("${path.module}/templates/kubeconfig.tpl", {
|
||||||
kubeconfig_name = coalesce(var.kubeconfig_name, "eks_${var.cluster_name}")
|
kubeconfig_name = coalesce(var.kubeconfig_name, "eks_${var.cluster_name}")
|
||||||
endpoint = local.cluster_endpoint
|
endpoint = local.cluster_endpoint
|
||||||
cluster_auth_base64 = local.cluster_auth_base64
|
cluster_auth_base64 = local.cluster_auth_base64
|
||||||
aws_authenticator_command = var.kubeconfig_aws_authenticator_command
|
aws_authenticator_kubeconfig_apiversion = var.kubeconfig_api_version
|
||||||
aws_authenticator_command_args = coalescelist(var.kubeconfig_aws_authenticator_command_args, ["token", "-i", local.cluster_name])
|
aws_authenticator_command = var.kubeconfig_aws_authenticator_command
|
||||||
aws_authenticator_additional_args = var.kubeconfig_aws_authenticator_additional_args
|
aws_authenticator_command_args = coalescelist(var.kubeconfig_aws_authenticator_command_args, ["token", "-i", local.cluster_name])
|
||||||
aws_authenticator_env_variables = var.kubeconfig_aws_authenticator_env_variables
|
aws_authenticator_additional_args = var.kubeconfig_aws_authenticator_additional_args
|
||||||
|
aws_authenticator_env_variables = var.kubeconfig_aws_authenticator_env_variables
|
||||||
}) : ""
|
}) : ""
|
||||||
|
|
||||||
launch_configuration_userdata_rendered = [
|
launch_configuration_userdata_rendered = [
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ users:
|
|||||||
- name: ${kubeconfig_name}
|
- name: ${kubeconfig_name}
|
||||||
user:
|
user:
|
||||||
exec:
|
exec:
|
||||||
apiVersion: client.authentication.k8s.io/v1alpha1
|
apiVersion: ${aws_authenticator_kubeconfig_apiversion}
|
||||||
command: ${aws_authenticator_command}
|
command: ${aws_authenticator_command}
|
||||||
args:
|
args:
|
||||||
%{~ for i in aws_authenticator_command_args }
|
%{~ for i in aws_authenticator_command_args }
|
||||||
|
|||||||
@@ -191,7 +191,12 @@ variable "workers_additional_policies" {
|
|||||||
type = list(string)
|
type = list(string)
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
variable "kubeconfig_api_version" {
|
||||||
|
description = "KubeConfig API version. Defaults to client.authentication.k8s.io/v1alpha1"
|
||||||
|
type = string
|
||||||
|
default = "client.authentication.k8s.io/v1alpha1"
|
||||||
|
|
||||||
|
}
|
||||||
variable "kubeconfig_aws_authenticator_command" {
|
variable "kubeconfig_aws_authenticator_command" {
|
||||||
description = "Command to use to fetch AWS EKS credentials."
|
description = "Command to use to fetch AWS EKS credentials."
|
||||||
type = string
|
type = string
|
||||||
|
|||||||
Reference in New Issue
Block a user