Files
terraform-aws-eks/templates/kubeconfig.tpl
graywolf-at-work 05cd78593a fix: Ensure kubeconfig ends with \n (#880)
In order to be a text file according to POSIX, file needs to be composed of
text lines. Text line is defined as sequence of characters ending in \n. Sadly,
`~}` did strip everything including the \n, so the kubeconfing did not end
with a new line. Output empty string at the end to make sure of it.
2020-06-02 11:24:39 +02:00

39 lines
824 B
Smarty

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: client.authentication.k8s.io/v1alpha1
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 }