Change the ArgoCD login and navbar icon

511 Views Asked by At

I am using version v2.4.3+471685f and I've made changes to the 'argocd-cm' configmap to update the ArgoCD icon by modifying my-styles.css as follows:

.my-styles.css: | 
   .nav-bar__logo img { 
      content: url(https://My-logo.png);
   }

However, the icon has not changed despite trying all the methods mentioned in the following links:text text text

1

There are 1 best solutions below

0
JesseBot On

In Argo CD v2.8.2+dbdfc71, I got it working by changing the following my argocd-styles-cm config map:

img.sidebar__logo__character {
    width: 60px !important;
    content: url("https://user-images.githubusercontent.com/2389292/264784405-1e7e5902-d48f-440d-98f4-44028f4bd90e.png") !important;
}

I got that exact img.sidebar__logo__character field by using the right click + inspect tool in firefox and testing there. screenshot of using the firefox inspect tool to check the name of the css class of the logo image in argocd

After you update this config map, you may need to reload your argocd server pod, as config maps and secrets are only loaded into the a k8s pod at startup. You may also need to clear your cache and/or open a new tab.

Example of the full config map I'm using:

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-styles-cm
  namespace: argocd
data:
  custom.styles.css: |
    .sidebar {
      background: linear-gradient(to bottom, #414868, #232336);
      color: #c0caf5;
      box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    }
    img.sidebar__logo__character {
       width: 60px !important;
       content: url("https://user-images.githubusercontent.com/2389292/264784405-1e7e5902-d48f-440d-98f4-44028f4bd90e.png") !important;
    }

This assumes you have also set ui.cssurl in argocd-cm:

---
apiVersion: v1
kind: ConfigMap
metadata:
  ...
  name: argocd-cm
data:
  ui.cssurl: "./custom/my-styles.css"

You also need to be make sure you have mounted that volume in your deployment:

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: argocd-server
  ...
spec:
  template:
    ...
    spec:
      containers:
      - command:
        ...
        volumeMounts:
        ...
        - mountPath: /shared/app/custom
          name: styles
      ...
      volumes:
      ...
      - configMap:
          name: argocd-styles-cm
        name: styles

If you use the argocd helm chart, there is a configs.styles parameter you can use and then you don't have to do the deployment volume mount.