int128 / kubelogin

kubectl plugin for Kubernetes OpenID Connect authentication (kubectl oidc-login)
Apache License 2.0
1.73k stars 194 forks source link

Brew formula cannot co-exist with Azure/kubelogin/kubelogin #838

Open sleterrier opened 1 year ago

sleterrier commented 1 year ago

Describe the issue

int128/kubelogin/kubelogin and azure/kubelogin/kubelogin brew formulas both create a kubelogin binary:

❯ brew info kubelogin
Error: Formulae found in multiple taps:
       * azure/kubelogin/kubelogin
       * int128/kubelogin/kubelogin

Please use the fully-qualified name (e.g. azure/kubelogin/kubelogin) to refer to the formula.
❯ brew info int128/kubelogin/kubelogin
==> int128/kubelogin/kubelogin: stable v1.25.4
A kubectl plugin for Kubernetes OpenID Connect authentication
https://github.com/int128/kubelogin
/usr/local/Cellar/kubelogin/0.0.12 (3 files, 40.3MB) *
  Built from source on 2022-06-20 at 17:02:42
From: https://github.com/int128/homebrew-kubelogin/blob/HEAD/kubelogin.rb

❯ brew info azure/kubelogin/kubelogin
==> azure/kubelogin/kubelogin: stable 0.0.20
A Kubernetes credential (exec) plugin implementing azure authentication
https://github.com/Azure/kubelogin
/usr/local/Cellar/kubelogin/0.0.12 (3 files, 40.3MB) *
  Built from source on 2022-06-20 at 17:02:42
From: https://github.com/azure/homebrew-kubelogin/blob/HEAD/Formula/kubelogin.rb
License: MIT

The setup guide only mentions kubectl oidc-login; is there a reason why int128/kubelogin/kubelogin is not directly installed as bin/kubectl-oidc_login, instead of as a bin/kubelogin symlink?

  def install
    bin.install "kubelogin" => "kubelogin"
    ln_s bin/"kubelogin", bin/"kubectl-oidc_login"
  end

To reproduce

Your environment

marcmesh commented 1 year ago

Can this problem be worked around?

joshbranham commented 1 year ago

We have teams using both the Azure one and this, which forces them to uninstall/reinstall to switch between the two. Can we safely change the binary name here in a new release? Does brew offer any options for this?

ahublersos commented 9 months ago

I didn't see it mentioned in either the int128 or Azure kubelogin docs, but there is a version of the Azure kubelogin formula that uses the name az-kubelogin and it can be installed and used alongside int128/kubelogin. You can install it with brew install azure/kubelogin/az-kubelogin.

You'll need to update any AKS users clusters in your kubeconfig to the use the command az-kubelogin.

EX: AKS cluster using Azure's az-kubelogin :

users:
 - name: clusterUser_<your-aks-user>
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - get-token
      - --environment
      - AzurePublicCloud
      - --server-id
      - <syour-server-id>
      - --client-id
      - <syour-client-id>
      - --tenant-id
      - <syour-tenant-id>
      - --login
      - devicecode
      command: az-kubelogin
      env: null
      interactiveMode: IfAvailable
      provideClusterInfo: false

Some other cluster using int128's kubelogin :

 - name: clusterUser_<your-other-user>
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=<your-issuer-url>
      - --oidc-client-id=<your-client-id>
      - --oidc-extra-scope=email offline_access profile openid
      - --listen-address=0.0.0.0:8000
      - --listen-address=0.0.0.0:18000
      command: kubectl
      env: null
      interactiveMode: IfAvailable
      provideClusterInfo: false
zhjuncai commented 4 months ago

painful experience, is there a solution here? I'm also using Azure/kubelogin and int128/kubelogin/kubelogin