Kubazulo logo

Kubazulo K8stooling

Use this command to install Kubazulo:
winget install --id=K8stooling.Kubazulo -e

Kubernetes Authentication Tool

Kubazulo is a Kubernetes Authentication Tool designed to implement Azure Active Directory (Azure AD) authentication seamlessly into the Kubernetes API-Server communication process. It functions as an exec plugin within the kubeconfig file, enabling secure and efficient access management.

Key Features:

  1. Authentication Support: Kubazulo supports both standalone and intermediate authentication flows, providing flexibility in different deployment scenarios.
  2. Integration with kubectl: It integrates smoothly with kubectl, allowing users to authenticate using Azure AD credentials directly within their Kubernetes workflows.
  3. Logging Capabilities: The tool provides detailed logging for troubleshooting and monitoring purposes, stored in the $HOME/.kube/kubazulo/application.log file.
  4. Configuration Flexibility: Kubazulo offers multiple configuration options, including customization of login modes, callback ports, and token endpoints, ensuring adaptability to various environments.
  5. Cross-Platform Compatibility: It works across different operating systems, making it versatile for diverse infrastructure setups.

Audience & Benefits: Kubazulo is ideal for organizations leveraging Azure AD as their identity provider. It simplifies the authentication process for Kubernetes clusters by eliminating the need for additional infrastructure or complex setup steps, enhancing security and operational efficiency. Users benefit from a seamless integration with existing Azure AD configurations, enabling secure access to Kubernetes resources without compromising on performance.

Kubazulo can be installed via winget, ensuring easy deployment across supported environments.

README

kubazulo

Kubeconfig Authentication Helper for Kubernetes API-Server in cunjunction with kubectl

Description

kubazulo is a client-go credential (exec) plugin implementing azure authentication. It plugs in seemless into the process of communicating to the kubernetes API-Server.

For this the kubeconfig needs to be adapted.

Setup the k8s OIDC Provider

kubazulo can be used to authenticate to general kubernetes clusters using Azure Active Directory as an OIDC provider.

  1. Create an AAD Enterprise Application and the corresponding App Registration. Check the Allow public client flows checkbox. Configure groups to be included in the response. Take a note of the directory (tenant) ID as $AAD_TENANT_ID and the application (client) ID as $AAD_CLIENT_ID

  2. Configure the API server with the following flags:

  • Issuer URL: --oidc-issuer-url=https://sts.windows.net/$AAD_TENANT_ID/
  • Client ID: --oidc-client-id=$AAD_CLIENT_ID
  • Username claim: --oidc-username-claim=upn
  • Group claim --oidc-groups-claim=groups

>See the kubernetes docs for optional flags.

  1. Configure the Exec plugin with kubelogin to use the application from the first step:

Configure for Standalone Flow (Default)

kubectl config set-credentials "kubazulo-azuread" \
  --exec-api-version=client.authentication.k8s.io/v1 \
  --exec-command=kubazulo \
  --exec-arg=get-token \
  --exec-arg=--client-id \
  --exec-arg=$AAD_CLIENT_ID \
  --exec-arg=--tenant-id \
  --exec-arg=$AAD_TENANT_ID

Configure for Intermediate Flow (Advanced)

kubectl config set-credentials "kubazulo-azuread" \
  --exec-api-version=client.authentication.k8s.io/v1beta1 \
  --exec-command=kubazulo \
  --exec-arg=get-token \
  --exec-arg=--client-id \
  --exec-arg=$AAD_CLIENT_ID \
  --exec-arg=--tenant-id \
  --exec-arg=$AAD_TENANT_ID \
  --exec-arg=--loginmode \
  --exec-arg=interactive \
  --exec-arg=--intermediate \
  --exec-arg=true \
  --exec-arg=--api-token-endpoint \
  --exec-arg=$APIGW_ENDPOINT

>Please DON'T FORGET TO SET THE OS-Environment Variables |

  1. Use this credential to connect to the cluster:

Command Argument

  • get-token

Command Flags (get-token)

ParameterDescriptionMandatoryChoicesDefault
--client-idAzure Application-ID:heavy_check_mark:n/an/a
--tenant-idAzure Tenant-ID:heavy_check_mark:n/an/a
--force-loginRe-Usage of Browser Session data:x:true, falsefalse
--loopbackportCustomize local callback listener:x:n/a58433
--loginmodeSet the Authentication Flow mode:x:interactive, devicecodeinteractive
--intermediateActivate another Token fetcher Endpoint:x:true, falsefalse
--api-token-endpointDefine Endpoint from where it gets Token:x:n/an/a

Logging

kubazulo will also log the operations it is doing to the following folder $HOME/.kube/kubazulo/application.log

References

kubectl Command Installation

https://kubernetes.io/docs/tasks/tools/

kubectl config set-context "$CLUSTER_NAME" --cluster="$CLUSTER_NAME" --user=kubazulo-azuread
kubectl config use-context "$CLUSTER_NAME"
Versions
v0.0.8-beta
1.0.2
1.0.1
1.0.0
0.0.10-beta
0.0.8-beta
Website
License