Skip to content

Commit

Permalink
feat: Support for kubelogin on Azure
Browse files Browse the repository at this point in the history
closes #32
  • Loading branch information
dploeger committed Jun 1, 2022
1 parent d56838d commit 4b938b4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ Prefix a cluster name with an ! to load the admin-credentials for that cluster i
* (azure flavour) Environment AZ_K8S_INSTALL_OPTIONS: Additional options for the az aks install-cli programm.
(Defaults to empty)

* (azure flavour) Environment AZ_KUBELOGIN_VERSION: Version of kubelogin to install (e.g. v0.0.13). Kubelogin
won't be installed, if not set (which is the default)

* (aws flavour) Environment AWS_K8S_CLUSTERS: A comma separated list of EKS clusters to manage
inside *CloudControl* (only for aws flavour).
For each cluster give the cluster name. If you need to assume an ARN role, add that to the clustername
Expand Down
3 changes: 3 additions & 0 deletions feature/kubernetes/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ configuration:
- |
(azure flavour) Environment AZ_K8S_INSTALL_OPTIONS: Additional options for the az aks install-cli programm.
(Defaults to empty)
- |
(azure flavour) Environment AZ_KUBELOGIN_VERSION: Version of kubelogin to install (e.g. v0.0.13). Kubelogin
won't be installed, if not set (which is the default)
- |
(aws flavour) Environment AWS_K8S_CLUSTERS: A comma separated list of EKS clusters to manage
inside *CloudControl* (only for aws flavour).
Expand Down
12 changes: 12 additions & 0 deletions feature/kubernetes/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ if [ "X$(cat /home/cloudcontrol/flavour)X" == "XazureX" ]; then
IFS=' ' read -r -a install_options <<< "${AZ_K8S_INSTALL_OPTIONS:=""}"

execHandle "Installing kubectl" sudo az aks install-cli "${install_options[@]}"

if [ "X${AZ_KUBELOGIN_VERSION:=""}X" != "XX" ]; then
TEMPDIR=$(mktemp -d)
cd "${TEMPDIR}" || exit
execHandle "Downloading kubelogin" curl -LO "https://github.com/Azure/kubelogin/releases/download/${AZ_KUBELOGIN_VERSION}/kubelogin-linux-amd64.zip"
execHandle "Unpacking kubelogin" unzip kubelogin-linux-amd64.zip
execHandle "Moving kubelogin to bin" mv bin/linux_amd64/kubelogin /home/cloudcontrol/bin
cd - &>/dev/null || exit
rm -rf "${TEMPDIR}"

execHandle "Converting credentials to kubelogin" /home/cloudcontrol/bin/kubelogin convert-kubeconfig
fi
elif [ "X$(cat /home/cloudcontrol/flavour)X" == "XawsX" ]
then
waitForMfaCode
Expand Down

0 comments on commit 4b938b4

Please sign in to comment.