Skip to main content
Version: 0.17.0

Displaying custom metadata

Weave Gitops lets you add annotations with custom metadata to your flux automations and sources, and they will be displayed in the main UI.

For example, you might use this to add links to dashboards, issue system or another external system, or documentation and comments that are visible straight in the main UI.

We will use the podinfo application that we installed in the getting started guide as an example. Open up the podinfo kustomization and add annotations to it so it looks like this:

./clusters/my-cluster/podinfo-kustomization.yaml
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: podinfo
namespace: flux-system
annotations:
metadata.weave.works/description: |
Podinfo is a tiny web application made with Go that showcases best practices of running microservices in Kubernetes.
Podinfo is used by CNCF projects like Flux and Flagger for end-to-end testing and workshops.
metadata.weave.works/grafana-dashboard: https://grafana.my-org.example.com/d/podinfo-dashboard
spec:
interval: 5m0s
path: ./kustomize
prune: true
sourceRef:
kind: GitRepository
name: podinfo
targetNamespace: flux-system

When you open the gitops dashboard and navigate to the Kustomization details, you should see the following:

Application detail view showing custom metadata

There are some restrictions to keep in mind:

  • The annotation key has to start with the domain metadata.weave.works. Any other annotations will be ignored.
  • The key that will be displayed is whatever you put after the domain, title cased, and with dashes replaced with spaces. Above, metadata.weave.works/grafana-dashboard was displayed as "Grafana Dashboard".
  • The value can either be a link, or can be plain text. Newlines in plain text will be respected.
  • The key is subject to certain limitations that kubernetes impose on annotations - it must be shorter than 63 characters (not including the domain), and must be an English alphanumeric character, or one of -._. See the kubernetes documentation for the full list of restrictions.