github.com/argoproj/argo-cd/v2@v2.10.9/docs/operator-manual/deep_links.md (about)

     1  # Deep Links
     2  
     3  Deep links allow users to quickly redirect to third-party systems, such as Splunk, Datadog, etc. from the Argo CD
     4  user interface.
     5  
     6  Argo CD administrator will be able to configure links to third-party systems by providing 
     7  deep link templates configured in `argocd-cm`. The templates can be conditionally rendered and are able 
     8  to reference different types of resources relating to where the links show up, this includes projects, applications,
     9  or individual resources (pods, services, etc.).
    10  
    11  ## Configuring Deep Links
    12  
    13  The configuration for Deep Links is present in `argocd-cm` as `<location>.links` fields where 
    14  `<location>` determines where it will be displayed. The possible values for `<location>` are:
    15  
    16  - `project`: all links under this field will show up in the project tab in the Argo CD UI
    17  - `application`: all links under this field will show up in the application summary tab
    18  - `resource`: all links under this field will show up in the resource (deployments, pods, services, etc.) summary tab
    19  
    20  Each link in the list has five subfields:
    21  
    22  1. `title`: title/tag that will be displayed in the UI corresponding to that link
    23  2. `url`: the actual URL where the deep link will redirect to, this field can be templated to use data from the
    24     corresponding application, project or resource objects (depending on where it is located). This uses [text/template](https://pkg.go.dev/text/template) pkg for templating
    25  3. `description` (optional): a description for what the deep link is about
    26  4. `icon.class` (optional): a font-awesome icon class to be used when displaying the links in dropdown menus
    27  5. `if` (optional): a conditional statement that results in either `true` or `false`, it also has access to the same
    28     data as the `url` field. If the condition resolves to `true` the deep link will be displayed - else it will be hidden. If
    29     the field is omitted, by default the deep links will be displayed. This uses [antonmedv/expr](https://github.com/antonmedv/expr/tree/master/docs) for evaluating conditions
    30  
    31  !!!note
    32      For resources of kind Secret the data fields are redacted but other fields are accessible for templating the deep links.
    33  
    34  !!!warning
    35      Make sure to validate the url templates and inputs to prevent data leaks or possible generation of any malicious links.
    36  
    37  As mentioned earlier the links and conditions can be templated to use data from the resource, each category of links can access different types of data linked to that resource.
    38  Overall we have these 4 resources available for templating in the system:
    39  
    40  - `app` or `application`: this key is used to access the application resource data.
    41  - `resource`: this key is used to access values for the actual k8s resource.
    42  - `cluster`: this key is used to access the related destination cluster data like name, server, namespaces etc.
    43  - `project`: this key is used to access the project resource data.
    44  
    45  The above resources are accessible in particular link categories, here's a list of resources available in each category:
    46  
    47  - `resource.links`: `resource`, `application`, `cluster` and `project`
    48  - `application.links`: `app`/`application` and `cluster`
    49  - `project.links`: `project`
    50  
    51  An example `argocd-cm.yaml` file with deep links and their variations :
    52  
    53  ```yaml
    54    # sample project level links
    55    project.links: |
    56      - url: https://myaudit-system.com?project={{.project.metadata.name}}
    57        title: Audit
    58        description: system audit logs
    59        icon.class: "fa-book"
    60    # sample application level links
    61    application.links: |
    62      # pkg.go.dev/text/template is used for evaluating url templates
    63      - url: https://mycompany.splunk.com?search={{.app.spec.destination.namespace}}&env={{.project.metadata.labels.env}}
    64        title: Splunk
    65      # conditionally show link e.g. for specific project
    66      # github.com/antonmedv/expr is used for evaluation of conditions
    67      - url: https://mycompany.splunk.com?search={{.app.spec.destination.namespace}}
    68        title: Splunk
    69        if: application.spec.project == "default"
    70      - url: https://{{.app.metadata.annotations.splunkhost}}?search={{.app.spec.destination.namespace}}
    71        title: Splunk
    72        if: app.metadata.annotations.splunkhost != ""
    73    # sample resource level links
    74    resource.links: |
    75      - url: https://mycompany.splunk.com?search={{.resource.metadata.name}}&env={{.project.metadata.labels.env}}
    76        title: Splunk
    77        if: resource.kind == "Pod" || resource.kind == "Deployment"
    78  ```