Skip to content

Instantly share code, notes, and snippets.

@nherment
Created April 2, 2025 06:06
Show Gist options
  • Save nherment/1d775ce7565113602639ca3de2f52153 to your computer and use it in GitHub Desktop.
Save nherment/1d775ce7565113602639ca3de2f52153 to your computer and use it in GitHub Desktop.
HolmesGPT: install argocd for development

1. install

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

2. Create an apikey user capability

kubectl edit configmap argocd-cm -n argocd

add the following to it:

data:
  # Define the 'apiuser' account and grant it the capabilities
  # to log in and have API keys generated for it.
  accounts.apiuser: apiKey, login
kubectl edit configmap argocd-rbac-cm -n argocd

add the following to it:

data:
  policy.csv: |
    p, role:admin, *, *, *, allow
    p, role:admin, accounts, apiKey, *, allow
    p, role:api-user, accounts, apiKey, apiuser, allow
    p, role:api-user, projects, get, *, allow
    p, role:api-user, applications, get, *, allow
    p, role:api-user, repositories, get, *, allow
    p, role:api-user, clusters, get, *, allow
    g, admin, role:admin
    g, apiuser, role:api-user
  policy.default: role:readonly

Restart argocd:

kubectl rollout restart deployment argocd-server -n argocd

3. Get the auth token and configure holmes

kubectl port-forward svc/argocd-server -n argocd 8080:443
# get the password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

# login
argocd login localhost:8080 --insecure --username admin --password '<password obtained above>'

# generate apiuser token
argocd account generate-token --account apiuser

Add it to holmes argocd config.

holmes:
  toolsets:
    argocd/core:
      enabled: true
  additionalEnvVars:
    - name: ARGOCD_AUTH_TOKEN
      value: "<the auth token obtained above>"
    - name: ARGOCD_OPTS
      value: "--port-forward --port-forward-namespace argocd --grpc-web"

And then the usual

helm upgrade ...

4. setup deployment

kubectl port-forward svc/argocd-server -n argocd 8080:443

Access the UI. admin password is the same as the one obtained in earlier steps.

Create app:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment