Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Sample yaml with annotations. #1508

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions site/fluxctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,42 @@ filtering annotations take the form
[`regexp`](#regexp). Filter values use the same syntax as when the filter is
configured using fluxctl.

Here's a simple but complete deployment file with annotations:

```
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: k8s-mon
namespace: admin
annotations:
flux.weave.works/automated: "true"
flux.weave.works/tag.k8s-mon: glob:master-*
spec:
replicas: 1
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 50%
template:
metadata:
labels:
app: k8s-mon
spec:
containers:
- name: k8s-mon
image: index.docker.io/larktech/k8s-mon:master-c00edf01

imagePullSecrets:
- name: myregistrykey

```

Things to notice:

1. The annotations are made in `metadata.annotations`, not in `spec.template.metadata`.
2. The `flux.weave.works/tag.`... references the container name `k8s-mon`--this will change based on your container name. If you have multiple containers you would have multiple lines like that.
3. The value for the `flux.weave.works/tag.`... annotation should includes the filter pattern type, in this case `glob`.

Annotations can also be used to tell Flux to temporarily ignore certain manifests
using `flux.weave.works/ignore: "true"`. Read more about this in the [FAQ](faq.md#can-i-temporarily-make-flux-ignore-a-deployment).