Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow ACR authentication using Azure CLI #586

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Jul 17, 2024

  1. feat: Allow ACR authentication using Azure CLI

    Install azure-cli in Docker image in order to use the `az acr login` command.
    
    Can be used with Azure Managed Identities with the following script:
    
    ```yaml
    ---
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: argocd-image-updater-config
      namespace: argocd
    data:
      log.level: debug
      registries.conf: |
        registries:
        - name: acrexample
          api_url: https://acrexample.azurecr.io/
          prefix: acrexample.azurecr.io
          ping: yes
          insecure: no
          credentials: ext:/app/scripts/acr-login.sh
          credsexpire: 10h
    ---
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: argocd-image-updater-config-acr
      namespace: argocd
    data:
      acr-login.sh: |
        #!/bin/sh
        LOGIN=$(az login --identity)
        REGISTRY="acrexample"
        TOKEN=$(az acr login --name $REGISTRY --expose-token --output tsv --query accessToken)
        echo "00000000-0000-0000-0000-000000000000:$TOKEN"
    ```
    
    Closes argoproj-labs#550 and argoproj-labs#473
    
    Signed-off-by: Francesc Arbona <[email protected]>
    xescab committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    9f72ac6 View commit details
    Browse the repository at this point in the history
  2. fix: Allow enough time for az acr login to complete

    Signed-off-by: Francesc Arbona <[email protected]>
    xescab committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    1c1d8fe View commit details
    Browse the repository at this point in the history
  3. docs: Explain how to configure the script and the registry for ACR

    Signed-off-by: Francesc Arbona <[email protected]>
    xescab committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    a3fade8 View commit details
    Browse the repository at this point in the history
  4. fix: Install only necessary azure-cli components

    Signed-off-by: Francesc Arbona <[email protected]>
    xescab committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    af73e62 View commit details
    Browse the repository at this point in the history
  5. fix: Install full azure-cli

    Signed-off-by: Francesc Arbona <[email protected]>
    xescab committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    cd76581 View commit details
    Browse the repository at this point in the history