Skip to content

Commit

Permalink
Merge pull request #841 from ecpullen/aws-version-fix
Browse files Browse the repository at this point in the history
eks: Update the authenticator version to v1beta1
  • Loading branch information
ecpullen authored Jun 15, 2023
2 parents c92b03e + cc81525 commit 4d4fc0d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ ENTRYPOINT ["./vsphere-vm-resource-agent"]
# =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^=
# Builds the EKS resource agent image
FROM public.ecr.aws/amazonlinux/amazonlinux:2 as eks-resource-agent
RUN yum install -y unzip
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install

# Copy eksctl
COPY --from=tools /eksctl /usr/bin/eksctl
Expand Down
24 changes: 24 additions & 0 deletions bottlerocket/agents/src/bin/eks-resource-agent/eks_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,30 @@ fn write_kubeconfig(cluster_name: &str, region: &str, kubeconfig_dir: &Path) ->
));
}

info!("Updating kubeconfig file");
let status = Command::new("aws")
.args([
"eks",
"update-kubeconfig",
"--region",
region,
&format!("--name={}", cluster_name),
"--kubeconfig",
kubeconfig_dir.to_str().context(
Resources::Remaining,
format!("Unable to convert '{:?}' to string path", kubeconfig_dir),
)?,
])
.status()
.context(Resources::Remaining, "Failed update kubeconfig")?;

if !status.success() {
return Err(ProviderError::new_with_context(
Resources::Remaining,
format!("Failed update kubeconfig with status code {}", status),
));
}

Ok(())
}

Expand Down

0 comments on commit 4d4fc0d

Please sign in to comment.