-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from oozou/fix/tls_version
feat: support additional bootstrap resource
- Loading branch information
Showing
13 changed files
with
496 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
module "bootstrap" { | ||
count = var.is_create_bootstrap ? 1 : 0 | ||
source = "./modules/bootstrap" | ||
subnet_id = var.subnets_ids[0] | ||
cluster_name = aws_eks_cluster.this.name | ||
ami = var.bootstrap_ami | ||
aws_account = var.aws_account | ||
karpenter_node_role_arns = var.karpenter_node_role_arns | ||
admin_role_arns = var.admin_role_arns | ||
admin_iam_arns = var.admin_iam_arns | ||
dev_role_arns = var.dev_role_arns | ||
readonly_role_arns = var.readonly_role_arns | ||
node_group_role_arn = aws_iam_role.node_group_role.arn | ||
vpc_id = var.vpc_id | ||
is_config_aws_auth = var.is_config_aws_auth | ||
prefix = var.prefix | ||
environment = var.environment | ||
kms_key_id = var.bootstrap_kms_key_id | ||
tags = var.tags | ||
count = var.is_create_bootstrap ? 1 : 0 | ||
source = "./modules/bootstrap" | ||
subnet_id = var.subnets_ids[0] | ||
cluster_name = aws_eks_cluster.this.name | ||
ami = var.bootstrap_ami | ||
aws_account = var.aws_account | ||
karpenter_node_role_arns = var.karpenter_node_role_arns | ||
admin_role_arns = var.admin_role_arns | ||
admin_iam_arns = var.admin_iam_arns | ||
dev_role_arns = var.dev_role_arns | ||
readonly_role_arns = var.readonly_role_arns | ||
additional_map_roles = var.additional_map_roles | ||
additional_cluster_role = var.additional_cluster_role | ||
additional_cluster_role_binding = var.additional_cluster_role_binding | ||
node_group_role_arn = aws_iam_role.node_group_role.arn | ||
vpc_id = var.vpc_id | ||
is_config_aws_auth = var.is_config_aws_auth | ||
prefix = var.prefix | ||
environment = var.environment | ||
kms_key_id = var.bootstrap_kms_key_id | ||
tags = var.tags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash -e | ||
# install dependencies packages | ||
echo "starting cloud init script . . ." | ||
sudo su | ||
sudo apt-get update | ||
sudo apt install unzip | ||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
unzip awscliv2.zip | ||
sudo ./aws/install | ||
sudo apt install jq -y | ||
|
||
# kubectl | ||
echo "install kubectl . . ." | ||
sudo apt-get install -y apt-transport-https ca-certificates curl | ||
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg | ||
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list | ||
sudo apt-get update | ||
#sudo apt-get install -y kubectl=1.23.4-00 | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl | ||
|
||
# create file | ||
echo "create script folder . . ." | ||
sudo mkdir -p /opt/scripts | ||
|
||
# configure aws | ||
echo "config aws account . . ." | ||
aws configure set region ${region} | ||
credential=$(aws secretsmanager get-secret-value --secret-id ${eks_bootstrap_secret_arn} --query SecretString --output text) | ||
aws_access_key_id=$(echo $credential | jq '.aws_access_key_id' | tr -d '"') | ||
aws_secret_access_key=$(echo $credential | jq '.aws_secret_access_key' | tr -d '"') | ||
export AWS_ACCESS_KEY_ID=$aws_access_key_id | ||
export AWS_SECRET_ACCESS_KEY=$aws_secret_access_key | ||
aws eks update-kubeconfig --region ${region} --name ${cluster_name} | ||
%{ if is_config_aws_auth } | ||
echo "config aws-auth . . ." | ||
sudo touch /opt/scripts/eks-manifest-file.yml | ||
sudo chmod 777 /opt/scripts/eks-manifest-file.yml | ||
sudo echo '${eks_manifest_file}' > /opt/scripts/eks-manifest-file.yml | ||
sudo AWS_ACCESS_KEY_ID=$aws_access_key_id AWS_SECRET_ACCESS_KEY=$aws_secret_access_key kubectl apply -f /opt/scripts/eks-manifest-file.yml | ||
%{ endif } | ||
kubectl set env daemonset aws-node -n kube-system ENABLE_PREFIX_DELEGATION=true | ||
sudo shutdown -h now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.